Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/348.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法在GWT(2.7)GWTP(1.5)项目中添加GwtQuery(1.0.6)DragAndDropCellTree_Java_Gwt_Gwtp_Gwtquery - Fatal编程技术网

Java 无法在GWT(2.7)GWTP(1.5)项目中添加GwtQuery(1.0.6)DragAndDropCellTree

Java 无法在GWT(2.7)GWTP(1.5)项目中添加GwtQuery(1.0.6)DragAndDropCellTree,java,gwt,gwtp,gwtquery,Java,Gwt,Gwtp,Gwtquery,我正试图在我的GWTP项目中向MyView.java添加一个。但我无法编译它: 如果我尝试在开发模式下导航到MyView: [ERROR] Errors in 'com/google/gwt/user/cellview/client/CellBasedWidgetImplStandard.java' [ERROR] Line 54: Referencing method 'com.google.gwt.user.client.DOM.dispatchEvent(Lcom/google

我正试图在我的GWTP项目中向MyView.java添加一个。但我无法编译它:

如果我尝试在开发模式下导航到MyView:

[ERROR] Errors in 'com/google/gwt/user/cellview/client/CellBasedWidgetImplStandard.java'    
  [ERROR] Line 54: Referencing method 'com.google.gwt.user.client.DOM.dispatchEvent(Lcom/google/gwt/user/client/Event;Lcom/google/gwt/user/client/Element;Lcom/google/gwt/user/client/EventListener;)': unable to resolve method in class 'com.google.gwt.user.client.DOM'    
[ERROR] - Member 'null' in JSNI reference '@com.google.gwt.user.client.DOM::null' could not be found; expect subsequent failures
进入DragAndDropCellTree后,我到达CellTree中的第624-625行:

this.style=resources.cellTreeStyle; 重新注入this.style.cn

样式设置为“成功”,但其注入字段为false。因此ensureInjected不会返回,它必须抛出异常

我可能对TreeViewModel和AbstractCell做了一些错误的事情,我用它来构建我的DragAndDropCellTree。。。我不确定

关于如何解决这个问题有什么想法,或者还有什么需要研究的吗? 谢谢

编辑:my pom.xml请参见底部的DND依赖项及其正上方的存储库,根据:

编辑:从my.gwt.xml:


查看CellBasedWidgetImplStandard.java的源代码,我可以清楚地看到它失败的原因。它传递给DOM.dispatchEvent的第二个参数是:

而在最新版本的GWT中,该方法的第二个参数是:

Lcom/google/gwt/dom/client/Element;
请注意这两者在包名称上的差异。如果我没记错的话,这是GWT2.6中所做的更改,因此我认为这里的解决方案是找到DnD库的更新版本。也许这一个符合要求:


查看CellBasedWidgetImplStandard.java的源代码,我可以清楚地看到它失败的原因。它传递给DOM.dispatchEvent的第二个参数是:

而在最新版本的GWT中,该方法的第二个参数是:

Lcom/google/gwt/dom/client/Element;
请注意这两者在包名称上的差异。如果我没记错的话,这是GWT2.6中所做的更改,因此我认为这里的解决方案是找到DnD库的更新版本。也许这一个符合要求:


正如我对@Simon DeWolf的公认答案的评论所说,这里有更多关于让GwtQuery DragAndDropCellTree实例化和GWT编译的细节。除了我在这个问题中所描述的尝试之外,他的回答有理由说明这个解决方案是必要的

如果您的GWT项目是一个Maven项目,则这些详细信息适用:它们包括添加为Maven存储库,以便使用更新版本的pretty easy 但是,您始终可以使用基本方法下载Github源代码,并将其编译成.jar以添加到项目的类路径中

在项目中创建Maven依赖项的更新版本。这些说明是用来做这件事的。将此添加到pom.xml中: `

将以下内容添加到.gwt.xml模块文件:


正如我对@Simon DeWolf的公认答案的评论所说,这里有更多关于让GwtQuery DragAndDropCellTree实例化和GWT编译的细节。除了我在这个问题中所描述的尝试之外,他的回答有理由说明这个解决方案是必要的

如果您的GWT项目是一个Maven项目,则这些详细信息适用:它们包括添加为Maven存储库,以便使用更新版本的pretty easy 但是,您始终可以使用基本方法下载Github源代码,并将其编译成.jar以添加到项目的类路径中

在项目中创建Maven依赖项的更新版本。这些说明是用来做这件事的。将此添加到pom.xml中: `

将以下内容添加到.gwt.xml模块文件:


这看起来像是模块继承问题。您能发布*.gwt.xml文件吗?@SimonDeWolf谢谢,但我想您正在查看可拖放插件?这与我为DragAndDropCellTree链接的DragAndDrop插件不同;1.0.6是GWT2.5+的最新DragAndDrop插件:@SimonDeWolf刚刚添加了我的pom。感谢这看起来像是模块继承问题。您能发布*.gwt.xml文件吗?@SimonDeWolf谢谢,但我想您正在查看可拖放插件?这与我为DragAndDropCellTree链接的DragAndDrop插件不同;1.0.6是GWT2.5+的最新DragAndDrop插件:@SimonDeWolf刚刚添加了我的pom。谢谢你!看起来您对DOM.dispatchEvent调用的看法是正确的。您提到的ArcBees Github项目也已经成功了!我将在这里给出一个单独的答案,其中包含更多关于设置的详细信息,但我会接受这个答案,因为这是解决方案的最初核心。谢谢!看起来您对DOM.dispatchEvent调用的看法是正确的。您提到的ArcBees Github项目也已经成功了!我将在这里给出一个单独的答案,其中包含关于设置的更多细节,但我会接受这个答案,因为这是解决方案的最初核心。
<inherits name='com.google.gwt.user.User'/>
<inherits name="com.gwtplatform.mvp.MvpWithEntryPoint"/>
<inherits name='gwtquery.plugins.droppable.Droppable'/>
Lcom/google/gwt/user/client/Element;
Lcom/google/gwt/dom/client/Element;
<repositories>
    <!-- for com.github dependencies (doc @ https://jitpack.io/) -->
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependencies>
    <!-- GwtQuery - these dependencies must be before gwt dependency (these override/replace some things in gwt) -->
    <dependency>
        <groupId>com.googlecode.gwtquery</groupId>
        <artifactId>gwtquery</artifactId>
        <version>1.4.2</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.github.Arcbees</groupId>
        <artifactId>gwtquery-droppable-plugin</artifactId>
        <version>486057e</version>
    </dependency>
     ...
</dependencies>`