从 IntelliJ 内部启动时,Netbeans 平台的工具栏是黑色的
Netbeans Platform's toolbars are black when launching from inside IntelliJ
我目前正在尝试将我的一个应用程序移植到 Netbeans 平台。因为我是 IntelliJ 用户,所以我更喜欢使用我最喜欢的 IDE - 幸运的是有相关教程。
设置好我需要的一切后,构建第一个测试应用程序(空 window)我想继续从 IntelliJ 内部启动我的应用程序。遗憾的是,这并不像听起来那么容易(或者我还没有找到任何其他方法)我按照 this tutorial 并创建了以下 "Starter" class:
/**
* 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();
}
}
}
但是,在启动时,我看到了这个屏幕,清楚地显示了它有什么问题:
我错过了什么吗?非常感谢!
我实际上能够通过升级到 802 版本的 netbeans 平台来解决这个问题。这似乎是个问题,已得到解决!
我目前正在尝试将我的一个应用程序移植到 Netbeans 平台。因为我是 IntelliJ 用户,所以我更喜欢使用我最喜欢的 IDE - 幸运的是有相关教程。
设置好我需要的一切后,构建第一个测试应用程序(空 window)我想继续从 IntelliJ 内部启动我的应用程序。遗憾的是,这并不像听起来那么容易(或者我还没有找到任何其他方法)我按照 this tutorial 并创建了以下 "Starter" class:
/**
* 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();
}
}
}
但是,在启动时,我看到了这个屏幕,清楚地显示了它有什么问题:
我错过了什么吗?非常感谢!
我实际上能够通过升级到 802 版本的 netbeans 平台来解决这个问题。这似乎是个问题,已得到解决!