本文整理汇总了Java中consulo.ide.IconDescriptor.setMainIcon方法的典型用法代码示例。如果您正苦于以下问题:Java IconDescriptor.setMainIcon方法的具体用法?Java IconDescriptor.setMainIcon怎么用?Java IconDescriptor.setMainIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类consulo.ide.IconDescriptor
的用法示例。
在下文中一共展示了IconDescriptor.setMainIcon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int flags)
{
if(element instanceof HaxeFile)
{
iconDescriptor.setMainIcon(getHaxeFileIcon((HaxeFile) element, flags));
}
else
{
HaxeComponentType haxeComponentType = HaxeComponentType.typeOf(element);
if(haxeComponentType != null)
{
iconDescriptor.setMainIcon(haxeComponentType.getIcon());
}
}
}
示例2: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@Nonnull IconDescriptor iconDescriptor, @Nonnull PsiElement element, int flags) {
if (element instanceof PsiFile) {
if (iconDescriptor.getMainIcon() == null) {
FileType fileType = ((PsiFile)element).getFileType();
iconDescriptor.setMainIcon(fileType.getIcon());
}
VirtualFile virtualFile = ((PsiFile)element).getVirtualFile();
if (virtualFile != null && virtualFile.is(VFileProperty.SYMLINK)) {
iconDescriptor.addLayerIcon(AllIcons.Nodes.Symlink);
}
}
else {
Icon languageElementIcon = LanguageElementIcons.INSTANCE.forLanguage(element.getLanguage());
if (languageElementIcon == null) {
return;
}
iconDescriptor.addLayerIcon(languageElementIcon);
}
}
示例3: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int flags) {
if (element instanceof XmlFile) {
final VirtualFile vf = ((XmlFile)element).getVirtualFile();
if (vf != null) {
final String extension = vf.getExtension();
if (XSD_FILE_EXTENSION.equals(extension)) {
iconDescriptor.setMainIcon(AllIcons.FileTypes.XsdFile);
}
if (WSDL_FILE_EXTENSION.equals(extension)) {
iconDescriptor.setMainIcon(AllIcons.FileTypes.WsdlFile);
}
}
}
}
示例4: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int flags)
{
for(TestFramework framework : TestFramework.EXTENSION_NAME.getExtensions())
{
if(framework.isIgnoredMethod(element))
{
iconDescriptor.setMainIcon(AllIcons.RunConfigurations.IgnoredTest);
}
if(framework.isTestMethod(element) || framework.isTestClass(element))
{
iconDescriptor.addLayerIcon(AllIcons.RunConfigurations.TestMark);
}
}
}
示例5: processedFile
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
private static boolean processedFile(PsiElement element, IconDescriptor iconDescriptor)
{
final PsiFile containingFile = element.getContainingFile();
if(containingFile == null)
{
return false;
}
final FileType fileType = containingFile.getFileType();
if(fileType != JavaFileType.INSTANCE && fileType != JavaClassFileType.INSTANCE)
{
return false;
}
final VirtualFile virtualFile = containingFile.getVirtualFile();
if(virtualFile == null)
{
return false;
}
if(!JavaProjectRootsUtil.isJavaSourceFile(element.getProject(), virtualFile, true))
{
iconDescriptor.setMainIcon(JavaIcons.FileTypes.JavaOutsideSource);
return true;
}
return false;
}
示例6: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int i)
{
if(element instanceof ThriftConst)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.Value);
}
if(element instanceof ThriftEnum)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.Enum);
}
if(element instanceof ThriftException)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.ExceptionClass);
}
if(element instanceof ThriftService)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.Static);
}
if(element instanceof ThriftStruct)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.Struct);
}
if(element instanceof ThriftTypedef)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.TypeAlias);
}
if(element instanceof ThriftUnion)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.AnonymousClass);
}
if(element instanceof ThriftField)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.Field);
}
if(element instanceof ThriftFunction)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.Function);
}
}
示例7: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@Nonnull IconDescriptor iconDescriptor, @Nonnull PsiElement element, int flags) {
if (element instanceof PsiFile) {
VirtualFile virtualFile = ((PsiFile)element).getVirtualFile();
if (virtualFile == null) {
return;
}
RootType rootType = ScratchFileService.getInstance().getRootType(virtualFile);
if (rootType == null) return;
iconDescriptor.setMainIcon(rootType.substituteIcon(element.getProject(), virtualFile));
}
}
示例8: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int i)
{
if(element instanceof XStyleSheetSelector)
{
XStyleSheetSimpleSelector[] simpleSelectors = ((XStyleSheetSelector) element).getSimpleSelectors();
if(simpleSelectors.length == 0)
{
return;
}
XStyleSheetSimpleSelector selector = simpleSelectors[0];
switch(selector.getType())
{
case ID:
iconDescriptor.setMainIcon(XStyleSheetIcons.HtmlId);
break;
case CLASS:
iconDescriptor.setMainIcon(XStyleSheetIcons.CssClass);
break;
case TAG:
iconDescriptor.setMainIcon(AllIcons.Nodes.Tag);
break;
}
}
}
示例9: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int flags) {
if (element instanceof XmlFile) {
DomFileDescription<?> description = DomManager.getDomManager(element.getProject()).getDomFileDescription((XmlFile)element);
if(description != null) {
final Icon fileIcon = description.getFileIcon(flags);
if(fileIcon != null) {
iconDescriptor.setMainIcon(fileIcon);
}
}
}
}
示例10: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement psiElement, int i)
{
if(psiElement instanceof RncDefine)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.Property);
}
}
示例11: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int flags)
{
if(element instanceof PsiFile)
{
JomFileElement<JomElement> fileElement = JomManager.getInstance(element.getProject()).getFileElement((PsiFile) element);
if(fileElement != null)
{
iconDescriptor.setMainIcon(fileElement.getFileDescriptor().getIcon());
}
}
}
示例12: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int i)
{
if(element instanceof VtlParameterDeclaration)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.Parameter);
}
if(element instanceof VtlVariable)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.Variable);
}
}
示例13: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement psiElement, int i)
{
if(psiElement instanceof PsiDirectory && isModuleDirectory((PsiDirectory) psiElement))
{
iconDescriptor.setMainIcon(JavaIcons.Nodes.JavaModuleRoot);
}
}
示例14: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@Override
@RequiredReadAction
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int flags)
{
if(element instanceof MsilNamespaceAsElementImpl)
{
iconDescriptor.setMainIcon(AllIcons.Nodes.Package);
return;
}
if(element instanceof MsilClassEntry)
{
Icon main = null;
MsilClassEntry typeDeclaration = (MsilClassEntry) element;
if(!DumbService.getInstance(element.getProject()).isDumb())
{
if(DotNetInheritUtil.isAttribute(typeDeclaration))
{
main = typeDeclaration.hasModifier(MsilTokens.ABSTRACT_KEYWORD) ? AllIcons.Nodes.AbstractAttribute : AllIcons.Nodes.Attribute;
}
else if(DotNetInheritUtil.isException(typeDeclaration))
{
main = typeDeclaration.hasModifier(MsilTokens.ABSTRACT_KEYWORD) ? AllIcons.Nodes.AbstractException : AllIcons.Nodes.ExceptionClass;
}
else if(DotNetInheritUtil.isInheritor(typeDeclaration, DotNetTypes.System.MulticastDelegate, false))
{
main = AllIcons.Nodes.Method;
}
else if(typeDeclaration.isEnum())
{
main = AllIcons.Nodes.Enum;
}
else if(typeDeclaration.isStruct())
{
main = AllIcons.Nodes.Struct;
}
}
if(main == null)
{
if(typeDeclaration.isInterface())
{
main = AllIcons.Nodes.Interface;
}
else
{
main = typeDeclaration.hasModifier(MsilTokens.ABSTRACT_KEYWORD) ? AllIcons.Nodes.AbstractClass : AllIcons.Nodes.Class;
}
}
iconDescriptor.setMainIcon(main);
processModifierListOwner(element, iconDescriptor, flags);
}
}
示例15: updateIcon
import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@Nonnull IconDescriptor iconDescriptor, @Nonnull PsiElement element, int flags) {
if (element instanceof PsiDirectory) {
PsiDirectory psiDirectory = (PsiDirectory)element;
VirtualFile virtualFile = psiDirectory.getVirtualFile();
Project project = psiDirectory.getProject();
Icon symbolIcon = null;
if (virtualFile.getFileSystem() instanceof ArchiveFileSystem) {
if (virtualFile.getParent() == null) {
symbolIcon = AllIcons.Nodes.PpJar;
}
else {
PsiPackage psiPackage = PsiPackageManager.getInstance(project).findAnyPackage(psiDirectory);
symbolIcon = psiPackage != null ? AllIcons.Nodes.Package : AllIcons.Nodes.TreeClosed;
}
}
else if (ProjectRootsUtil.isModuleContentRoot(virtualFile, project)) {
symbolIcon = AllIcons.Nodes.Module;
}
else {
boolean ignored = ProjectRootManager.getInstance(project).getFileIndex().isExcluded(virtualFile);
if (ignored) {
symbolIcon = AllIcons.Modules.ExcludeRoot;
}
else {
ContentFolder contentFolder = ProjectRootsUtil.getContentFolderIfIs(virtualFile, project);
if (contentFolder != null) {
symbolIcon = contentFolder.getType().getIcon(contentFolder.getProperties());
}
else {
ContentFolderTypeProvider contentFolderTypeForFile = ProjectFileIndex.getInstance(project).getContentFolderTypeForFile(virtualFile);
symbolIcon = contentFolderTypeForFile != null ? contentFolderTypeForFile.getChildDirectoryIcon(psiDirectory) : AllIcons.Nodes.TreeClosed;
}
}
}
if (symbolIcon != null) {
iconDescriptor.setMainIcon(symbolIcon);
}
if (virtualFile.is(VFileProperty.SYMLINK)) {
iconDescriptor.addLayerIcon(AllIcons.Nodes.Symlink);
}
}
else if (element instanceof PsiPackage) {
iconDescriptor.setMainIcon(AllIcons.Nodes.Package);
}
}