use of org.openide.filesystems.FileObject 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;
}
use of org.openide.filesystems.FileObject 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;
}
use of org.openide.filesystems.FileObject in project netbeans-mmd-plugin by raydac.
the class MMDEditorSupport method getProjectDirectory.
public File getProjectDirectory() {
File result = null;
final Project project = getProject();
if (project != null) {
final FileObject projDir = project.getProjectDirectory();
if (projDir != null) {
return FileUtil.toFile(projDir);
}
}
return result;
}
use of org.openide.filesystems.FileObject in project netbeans-mmd-plugin by raydac.
the class MMDGraphEditor method getProjectFolderAsFileObject.
@Nullable
public FileObject getProjectFolderAsFileObject() {
final Project proj = this.editorSupport.getProject();
FileObject result = null;
if (proj != null) {
result = proj.getProjectDirectory();
}
return result;
}
use of org.openide.filesystems.FileObject in project netbeans-mmd-plugin by raydac.
the class RefactoringUtils method hasOnlyMMDNodes.
public static boolean hasOnlyMMDNodes(final Lookup lookup) {
final Collection<? extends Node> nodes = lookup.lookupAll(Node.class);
boolean result = false;
for (final Node n : nodes) {
final FileObject fo = n.getLookup().lookup(FileObject.class);
if (fo != null) {
if (!isMMD(fo)) {
result = false;
break;
} else {
result = true;
}
}
}
return result;
}
Aggregations