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


Java ProjectInformation.getIcon方法代码示例

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


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

示例1: initProjectInfo

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
private void initProjectInfo() {
    Project p = FileOwnerQuery.getOwner(this.rootURI);
    if (p != null) {
        final ProjectInformation pi = p.getLookup().lookup(ProjectInformation.class);   //Intentionally does not use ProjectUtil.getInformation() as it does slow icon annotation
        projectName = pi == null ?
            p.getProjectDirectory().getNameExt() :
            pi.getDisplayName();
        projectIcon = pi == null ?
            null :
            pi.getIcon();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:JavaTypeProvider.java

示例2: 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

示例3: getIcon

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
    if (cachedIcon == null) {
        ProjectInformation info = getProjectInformation();
        if (info != null) {
            Icon icon = info.getIcon();
            cachedIcon = ImageUtilities.icon2Image(icon);
        }
        else {
            cachedIcon = ImageUtilities.loadImage(PROJECT_ICON);
        }
    }
    return cachedIcon;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:ProjectNode.java

示例4: 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

示例5: 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

示例6: getIcon

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

示例7: getProjectIcon

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
public static Icon getProjectIcon(Lookup.Provider project) {
    ProjectInformation info = project.getLookup().lookup(ProjectInformation.class);

    if (info == null) {
        return new ImageIcon();
    } else {
        return info.getIcon();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ProjectUtilities.java

示例8: getIcon

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
@Override
public Icon getIcon() {
    Project p = OpenProjects.getDefault().getMainProject();
    if (p != null) {
        ProjectInformation pi = ProjectUtils.getInformation(p);
        if (pi != null) {
            return pi.getIcon();
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:SearchScopeMainProject.java

示例9: getProjectIcon

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

示例10: getIcon

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
@Override
public Image getIcon(int type) {
    if (cachedIcon == null) {
        ProjectInformation info = getProjectInformation();
        if (info != null) {
            Icon icon = info.getIcon();
            cachedIcon = ImageUtilities.icon2Image(icon);
        } else {
            cachedIcon = ImageUtilities.loadImage(PROJECT_ICON);
        }
    }
    return cachedIcon;
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:14,代码来源:ProjectNode.java

示例11: createIDEProject

import org.netbeans.api.project.ProjectInformation; //导入方法依赖的package包/类
private static IDEProject createIDEProject(Project p) {
    ProjectInformation pi = ProjectUtils.getInformation(p);
    return new NbProject(pi.getDisplayName(), pi.getIcon(), p.getProjectDirectory().toURL());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ProjectServicesImpl.java


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