代理一个ActionListener构建过程无法正常工作

时间:2016-12-02 16:10:31

标签: eclipse build ide codenameone

我正在使用代号构建我的第一个应用 但是我认为在使用eclipse和新的GUI Builder时构建过程中存在一个错误。 我是eclipse的霓虹灯,本周刚刚安装了cn1插件。

1)导致actionListeners无法工作的主要原因是EventCallbackClass中缺少一行

public void actionPerformed(com.codename1.ui.events.ActionEvent ev) {
            com.codename1.ui.Component sourceComponent = ev.getComponent();
            if(sourceComponent.getParent().getLeadParent() != null) {
                sourceComponent = sourceComponent.getParent().getLeadParent();
            }

            if(sourceComponent == gui_createAccount) {
             --------------missing------------------
            }
}

应该在那里调用 oncreateAccountActionEvent -method,但它不在生成的代码中。

它可能是因为我在构建期间遇到错误

2)点击"动作事件"时出现此错误在"属性表" - > "活动"图。

'Building workspace' has encountered a problem. Errors occured during the build.

Errors occurred during the build.
Errors running builder 'Integrated External Tool Builder' on project 'MA'.
Ant build C:\Users\sieben\workspace\MA\build.xml already in progress. Concurrent Ant builds are possible if you specify to build in a separate JRE.
Ant build C:\Users\sieben\workspace\MA\build.xml already in progress. Concurrent Ant builds are possible if you specify to build in a separate JRE. 

然而,控制台窗口对我来说很好看

  [echo] Compile is forcing compliance to the supported API's/features for maximum device compatibility. This allows smaller
  [echo]            code size and wider device support
  [javac] C:\Users\sieben\workspace\MA\build.xml:147: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
  [javac] C:\Users\sieben\workspace\MA\build.xml:171: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Buildfile: C:\Users\sieben\workspace\MA\build.xml

jar:
  [copy] Copying 1 file to C:\Users\sieben\workspace\MA\build\tmp
  [javac] Compiling 4 source files to C:\Users\sieben\workspace\MA\build\tmp
  [jar] Building jar: C:\Users\sieben\workspace\MA\dist\MA.jar
BUILD SUCCESSFUL
Total time: 1 second

感谢您的任何建议,也许我必须重新开始...

修改 - 解决方法:

在构造函数中指定action事件侦听器方法,如下所示:

 gui_createAccount.addActionListener((ev) -> {
             oncreateAccountActionEvent(ev);
        });

1 个答案:

答案 0 :(得分:1)

这是一个已经在其他IDE中修复的错误,但似乎仍然会影响Eclipse。一旦负责的工程师能够集合,我们就会尝试发布Eclipse更新。