Package org.netbeans.api.project

Examples of org.netbeans.api.project.Project


    }

    protected abstract String[] getLaunchCommandLine ( boolean showDialog );

    public void stopRunningProcesses ( Lookup.Provider p ) {
        Project prj = p.getLookup().lookup( Project.class );
        if (prj != null) {
            Rerunner r = rerunners.get( prj );
            if (r != null) {
                r.stopOldProcessIfRunning();
                rerunners.remove( prj );
View Full Code Here


        while ( projectDir != null && (!projectDir.isFolder() || projectDir.getFileObject( PACKAGE_JSON ) == null) ) {
            projectDir = projectDir.getParent();
        }
        projectDir = resolve( projectDir );
        if (projectDir != null && projectDir.getFileObject( PACKAGE_JSON ) != null) {
            Project p = ProjectManager.getDefault().findProject( projectDir );
            if (p != null) {
                return p.getLookup().lookup( NodeJSProject.class );
            }
        }
        return null;
    }
View Full Code Here

        actions.add( getFilesystemAction() );
        actions.addAll( Lookups.forPath( "Project/NodeJS/Actions" ).lookupAll( Action.class ) ); //NOI18N
        actions.add( new AbstractAction( NbBundle.getMessage( RootNode.class, "PROPERTIES" ) ) { //NOI18N
            @Override
            public void actionPerformed ( ActionEvent e ) {
                Project project = getLookup().lookup( Project.class );
                new PropertiesPanel( project.getLookup().lookup( NodeJSProjectProperties.class ) ).showDialog();
            }
        } );
        final LibrariesResolver resolver = getLookup().lookup( Project.class ).getLookup().lookup( LibrariesResolver.class );
        if (resolver.hasMissingLibraries()) {
            actions.add(new AbstractAction(NbBundle.getMessage(RootNode.class, "RESOLVE_LIBRARIES")){ //NOI18N
View Full Code Here

        return actions.toArray( new Action[actions.size()] );
    }

    private Action getFilesystemAction () {
        Project project = getLookup().lookup( Project.class );
        FileSystemAction a = SystemAction.get( FileSystemAction.class );
        try {
            if (project.getProjectDirectory().isValid()) {
                Node n = DataObject.find( project.getProjectDirectory() ).getNodeDelegate();
                return a.createContextAwareInstance( n.getLookup() );
            } else {
                return a;
            }
        } catch ( DataObjectNotFoundException ex ) {
View Full Code Here

        }
    }

    @Override
    protected void createPasteTypes ( Transferable t, List<PasteType> s ) {
        Project project = getLookup().lookup( Project.class );
        try {
            Node n = DataObject.find( project.getProjectDirectory() ).getNodeDelegate();
            s.addAll( Arrays.asList( n.getPasteTypes( t ) ) );
        } catch ( DataObjectNotFoundException ex ) {
            Logger.getLogger( RootNode.class.getName() ).log( Level.INFO,
                    "Project dir disappeared: {0}", project ); //NOI18N
        }
View Full Code Here

    private Node createSourceNode ( Key<?> k ) throws DataObjectNotFoundException {
        FileObject of = (FileObject) k.get();
        if (of.isFolder() && of.getFileObject( NodeJSProjectFactory.PACKAGE_JSON ) != null) {
            try {
                Project proj = ProjectManager.getDefault().findProject( of );
                if (proj != null) {
                    LogicalViewProvider vp = proj.getLookup().lookup( LogicalViewProvider.class );
                    if (vp != null) {
                        return new FilterNode( vp.createLogicalView() );
                    }
                }
            } catch ( IOException ex ) {
View Full Code Here

                @Override
                public void actionPerformed ( ActionEvent e ) {
                    final DataObject dob = getLookup().lookup( DataObject.class );
                    if (dob != null && dob.isValid()) {
                        Project p = FileOwnerQuery.getOwner( dob.getPrimaryFile().getParent() );
                        final NodeJSProject prj = p == null ? null : p
                                .getLookup()
                                .lookup( NodeJSProject.class );
                        System.out.println( "PROJECT IS " + prj );
                        RequestProcessor.getDefault().post( new Runnable() {
                            @Override
View Full Code Here

        try {
            // store properties
            ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() {
                @Override
                public Void run() throws IOException {
                    Project project = getProject(phpModule);
                    AntProjectHelper helper = getAntProjectHelper(project);
                    if (helper == null) {
                        return null;
                    }
                    EditableProperties properties = helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
View Full Code Here

     *
     * @param phpModule
     * @return
     */
    private static PropertyEvaluator getPropertyEvalutor(PhpModule phpModule) {
        Project project = getProject(phpModule);
        AntProjectHelper helper = getAntProjectHelper(project);
        helper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
        return PropertyUtils.sequentialPropertyEvaluator(
                helper.getStockPropertyPreprovider(),
                helper.getPropertyProvider(AntProjectHelper.PRIVATE_PROPERTIES_PATH),
View Full Code Here

    private Project getUnloadedProject(File projectDir) throws IOException {
        File normProjectDir = FileUtil.normalizeFile(projectDir);
        try (Closeable safeToOpenRef = NbGradleProjectFactory.safeToOpen(normProjectDir)) {
            assert safeToOpenRef != null; // Avoid warning

            Project project = ProjectManager.getDefault().findProject(FileUtil.toFileObject(normProjectDir));
            if (project == null) {
                throw new IllegalArgumentException("Project does not exist: " + normProjectDir);
            }

            return project;
View Full Code Here

TOP

Related Classes of org.netbeans.api.project.Project

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.