当前位置: 首页>>代码示例>>Java>>正文


Java ProjectInformation.getDisplayName方法代码示例

本文整理汇总了Java中org.netbeans.api.project.ProjectInformation.getDisplayName方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectInformation.getDisplayName方法的具体用法?Java ProjectInformation.getDisplayName怎么用?Java ProjectInformation.getDisplayName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.api.project.ProjectInformation的用法示例。


在下文中一共展示了ProjectInformation.getDisplayName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPackageRootNode

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
private Node createPackageRootNode(FileObject rootFO, Project project, Filter filter) {
    Node origNode;
    try {
        origNode = DataObject.find(rootFO).getNodeDelegate();
    }
    catch (DataObjectNotFoundException ex) {
        ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);
        return null;
    }

    String displayName;
    Project owner = FileOwnerQuery.getOwner(rootFO);
    if (owner != null) {
        SourceGroup g = getSourceGroup(rootFO, owner);
        displayName = g != null ? g.getDisplayName() : FileUtil.getFileDisplayName(rootFO);
        if (project != owner) {
            ProjectInformation pi = ProjectUtils.getInformation(owner);
            displayName += " [" + pi.getDisplayName() + "]"; // NOI18N
        }
    }
    else displayName = FileUtil.getFileDisplayName(rootFO);

    return new FilteredNode(origNode, displayName, filter);

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ClassPathFileChooser.java

示例2: getListCellRendererComponent

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    if (" ".equals(value)) { // NOI18N
        return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    }
    File f = (File) value;
    String message = f.getAbsolutePath();
    if (projectConflict) {
        Project p = FileOwnerQuery.getOwner(Utilities.toURI(f));
        if (p!=null) {
            ProjectInformation pi = ProjectUtils.getInformation(p);
            String projectName = pi.getDisplayName();
            message = MessageFormat.format (NbBundle.getMessage(SourceRootsUi.class,"TXT_RootOwnedByProject"), new Object[] {
                message,
                projectName});
        }
    }
    return super.getListCellRendererComponent(list, message, index, isSelected, cellHasFocus);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:SourceRootsUi.java

示例3: getListCellRendererComponent

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
public Component getListCellRendererComponent(
        JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    // #93658: GTK needs name to render cell renderer "natively"
    setName("ComboBox.listRenderer"); // NOI18N

    String text = null;
    if (!(value instanceof Project)) {
        text = value.toString();
    } else {
        ProjectInformation pi = ProjectUtils.getInformation((Project) value);
        text = pi.getDisplayName();
        setIcon(pi.getIcon());
    }
    setText(text);

    if ( isSelected ) {
        setBackground(list.getSelectionBackground());
        setForeground(list.getSelectionForeground());
    }
    else {
        setBackground(list.getBackground());
        setForeground(list.getForeground());
    }

    return this;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:WizardUtils.java

示例4: actionPerformed

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    init();
    for (ProteomicsProject project : lkpInfo.allInstances()) {
        // use it somehow...
        String propPath = project.getProjectPropertiesFile().getPath();
        ProjectInformation info = ProjectUtils.getInformation(project);
        String projName = info.getDisplayName();
        StringBuilder sb = new StringBuilder();
        sb.append("The prop file for project: ");
        sb.append(projName);
        sb.append("\n");
        sb.append("Is at: ");
        sb.append(propPath);
        JOptionPane.showMessageDialog(null, sb.toString());
    }
}
 
开发者ID:chhh,项目名称:batmass,代码行数:18,代码来源:TestManualAction.java

示例5: getDisplayName

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
@Override
public String getDisplayName() {
    ProjectInformation info = getProjectInformation();
    if (info != null) {
        return info.getDisplayName();
    } else {
        return NbBundle.getMessage(ProjectNode.class, "TXT_UnknownProjectName");
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:10,代码来源:ProjectNode.java

示例6: initProjectInfo

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
private void initProjectInfo() {
    Project p = FileOwnerQuery.getOwner(fileObject);
    if (p != null) {
        ProjectInformation pi = ProjectUtils.getInformation(p);
        projectName = pi.getDisplayName();
        projectIcon = pi.getIcon();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:AbstractBeanTypeDescriptor.java

示例7: evaluate

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
@Override
public void evaluate(SearchRequest request, SearchResponse response) {
    final String searchText = request.getText().toLowerCase();

    for (final Project project : OpenProjects.getDefault().getOpenProjects()) {
        final ProjectInformation info = ProjectUtils.getInformation(project);
        if (info == null || info.getDisplayName() == null) {
            continue;
        }
        final String projectName = info.getDisplayName();
        final String projectNameLower = projectName.toLowerCase();

        if (projectNameLower.contains(searchText)) {
            final boolean result = response.addResult(new Runnable() {
                @Override
                public void run() {
                    //see http://forums.netbeans.org/post-140855.html#140855
                    ProjectUtilities.selectAndExpandProject(project);
                    ProjectUtilities.makeProjectTabVisible();
                }
            }, projectName);
            if (!result) {
                break;
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:SearchForProjectsQuickSearch.java

示例8: getListCellRendererComponent

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
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(Utilities.toURI(f));
        if (p!=null) {
            ProjectInformation pi = ProjectUtils.getInformation(p);
            String projectName = pi.getDisplayName();
            message = NbBundle.getMessage(SourceFoldersPanel.class,"TXT_RootOwnedByProject", message, projectName);
        }
    }
    return super.getListCellRendererComponent(list, message, index, isSelected, cellHasFocus);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:SourceFoldersPanel.java

示例9: updateProjectProperties

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
private void updateProjectProperties(@NonNull final String newName) {
    if (!updatedProps.isEmpty()) {
        final ProjectInformation pi = ProjectUtils.getInformation(project);
        final String oldName = pi.getDisplayName();
        final EditableProperties ep = helper.getProperties (AntProjectHelper.PROJECT_PROPERTIES_PATH);
        for (Map.Entry<String,Pair<String,Boolean>> e : updatedProps.entrySet()) {
            final String propName = e.getKey();
            final String format = e.getValue().first();
            final boolean antName = e.getValue().second();
            final String oldProp = MessageFormat.format(
                format,
                antName ?
                    PropertyUtils.getUsablePropertyName(oldName) :
                    oldName);
            final String propValue = ep.getProperty(propName);
            if (oldProp.equals (propValue)) {
                final String newProp = MessageFormat.format(
                    format,
                    antName ?
                        PropertyUtils.getUsablePropertyName(newName) :
                        newName);
                ep.put (propName, newProp);
            }
        }
        helper.putProperties (AntProjectHelper.PROJECT_PROPERTIES_PATH,ep);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:ProjectOperations.java

示例10: ProjectTreeElement

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
/** Creates a new instance of ProjectTreeElement */
public ProjectTreeElement(Project prj) {
    ProjectInformation pi = ProjectUtils.getInformation(prj);
    name = pi.getDisplayName();
    icon = pi.getIcon();
    this.prj = new WeakReference<Project>(prj);
    prjDir = prj.getProjectDirectory();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ProjectTreeElement.java

示例11: getListCellRendererComponent

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    if (value == null || value instanceof String) {
        return super.getListCellRendererComponent(list, null, index, isSelected, cellHasFocus);
    }
    ProjectInformation info = ProjectUtils.getInformation((Project) value);
    JLabel label = (JLabel) super.getListCellRendererComponent(list, info.getDisplayName(), index, isSelected, cellHasFocus);
    label.setIcon(info.getIcon());
    return label;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ProjectRenderer.java

示例12: initialize

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
@Override
public boolean initialize(Lookup context, AtomicBoolean cancel) {
    FileObject file = context.lookup(FileObject.class);
    Project selected = null;
    if (file != null) {
        selected = FileOwnerQuery.getOwner(file);
    }
    if (selected == null) {
        selected = context.lookup(Project.class);
        if (selected == null) {
            SourceGroup sg = context.lookup(SourceGroup.class);
            if (sg != null) {
                selected = FileOwnerQuery.getOwner(sg.getRootFolder());
            }
        }
        if (selected == null) {
            DataFolder df = context.lookup(DataFolder.class);
            if (df != null) {
                selected = FileOwnerQuery.getOwner(df.getPrimaryFile());
            }
        }
    }
    if (selected == null || !OpenProjects.getDefault().isProjectOpen(selected)) {
        return false;
    }

    ProjectInformation pi = ProjectUtils.getInformation(selected);
    final SourceGroup[] sourceGroups = ProjectUtils.getSources(pi.getProject()).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
    FileObject[] projectSources = new FileObject[sourceGroups.length];
    for (int i = 0; i < sourceGroups.length; i++) {
        projectSources[i] = sourceGroups[i].getRootFolder();
    }
    scope = Scope.create(Arrays.asList(projectSources), null, null);

    detail = pi.getDisplayName();
    icon = pi.getIcon();
    return true;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:CurrentJavaProjectScopeProvider.java

示例13: getDisplayName

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
@Override
@NonNull
public String getDisplayName() {
    final ProjectInformation d = delegate;
    if (d != null) {
        return d.getDisplayName();
    } else {
        String res = result.getDisplayName();
        if (res == null) {
            res = getName();
        }
        return res;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:DefaultProjectConvertorServices.java

示例14: getProjectName

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
@Override
@NonNull
public String getProjectName() {
    String res = projectName;
    if (res == null) {
        final ProjectInformation pi = getProjectInfo();
        res = projectName = pi == null ?
            "" :    //NOI18N
            pi.getDisplayName();
    }
    return res;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:FileDescription.java

示例15: getDisplayName

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
private static String getDisplayName(FileObject fo, Project owner, boolean incPrjName) {
    if (owner != null) {
        SourceGroup grp = getSourceGroup(fo, owner);
        String n = (grp!=null)?grp.getDisplayName():FileUtil.getFileDisplayName(fo);
        if (incPrjName) {
            ProjectInformation pi = ProjectUtils.getInformation(owner);
            n  += " [" + pi.getDisplayName() + "]";
        }
        return n;
    } else 
        return FileUtil.getFileDisplayName(fo);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:SelectorUtils.java


注:本文中的org.netbeans.api.project.ProjectInformation.getDisplayName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。