public final SourceGroup toGroup(FileObject loc) { assert loc != null; return GenericSources.group(getProject(), loc, location.length() > 0 ? location : "generic", // NOI18N displayName, icon, openedIcon); } }
/** * consult the SourceGroup cache, return true if anything changed.. */ private boolean checkJavaGroupCache(FileObject root, String name, String displayName) { SourceGroup group = javaGroup.get(name); if (root == null && group != null) { javaGroup.remove(name); return true; } if (root == null) { return false; } boolean changed = false; if (group == null) { group = GenericSources.group(project, root, name, displayName, null, null); javaGroup.put(name, group); changed = true; } else { if (!group.getRootFolder().equals(root)) { group = GenericSources.group(project, root, name, displayName, null, null); javaGroup.put(name, group); changed = true; } } return changed; }
public SourceGroup addGroup(Project project, String type, FileObject fo, String displayName) { synchronized (this) { if (rootsListenedTo.add(CndFileUtils.fileObjectToUrl(fo)) && haveAttachedListeners) { fo.addFileChangeListener(this); } List<SourceGroup> l = groups.get(type); if (l == null) { l = new ArrayList<>(); groups.put(type, l); } SourceGroup group = GenericSources.group(project, fo, fo.getPath(), displayName, null, null); l.add(group); return group; } }
@NbBundle.Messages({ "SG_ScalaSources=Scala Packages", "SG_Test_ScalaSources=Scala Test Packages" }) private void maybeAddGroup(List<SourceGroup> groups, boolean test) { //XXX we should consult the maven project configuration as well FileObject root = project.getProjectDirectory().getFileObject("src/" + (test ? "test" : "main") + "/scala"); if (root != null) { groups.add(GenericSources.group(project, root, test ? NAME_SCALATESTSOURCE : NAME_SCALASOURCE, test ? SG_Test_ScalaSources() : SG_ScalaSources(), null, null)); } }
@NbBundle.Messages("sources_display_name=Selenium Sources") private SourceGroup getSeleniumSourceGroup(Project project) { FileObject dir = getSeleniumDir(project, true); if (dir == null) { return ProjectUtils.getSources(project).getSourceGroups(Sources.TYPE_GENERIC)[0]; } String sourcesDisplayName = Bundle.sources_display_name(); return GenericSources.group(project, dir, "SeleniumDir", sourcesDisplayName, null, null); }
public SourceGroup[] getSourceGroups(String str) { if (Sources.TYPE_GENERIC.equals(str)) { return new SourceGroup[] { GenericSources.group(project, project.getProjectDirectory(), NAME_PROJECTROOT, project.getLookup().lookup(ProjectInformation.class).getDisplayName(), null, null) }; return new SourceGroup[] { GenericSources.group(project, fo, "resources", //NOI18N NbBundle.getMessage(MavenSourcesImpl.class, "SG_Project_Resources"), null, null) };