我的 GWT 2.4.0 + GXT 2.2.4 + Amazon 项目有两个要求,
我们仅将 Word 文档存储在我们的应用程序中(每次登录只能访问他的文档)。现在我希望用户可以像 ZOHO writer 一样在线编辑自己的 Word 文档。如何在我的应用程序中实现此功能?
我们还存储图像、文本文件、Word 文件、PDF 文件等。我想在用户单击文件时显示这些文件的预览。类似 docs.com。如何实现这一目标?
我只需要指导如何实现这两个要求。如有任何建议,我们将不胜感激。
谢谢。
最佳答案
GWT 提出了 XML 的 Code 镜像库的 Wrapper 类 编辑检查这是针对客户端的
public XMLEditorPanel(int height, int width, final String xmlToDisplay) {
this.xmlToDisplay = xmlToDisplay;
setHeaderVisible(false);
setHeight(height);
setWidth(width);
config = new CodeMirrorConfiguration();
config.setLineNumbers(true);
config.setTextWrapping(false);
config.setAutoMatchParens(false);
editor = new CodeMirror(config);
editor.addInitializeHandler(new InitializeHandler() {
public void onInitialize(InitializeEvent event) {
editor.setParser(CodeMirror.PARSER_XML);
editor.setIndentUnit(2);
editor.setFocus();
if (xmlToDisplay != null && xmlToDisplay != "" && xmlToDisplay.length() > 0) {
editor.setValue(xmlToDisplay, false);
} else {
editor.setValue(" ", false);
}
editor.reindent();
}
});
editor.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
XMLEditorPanel.this.xmlToDisplay = editor.getValue();
}
});
add(editor);
}
关于file - Word 文件的在线编辑器以及使用 GWT 预览文件的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15849829/