use of org.jetbrains.plugins.javaFX.sceneBuilder.SceneBuilderInfo in project intellij-community by JetBrains.
the class OpenInSceneBuilderAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final VirtualFile virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE);
LOG.assertTrue(virtualFile != null);
final String path = virtualFile.getPath();
final Project project = getEventProject(e);
final SceneBuilderInfo info = SceneBuilderInfo.get(project, true);
if (info == SceneBuilderInfo.EMPTY) {
return;
}
String pathToSceneBuilder = info.path;
if (SystemInfo.isMac) {
pathToSceneBuilder += "/Contents/MacOS/";
if (new File(pathToSceneBuilder, OLD_LAUNCHER).exists()) {
pathToSceneBuilder += OLD_LAUNCHER;
} else {
pathToSceneBuilder += "SceneBuilder";
}
}
final GeneralCommandLine commandLine = new GeneralCommandLine();
try {
commandLine.setExePath(FileUtil.toSystemDependentName(pathToSceneBuilder));
commandLine.addParameter(path);
commandLine.createProcess();
} catch (Exception ex) {
Messages.showErrorDialog("Failed to start SceneBuilder: " + commandLine.getCommandLineString(), CommonBundle.getErrorTitle());
}
}
Aggregations