Search in sources :

Example 1 with DataFolder

use of org.openide.loaders.DataFolder in project netbeans-mmd-plugin by raydac.

the class MMKnowledgeSources method node.

@Override
public Node node(final SourceGroup key) {
    SourceNode node = null;
    if (key != null) {
        final FileObject rootFolder = key.getRootFolder();
        final DataFolder folder = getFolder(rootFolder);
        if (folder != null) {
            node = new SourceNode(project, folder, this, key.getDisplayName());
            if (KNOWLEDGE_FOLDER_NAME.equals(folder.getName())) {
                node.setIcons(BadgeIcons.BADGED_FOLDER, BadgeIcons.BADGED_FOLDER_OPEN);
                node.setShortDescription(BUNDLE.getString("KnowledgeSourceGroup.tooltip"));
            }
        }
    }
    return node;
}
Also used : FileObject(org.openide.filesystems.FileObject) DataFolder(org.openide.loaders.DataFolder)

Example 2 with DataFolder

use of org.openide.loaders.DataFolder in project netbeans-mmd-plugin by raydac.

the class MMKnowledgeSources method keys.

@Override
public List<SourceGroup> keys() {
    final SourceGroup[] sourceGroups = getSourceGroups(this.project);
    final List<SourceGroup> keysList = new ArrayList<SourceGroup>();
    FileObject fileObject;
    for (final SourceGroup g : sourceGroups) {
        fileObject = g.getRootFolder();
        DataFolder srcDir = getFolder(fileObject);
        if (srcDir != null) {
            keysList.add(g);
        }
    }
    return keysList;
}
Also used : ArrayList(java.util.ArrayList) FileObject(org.openide.filesystems.FileObject) DataFolder(org.openide.loaders.DataFolder) SourceGroup(org.netbeans.api.project.SourceGroup)

Aggregations

FileObject (org.openide.filesystems.FileObject)2 DataFolder (org.openide.loaders.DataFolder)2 ArrayList (java.util.ArrayList)1 SourceGroup (org.netbeans.api.project.SourceGroup)1