javaParameters.getProgramParametersList().add("-sliceandcharat");
javaParameters.getProgramParametersList().add("-skel", jflex.get(1).getAbsolutePath());
javaParameters.getProgramParametersList().add("-d", VfsUtil.virtualToIoFile(virtualDir).getAbsolutePath());
javaParameters.getProgramParametersList().add(VfsUtil.virtualToIoFile(flexFile).getAbsolutePath());
OSProcessHandler processHandler = javaParameters.createOSProcessHandler();
RunContentDescriptor runContentDescriptor = createConsole(project, commandName);
((ConsoleViewImpl) runContentDescriptor.getExecutionConsole()).attachToProcess(processHandler);
processHandler.addProcessListener(new ProcessAdapter() {
@Override
public void processTerminated(ProcessEvent event) {
if (event.getExitCode() == 0) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
ensureLexerClassCreated(project, virtualDir, lexerClassName, commandName);
}
}, project.getDisposed());
}
}
});
processHandler.startNotify();
}
catch (ExecutionException ex) {
Messages.showErrorDialog(project, "Unable to run JFlex"+ "\n" + ex.getLocalizedMessage(), commandName);
}
}