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


Java IconDescriptor.addLayerIcon方法代码示例

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


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

示例1: updateIcon

import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int flags)
{
	if(element instanceof DotNetTypeDeclaration)
	{
		if(DotNetTestFrameworks.isTestType((DotNetTypeDeclaration) element))
		{
			iconDescriptor.addLayerIcon(AllIcons.RunConfigurations.TestMark);
		}
	}
	else if(element instanceof DotNetLikeMethodDeclaration)
	{
		if(DotNetTestFrameworks.isTestMethod((DotNetLikeMethodDeclaration) element))
		{
			iconDescriptor.addLayerIcon(AllIcons.RunConfigurations.TestMark);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:20,代码来源:DotNetIconDescriptorUpdater.java

示例2: getIcon

import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@Nonnull
@SuppressWarnings("unchecked")
public Icon getIcon(@Nonnull Map<Key, Object> map) {
  if(map.isEmpty()) {
    return getIcon();
  }

  IconDescriptor iconDescriptor = new IconDescriptor(getIcon());
  for (ContentFolderPropertyProvider propertyProvider : ContentFolderPropertyProvider.EP_NAME.getExtensions()) {
    Object value = propertyProvider.getKey().get(map);
    if(value == null) {
      continue;
    }

    Icon layerIcon = propertyProvider.getLayerIcon(value);
    if(layerIcon == null) {
      continue;
    }
    iconDescriptor.addLayerIcon(layerIcon);
  }
  return iconDescriptor.toIcon();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:ContentFolderTypeProvider.java

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

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

import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
private static void processModifierListOwner(PsiElement element, IconDescriptor iconDescriptor, int flags)
{
	DotNetModifierListOwner owner = (DotNetModifierListOwner) element;
	if(BitUtil.isSet(flags, Iconable.ICON_FLAG_VISIBILITY))
	{
		if(owner.hasModifier(MsilTokens.PRIVATE_KEYWORD))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_private);
		}
		else if(owner.hasModifier(MsilTokens.PUBLIC_KEYWORD))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_public);
		}
		else if(owner.hasModifier(MsilTokens.PROTECTED_KEYWORD))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_protected);
		}
		else
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_plocal);
		}
	}

	if(owner.hasModifier(MsilTokens.SEALED_KEYWORD))
	{
		iconDescriptor.addLayerIcon(AllIcons.Nodes.FinalMark);
	}
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:30,代码来源:MsilIconDescriptorUpdater.java

示例6: fun

import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@Override
@RequiredReadAction
public Icon fun(final AnyIconKey<VirtualFile> key) {
  final VirtualFile file = key.getObject();
  final int flags = key.getFlags();
  Project project = key.getProject();

  if (!file.isValid() || project != null && (project.isDisposed() || !wasEverInitialized(project))) return null;

  boolean processedDescriptors = false;
  // disable on webservice native icon
  IconDescriptor iconDescriptor = new IconDescriptor(VirtualFilePresentation.getIcon(file));

  if (project != null) {
    PsiManager manager = PsiManager.getInstance(project);
    final PsiElement element = file.isDirectory() ? manager.findDirectory(file) : manager.findFile(file);
    if (element != null) {
      IconDescriptorUpdaters.processExistingDescriptor(iconDescriptor, element, flags);
      processedDescriptors = true;
    }
  }

  // if descriptors not processed - we need add layer icon obviously
  if (!processedDescriptors && file.is(VFileProperty.SYMLINK)) {
    iconDescriptor.addLayerIcon(AllIcons.Nodes.Symlink);
  }

  if (BitUtil.isSet(flags, Iconable.ICON_FLAG_READ_STATUS)) {
    final boolean isLocked = !file.isWritable() || !WritingAccessProvider.isPotentiallyWritable(file, project);
    if (isLocked) {
      iconDescriptor.addLayerIcon(AllIcons.Nodes.Locked);
    }
  }

  Icon icon = iconDescriptor.toIcon();
  Iconable.LastComputedIcon.put(file, icon, flags);
  return icon;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:39,代码来源:VfsIconUtil.java

示例7: updateIcon

import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@Nonnull IconDescriptor iconDescriptor, @Nonnull PsiElement element, int flags) {
  Project project = element.getProject();
  final PsiFile containingFile = element.getContainingFile();
  VirtualFile vFile = containingFile == null ? null : containingFile.getVirtualFile();

  if (vFile != null && isExcluded(vFile, project)) {
    iconDescriptor.addLayerIcon(AllIcons.Nodes.ExcludedFromCompile);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:CompilerIconDescriptorUpdater.java

示例8: addStaticAndFinalIcons

import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
private static void addStaticAndFinalIcons(IconDescriptor iconDescriptor, JSAttributeList attrList)
{
	if(attrList == null)
	{
		return;
	}
	if(attrList.hasModifier(JSAttributeList.ModifierType.STATIC) || attrList.hasModifier(JSAttributeList.ModifierType.DYNAMIC))   // dynamic?
	{
		iconDescriptor.addLayerIcon(AllIcons.Nodes.StaticMark);
	}
	if(attrList.hasModifier(JSAttributeList.ModifierType.FINAL))
	{
		iconDescriptor.addLayerIcon(AllIcons.Nodes.FinalMark);
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:16,代码来源:JavaScriptIconDescriptorUpdater.java

示例9: processModifierList

import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
public static void processModifierList(PsiElement element, IconDescriptor iconDescriptor, int flags)
{
	PsiModifierListOwner owner = (PsiModifierListOwner) element;

	if(owner.hasModifierProperty(PsiModifier.FINAL))
	{
		iconDescriptor.addLayerIcon(AllIcons.Nodes.FinalMark);
	}

	if(owner.hasModifierProperty(PsiModifier.STATIC))
	{
		iconDescriptor.addLayerIcon(AllIcons.Nodes.StaticMark);
	}

	if((flags & Iconable.ICON_FLAG_VISIBILITY) != 0)
	{
		if(owner.hasModifierProperty(PsiModifier.PUBLIC))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_public);
		}
		else if(owner.hasModifierProperty(PsiModifier.PRIVATE))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_private);
		}
		else if(owner.hasModifierProperty(PsiModifier.PROTECTED))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_protected);
		}
		else if(owner.hasModifierProperty(PsiModifier.PACKAGE_LOCAL))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_plocal);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:35,代码来源:JavaIconDescriptorUpdater.java

示例10: processModifierListOwner

import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@RequiredReadAction
private static void processModifierListOwner(PsiElement element, IconDescriptor iconDescriptor, int flags)
{
	DotNetModifierListOwner owner = (DotNetModifierListOwner) element;
	if(BitUtil.isSet(flags, Iconable.ICON_FLAG_VISIBILITY))
	{
		if(owner.hasModifier(CSharpModifier.PRIVATE))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_private);
		}
		else if(owner.hasModifier(CSharpModifier.PUBLIC))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_public);
		}
		else if(owner.hasModifier(CSharpModifier.PROTECTED))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_protected);
		}
		else
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_plocal);
		}
	}

	if(owner.hasModifier(CSharpModifier.STATIC) && !(owner instanceof CSharpTypeDeclaration))
	{
		iconDescriptor.addLayerIcon(AllIcons.Nodes.StaticMark);
	}

	if(owner.hasModifier(CSharpModifier.SEALED) || owner.hasModifier(CSharpModifier.READONLY) || element instanceof DotNetVariable && ((DotNetVariable) element).isConstant())
	{
		iconDescriptor.addLayerIcon(AllIcons.Nodes.FinalMark);
	}

	// dont check it for msil wrappers
	if(!(element instanceof MsilElementWrapper))
	{
		if(element instanceof DotNetTypeDeclaration && DotNetRunUtil.hasEntryPoint((DotNetTypeDeclaration) element) || element instanceof DotNetMethodDeclaration && DotNetRunUtil.isEntryPoint(
				(DotNetMethodDeclaration) element))

		{
			iconDescriptor.addLayerIcon(AllIcons.Nodes.RunnableMark);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:46,代码来源:CSharpIconDescriptorUpdater.java

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

示例12: updateIcon

import consulo.ide.IconDescriptor; //导入方法依赖的package包/类
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int flags) {
  if (element instanceof PsiFile && XsltSupport.isXsltFile((PsiFile) element)) {
    iconDescriptor.addLayerIcon(XsltIcons.Xslt_filetype_overlay);
  }
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:7,代码来源:XsltIconDescriptorUpdater.java


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