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


Java IconDescriptor.setMainIcon方法代码示例

本文整理汇总了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());
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:17,代码来源:HaxeIconDescriptorUpdater.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:PsiFileIconDescriptorUpdater.java

示例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);
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:17,代码来源:XmlIconDescriptorUpdater.java

示例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);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:18,代码来源:TestIconDescriptorUpdater.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:JavaIconDescriptorUpdater.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-apache-thrift,代码行数:41,代码来源:ThriftIconProvider.java

示例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));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:ScratchFileServiceImpl.java

示例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;
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-css,代码行数:29,代码来源:XStyleSheetIconProvider.java

示例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);
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:13,代码来源:DomIconDescriptorUpdater.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:10,代码来源:RelaxNGIconDescriptorUpdater.java

示例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());
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:14,代码来源:JomIconDescriptorUpdater.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-apache-velocity,代码行数:13,代码来源:VtlIconDescriptorUpdater.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:10,代码来源:JavaModuleIconDescriptorUpdater.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:57,代码来源:MsilIconDescriptorUpdater.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:51,代码来源:PsiDirectoryIconDescriptorUpdater.java


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