Package org.netbeans.modules.nodejs.api

Examples of org.netbeans.modules.nodejs.api.NodeJSExecutable


    }

    @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 );
                        }
                    }
                };
View Full Code Here


            return null;
        }
    }

    private FileObject findBuiltIn ( NodeJSProject prj, String name ) {
        NodeJSExecutable exe = prj.getLookup().lookup( NodeJSPlatformProvider.class).get();
        String loc = exe.getSourcesLocation();
        if (loc != null && !loc.isEmpty() && new File( loc ).isDirectory()) {
            File sourcesRoot = new File( loc );
            FileObject src = FileUtil.toFileObject( sourcesRoot );
            if (src != null) {
                FileObject result = src.getFileObject( name + ".js" );
View Full Code Here

        instance = this;
    }

    public static DefaultExecutable get () {
        if (instance == null) {
            NodeJSExecutable e = NodeJSExecutable.getDefault();
            if (e instanceof DefaultExecutable) {
                instance = (DefaultExecutable) e;
            } else {
                instance = new DefaultExecutable();
            }
View Full Code Here

TOP

Related Classes of org.netbeans.modules.nodejs.api.NodeJSExecutable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.