本文整理汇总了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();
}
}
示例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();
}
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}