}
@Override
public void invokeAction ( String string, Lookup lkp ) throws IllegalArgumentException {
if (COMMAND_RUN.equals( string )) {
final NodeJSExecutable exe = NodeJSExecutable.getDefault();
FileObject main = getLookup().lookup( NodeJSProjectProperties.class ).getMainFile();
if (main == null) {
main = showSelectMainFileDialog();
if (main != null) {
NodeJSProjectProperties props = getLookup().lookup( NodeJSProjectProperties.class );
props.setMainFile( main );
StatusDisplayer.getDefault().setStatusText( NbBundle.getMessage( NodeJSProject.class,
"MSG_MAIN_FILE_SET", getName(), main.getName() ) );
} else {
return;
}
}
final FileObject toRun = main;
if (toRun != null && toRun.isValid()) {
final Runnable runIt = new Runnable() {
@Override
public void run () {
try {
exe.run( toRun, getLookup().lookup( NodeJSProjectProperties.class ).getRunArguments() );
} catch ( IOException ex ) {
throw new IllegalArgumentException( ex );
}
}
};