file - Word 文件的在线编辑器以及使用 GWT 预览文件的方法

标签 file gwt gxt preview

我的 GWT 2.4.0 + GXT 2.2.4 + Amazon 项目有两个要求,

  1. 我们仅将 Word 文档存储在我们的应用程序中(每次登录只能访问他的文档)。现在我希望用户可以像 ZOHO writer 一样在线编辑自己的 Word 文档。如何在我的应用程序中实现此功能?

  2. 我们还存储图像、文本文件、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/

相关文章:

java - GXT 3 ContentPanel 自动高度或 FillLayout

gwt - 使用 GWT RPC 调用将数据加载到 Sencha GXT (3.0) ListStore 的简单示例?

java - GXT 3\Grid\第一列的宽度

java - 获取给定 url 的图像并将其转换为字节数组

linux - XFS,是否可以在连续的 block 中写入文件?

java - 将图表添加到现有 SmatGWT 项目

java - 如何将 Maven 管理的依赖项复制到 war\web-inf\lib 中,以便我可以在 Eclipse 中以 Debug模式运行我的 GWT 2.0 应用程序?

c# - 写入文件 C# 的性能

java - Apache Camel 获取交换路径

java - Vaadin 7 中的动态 CSS 编辑