从IntelliJ

时间:2015-06-04 17:22:07

标签: java netbeans intellij-idea netbeans-platform

我目前正在尝试将我的一个应用程序移植到Netbeans平台上。由于我是IntelliJ用户,我更喜欢使用我最喜欢的IDE - 幸运的是有教程。

在设置了我需要的所有东西后,构建第一个测试应用程序(空窗口)我想继续从IntelliJ内部启动我的应用程序。因为这可能不是听起来那么容易(或者我还没有找到任何其他方式),我跟着this tutorial并创建了以下“Starter”类:

/**
 * Represents a starter for the Netbeans platform.
 *
 * The original code of this modified class can be found at
 * <a href="http://netbeans.dzone.com/using-maven-and-intellij-idea">this article</a>.
 */
public class NetbeansStarter {
    private static final String BRANDING = "swordsmith";
    private static final String WORKDIR = "application" + File.separatorChar + "target";
    private static final String USER = WORKDIR + File.separatorChar + "userdir";
    private static final String HOME = WORKDIR + File.separatorChar + BRANDING + File.separatorChar + "platform";


    public static void main(String[] args) throws Exception {
        // Cleanup the user's cache (otherwise problems arise, cache seems to be not written correctly).
        deleteRecursive(new File(USER, "var" + File.separatorChar + "cache"));

        // Set some system properties
        System.setProperty("netbeans.logger.console", "true"); // for logging on the console
        System.setProperty("netbeans.user", USER); // settings are stored here
        System.setProperty("netbeans.home", HOME); // Netbeans cluster
        System.setProperty("sun.awt.keepWorkingSetOnMinimize", "true"); // maven sets this per default on starting

        // Build new arguments list
        final List<String> list = new LinkedList<String>();
        list.addAll(Arrays.asList("--branding", BRANDING));
        list.addAll(Arrays.asList(args));

        Main.main(list.toArray(new String[list.size()]));
    }

    @SuppressWarnings("ResultOfMethodCallIgnored")
    private static void deleteRecursive(File pPath) {
        if (!pPath.exists()) {
            return;
        }

        File[] files = pPath.listFiles();
        if (files == null) {
            return ;
        }

        for (File file : files) {
            if (file.isDirectory()) deleteRecursive(file);
            else file.delete();
        }
    }

}

然而,在发布时,我会看到这个屏幕,它清楚地显示了它的错误:

The background color of the toolbars is black

有什么我错过的吗?非常感谢提前!

1 个答案:

答案 0 :(得分:0)

我实际上只是通过升级到netbeans平台的802版本来解决这个问题。似乎这是一个问题,并已修复!