Examples of VisibilityQuery


Examples of org.netbeans.api.queries.VisibilityQuery

            refresh( false );
        }
    }

    public List<ProjectNodeKey> libraries () {
        VisibilityQuery q = VisibilityQuery.getDefault();
        List<ProjectNodeKey> keys = new ArrayList<>();
        Map<String, List<FileObject>> otherLibs = findOtherModules( project.getProjectDirectory() );
        FileObject libFolder = project.getProjectDirectory().getFileObject( NodeJSProjectFactory.NODE_MODULES_FOLDER );
        if (libFolder != null) {
            Set<ProjectNodeKey> libFolders = new HashSet<>();
            Set<FileObject> childFolders = new LinkedHashSet<>();
            for (FileObject lib : libFolder.getChildren()) {
                File f = FileUtil.toFile( lib );
                try {
                    f = f.getCanonicalFile();
                    lib = FileUtil.toFileObject( FileUtil.normalizeFile( f ) );
                } catch ( IOException ex ) {
                    Logger.getLogger( LibrariesChildFactory.class.getName() ).log( Level.FINER,
                            "No canonical file for " + lib.getPath(), ex ); //NOI18N
                }
                childFolders.add( lib );
            }
            for (FileObject lib : childFolders) {
                boolean visible = q.isVisible( lib );
                if ((visible) && (!NodeJSProjectFactory.NODE_MODULES_FOLDER.equals( lib.getName() ))
                        && (!"nbproject".equals( lib.getName() )) && (lib.isFolder())) { //NOI18N
                    if (otherLibs.containsKey( lib.getName() )) {
                        otherLibs.remove( lib.getName() );
                    }
View Full Code Here

Examples of org.netbeans.api.queries.VisibilityQuery

        project.getProjectDirectory().removeFileChangeListener( fcl );
    }

    @Override
    protected boolean createKeys ( List<Key<?>> toPopulate ) {
        VisibilityQuery vq = VisibilityQuery.getDefault();
        Set<FileObject> meta = new HashSet<FileObject>( project.getMetadataFiles() );
        for (FileObject fo : project.getDataFiles()) {
            if (NodeJSProjectFactory.NODE_MODULES_FOLDER.equals( fo.getName() ) && fo.isFolder()) {
                continue;
            }
            if (vq.isVisible( fo ) && !meta.contains( fo )) {
                toPopulate.add( new Key<FileObject>( fo ) );
            }
        }
        toPopulate.add( Key.IMPORTANT_FILES );
        toPopulate.add( Key.LIBRARIES );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.