Package org.openide.nodes

Examples of org.openide.nodes.Node


    }

   
    public void generateImports(Vector Imports1)
    { 
        Node anode[] = getChildren().getNodes();
        for(int l = 0; l < anode.length; l++)
        {
            ((BaseNode)anode[l]).generateImports(Imports1);
           
       
View Full Code Here


    }

    @Override
    public void propertyChange ( PropertyChangeEvent evt ) {
        if (ProjectMetadata.PROP_NAME.equals( evt.getPropertyName() )) {
            Node n = logicalView.getView();
            if (n != null) {
                n.setDisplayName( evt.getNewValue() + "" );
            }
        }
    }
View Full Code Here

    FileObject showSelectMainFileDialog () {
        ExplorerPanel ep = new ExplorerPanel();
        final ExplorerManager mgr = ep.getExplorerManager();
        ChildFactory<?> kids = new AllJSFiles( getProjectDirectory() );
        Children ch = Children.create( kids, true );
        Node root = new AbstractNode( ch );
        mgr.setRootContext( root );
        final SwingValidationGroup grp = SwingValidationGroup.create();
        ValidationPanel pnl = new ValidationPanel( grp );
        pnl.setInnerComponent( ep );
        class X extends ValidationListener<Void> implements PropertyChangeListener {
            X () {
                super( Void.class, ValidationUI.NO_OP, null );
            }

            @Override
            public void propertyChange ( PropertyChangeEvent pce ) {
                grp.performValidation();
            }

            @Override
            protected void performValidation ( Problems prblms ) {
                Node[] selection = mgr.getSelectedNodes();
                if (selection != null && selection.length == 1) {
                    return;
                }
                prblms.add( new Problem( NbBundle.getMessage( NodeJSProject.class, "PROBLEM_NO_MAIN_FILE" ), Severity.FATAL ) ); //NOI18N
            }
        }
        X x = new X();
        mgr.addPropertyChangeListener( x );
        grp.addItem( x, true );
        DialogBuilder b = new DialogBuilder( NodeJSProject.class ).setModal( true ).setContent( ep ).setValidationGroup( grp ).setTitle( NbBundle.getMessage( NodeJSProject.class, "CHOOSE_NO_MAIN_FILE" ) ).setDialogType( DialogType.QUESTION );
        if (b.showDialog( NotifyDescriptor.OK_OPTION ) && mgr.getSelectedNodes().length == 1) {
            Node n = mgr.getSelectedNodes()[0];
            FileObject fo = n.getLookup().lookup( DataObject.class ).getPrimaryFile();
            return fo;
        }
        return null;
    }
View Full Code Here

        LibrariesChildFactory f = new LibrariesChildFactory( prj );
        f.createKeys( keys );
        Map<LibraryFilterNode, CountDownLatch> latches = new LinkedHashMap<>();
        for (ProjectNodeKey k : keys) {
            CountDownLatch latch = new CountDownLatch( 1 );
            Node n = f.node( k, latch );
            if (n instanceof LibraryFilterNode) {
                LibraryFilterNode ln = (LibraryFilterNode) n;
                if (ln.getKey().getType() == ProjectNodeKeyTypes.LIBRARY && ln.getKey().isDirect()) {
                    latches.put( ln, latch );
                }
View Full Code Here

                    return node;
                }
            }
            try {
                DataObject dob = DataObject.find( fo );
                Node n = dob.getNodeDelegate();
                synchronized ( this ) {
                    return node = new FilterNode( n );
                }
            } catch ( DataObjectNotFoundException ex ) {
                Logger.getLogger( SourcesChildFactory.class.getName() ).log(
View Full Code Here

        @Override
        public void onEvent ( EventType type, String path ) {
            System.out.println( "onEvent " + type + " " + path + " for " + fo.getNameExt() );
            if (type == EventType.DELETED && path == null) {
                Node n;
                synchronized ( this ) {
                    n = this.node;
                }
                if (n != null) {
                    try {
                        n.destroy();
                    } catch ( IOException ex ) {
                        Exceptions.printStackTrace( ex );
                    }
                }
            }
View Full Code Here

    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 ) {
            Exceptions.printStackTrace( 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

        @Override
        public Action[] getActions ( boolean ignored ) {
            DataObject dataObject = this.getLookup().lookup( DataObject.class );
            if (dataObject != null) {
                Node n = dataObject.getNodeDelegate();
                return n.getActions( ignored );
            }
            if (key.type() == KeyType.LIBRARIES) {
                NodeJSProject project = getLookup().lookup( NodeJSProject.class );
                assert project != null;
                NodeJSLogicalViewProvider l = project.getLookup().lookup( NodeJSLogicalViewProvider.class );
View Full Code Here

        @Override
        public Action getPreferredAction () {
            DataObject dataObject = this.getLookup().lookup( DataObject.class );
            if (dataObject != null) {
                Node n = dataObject.getNodeDelegate();
                return n.getPreferredAction();
            }
            return super.getPreferredAction();
        }
View Full Code Here

TOP

Related Classes of org.openide.nodes.Node

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.