Refine search
protected String getProjectDisplayName(Project project) { String name = ProjectUtils.getInformation(project).getDisplayName(); RemoteProject remoteProject = project.getLookup().lookup(RemoteProject.class); if (remoteProject != null) { final ExecutionEnvironment env = remoteProject.getSourceFileSystemHost(); if (env.isRemote()) { name += " [" + env.getDisplayName() + ']'; // NOI18N //name = "<html>" + name + "<font color='!controlShadow'>" + env.getDisplayName() + "</html>"; } } return name; }
private void initProjectInfo() { Project p = FileOwnerQuery.getOwner(fileObject); if (p != null) { ProjectInformation pi = ProjectUtils.getInformation(p); projectName = pi.getDisplayName(); projectIcon = pi.getIcon(); } } }
@Override public Image getIcon(int type) { Icon icon = info.getIcon(); if (icon == null) { Logger.getLogger(ProjectsView.class.getName()).log(Level.WARNING, "Null project icon for {0}:{1}", //NOI18N new Object[] { info.getDisplayName(), info.getProject() }); return getFolderIcon(); } else { return ImageUtilities.icon2Image(icon); } }
public Component getListCellRendererComponent (JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { if (value == null) return super.getListCellRendererComponent (list, value, index, isSelected, cellHasFocus); ProjectInformation info = ((Project) value).getLookup ().lookup (ProjectInformation.class); super.getListCellRendererComponent (list, info != null ? info.getDisplayName () : null, index, isSelected, cellHasFocus); if (info != null) setIcon (info.getIcon ()); return this; }
private void computeAndSetDisplayName(final List<? extends RakeTask> tasks) { ProjectInformation info = ProjectUtils.getInformation(project); String baseDisplayName = info == null ? NbBundle.getMessage(RakeRunnerAction.class, "RakeRunnerAction.Rake") : info.getDisplayName(); StringBuilder displayNameSB = new StringBuilder(baseDisplayName).append(" ("); // NOI18N for (int i = 0; i < tasks.size(); i++) { displayNameSB.append(tasks.get(i).getTask()); if (i != tasks.size() - 1) { displayNameSB.append(", "); // NOI18N } } displayNameSB.append(')'); setDisplayName(displayNameSB.toString()); // NOI18N }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { File f = (File) value; String message = f.getAbsolutePath(); if (projectConflict) { Project p = FileOwnerQuery.getOwner(f.toURI()); if (p!=null) { ProjectInformation pi = ProjectUtils.getInformation(p); String projectName = pi.getDisplayName(); message = MessageFormat.format (NbBundle.getMessage(J2SESourceRootsUi.class,"TXT_RootOwnedByProject"), new Object[] { message, projectName}); } } return super.getListCellRendererComponent(list, message, index, isSelected, cellHasFocus); } }
private void update() { project = null; TopComponent tc = TopComponent.getRegistry().getActivated(); if (tc != null) { FileObject fo = tc.getLookup().lookup(FileObject.class); if (fo == null) { DataObject dob = tc.getLookup().lookup(DataObject.class); if (dob != null) { fo = dob.getPrimaryFile(); } } if (fo != null) { Project p = FileOwnerQuery.getOwner(fo); if (p != null) { project = p; } } } if (project != null) { applicable = true; name = NbBundle.getMessage(SearchScopeCurrentProject.class, "SearchScopeCurrentProject", shortName(project)); //NOI18N icon = ProjectUtils.getInformation(project).getIcon(); } else { applicable = false; name = ""; //NOI18N icon = null; } notifyListeners(); }
public String getDisplayName (Object o) throws UnknownTypeException { if (o == TreeModel.ROOT) { return NbBundle.getBundle(SourcesNodeModel.class).getString("CTL_SourcesModel_Column_Name_Name"); } else if (o instanceof String) { File f = new File ((String) o); if (f.exists ()) { FileObject fo = FileUtil.toFileObject (f); Project p = FileOwnerQuery.getOwner (fo); if (p != null) { ProjectInformation pi = (ProjectInformation) p.getLookup (). lookup (ProjectInformation.class); return java.text.MessageFormat.format(NbBundle.getBundle(SourcesNodeModel.class).getString( "CTL_SourcesModel_Column_Name_ProjectSources"), new Object [] { f.getPath(), pi.getDisplayName() }); } return java.text.MessageFormat.format(NbBundle.getBundle(SourcesNodeModel.class).getString( "CTL_SourcesModel_Column_Name_LibrarySources"), new Object [] { f.getPath() }); } else return (String) o; } else throw new UnknownTypeException (o); }
setName(ProjectUtils.getInformation(provider.getProject()).getDisplayName()); brokenIncludesResult = Lookup.getDefault().lookup(new Lookup.Template<>(BrokenIncludes.class)); brokenIncludesResult.addLookupListener(MakeLogicalViewRootNode.this); resultChanged(null); updateAnnotationFiles(); ProjectInformation pi = provider.getProject().getLookup().lookup(ProjectInformation.class); pi.addPropertyChangeListener(WeakListeners.propertyChange(MakeLogicalViewRootNode.this, pi)); ToolsCacheManager.addChangeListener(WeakListeners.change(MakeLogicalViewRootNode.this, null)); if (gotMakeConfigurationDescriptor()) {
private void selectProject(final Project p) { final ExplorerManager em = ((ExplorerManager.Provider) WindowManager.getDefault().findTopComponent("projectTabLogical_tc")).getExplorerManager(); // NOI18N Node root = em.getRootContext(); // Node projNode = root.getChildren ().findChild( p.getProjectDirectory().getName () ); Node projNode = null; for (Node n : root.getChildren().getNodes()) { Project prj = n.getLookup().lookup(Project.class); if (prj != null && prj.getProjectDirectory().equals(p.getProjectDirectory())) { projNode = n; break; } } if (projNode == null) { // fallback.. projNode = root.getChildren().findChild(ProjectUtils.getInformation(p).getName()); } if (projNode != null) { try { em.setSelectedNodes(new Node[]{projNode}); } catch (Exception ignore) { // may ignore it } } } };
return false; Project p = FileOwnerQuery.getOwner(fo); if(p == null) { return false; if(p.getProjectDirectory().equals(fo) && !ProjectUtils.getInformation(p).getDisplayName().equals(activatedNodes[0].getDisplayName())) { return false; return false; Collection<? extends Lookup.Item<TestCreatorProvider>> providers = Lookup.getDefault().lookupResult(TestCreatorProvider.class).allItems(); boolean enable; for (Lookup.Item<TestCreatorProvider> provider : providers) {
public static String getProjectName(Lookup.Provider project) { ProjectInformation info = project.getLookup().lookup(ProjectInformation.class); return (info != null) ? info.getDisplayName() : "UNKNOWN"; }
lastProject = resultProjects.allInstances().iterator().next(); logger.log(FINER, "resultChanged: Found project [{0}] in the normal lookup.", ProjectUtils.getInformation(lastProject).getDisplayName()); } else if (OpenProjects.getDefault().getOpenProjects().length == 0) { clearProjectLookup(); if (lastProject == null) { Node currrentNode = globalContextLookup.lookup(Node.class); Project project = findProjectThatOwnsNode(currrentNode); if (project != null) { lastProject = project; logger.log(FINER, "resultChanged: Found project [{0}] that owns current node.", ProjectUtils.getInformation(lastProject).getDisplayName());
ProjectInformation info = prj.getLookup().lookup(ProjectInformation.class); if (info != null) { String pname = info.getName(); if (pname != null) { values.put("name", pname); // NOI18N String pdname = info.getDisplayName(); if (pdname != null) { values.put("displayName", pdname); // NOI18N
private void setProject() { FileObject parent = project.getProjectDirectory().getParent(); File parentFile = FileUtil.toFile(parent); String parentPath; if (parentFile != null) { parentPath = parentFile.getAbsolutePath(); } else { // #199706 parentPath = System.getProperty("java.io.tmpdir"); } projectLocation.setText(parentPath); if (isMove) { projectName.setText(ProjectUtils.getInformation(project).getName()); } else { projectName.setText(computeValidProjectName(parentPath, ProjectUtils.getInformation(project).getName())); } updateProjectFolder(); validateDialog(); if (hasExternalSources() && !isMove) { extSourcesWarning.setText(NbBundle.getMessage(DefaultProjectCopyPanel.class, "WRN_External_Sources")); invalid = true; } }
private void updateText() { String className = getNewClassName(); if (className == null) { ProjectInformation info = ProjectUtils.getInformation(project); className = info.getName(); //support.getParent().getCurrentFileName(); String firstChar = String.valueOf(className.charAt(0)).toUpperCase(); String otherChars = className.substring(1); className = firstChar + otherChars + NbBundle.getMessage(JSEApplicationClassChooser.class, "TXT_FileNameApplicationClassPostfix"); // NOI18N textFieldClassName.setText(className); } }
public NodeExecutor (String title, String command, FileObject root, String[] args) { arguments = ((args == null) ? null : Arrays.asList(args)); this.root = root; Project owner = FileOwnerQuery.getOwner(root); String name = ProjectUtils.getInformation(owner).getDisplayName(); displayName = title; this.command = command; }
public FutureResult() { try { ClientSideProjectUtilities.logUsage(BowerInstallAction.class, "USG_BOWER_INSTALL", null); done = new AtomicBoolean(false); cancelled = new AtomicBoolean(false); execute = new NodeExecutor(Bundle.TTL_bower_install(ProjectUtils.getInformation(project).getDisplayName()), "bower", project.getProjectDirectory(), new String[]{"install"}).execute(); //NOI18N } catch (IOException ex) { this.ex = ex; } }