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


Java IconDescriptor类代码示例

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


IconDescriptor类属于consulo.ide包,在下文中一共展示了IconDescriptor类的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(@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

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

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

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

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

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

示例8: processElementsWithName

import consulo.ide.IconDescriptor; //导入依赖的package包/类
@Override
public void processElementsWithName(@NotNull String name, @NotNull final Processor<NavigationItem> processor, @NotNull FindSymbolParameters parameters)
{
	StubIndex.getInstance().processElements(UnityScriptIndexKeys.FILE_BY_NAME_INDEX, name, parameters.getProject(), parameters.getSearchScope(), parameters.getIdFilter(), JSFile.class,
			new Processor<JSFile>()
	{
		@Override
		public boolean process(final JSFile file)
		{
			return processor.process(new FakePsiElement()
			{
				@Override
				public String getName()
				{
					return FileUtil.getNameWithoutExtension(file.getName());
				}

				@Nullable
				@Override
				public Icon getIcon(boolean open)
				{
					IconDescriptor descriptor = new IconDescriptor(AllIcons.Nodes.Class);
					descriptor.addLayerIcon(Unity3dIcons.Js);
					descriptor.setRightIcon(AllIcons.Nodes.C_public);
					return descriptor.toIcon();
				}

				@Override
				public PsiElement getParent()
				{
					return file;
				}
			});
		}
	});
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:37,代码来源:UnityScriptGotoClassContributor.java

示例9: updateIcon

import consulo.ide.IconDescriptor; //导入依赖的package包/类
@Override
@RequiredReadAction
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int flags)
{
	if(element instanceof JSFile)
	{
		Unity3dScriptModuleExtension moduleExtension = ModuleUtilCore.getExtension(element, Unity3dScriptModuleExtension.class);
		if(moduleExtension == null)
		{
			return;
		}

		iconDescriptor.setMainIcon(AllIcons.Nodes.Class);
		iconDescriptor.addLayerIcon(Unity3dIcons.Js);
		if(BitUtil.isSet(flags, Iconable.ICON_FLAG_VISIBILITY))
		{
			iconDescriptor.setRightIcon(AllIcons.Nodes.C_public);
		}
	}
	else if(element instanceof CSharpLightTypeDeclarationBuilder)
	{
		if(element.getUserData(UnityScriptToNativeElementTransformer.JS_MARKER) == Boolean.TRUE)
		{
			PsiElement navigationElement = element.getNavigationElement();
			assert navigationElement != null;

			updateIcon(iconDescriptor, navigationElement, flags);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:31,代码来源:UnityScriptIconDescriptorUpdater.java

示例10: updateIcon

import consulo.ide.IconDescriptor; //导入依赖的package包/类
@RequiredReadAction
@Override
public void updateIcon(@NotNull IconDescriptor iconDescriptor, @NotNull PsiElement element, int i)
{
	if(element instanceof IkvmJavaClassAsDotNetTypeElement)
	{
		IconDescriptorUpdaters.processExistingDescriptor(iconDescriptor, ((IkvmJavaClassAsDotNetTypeElement) element).getPsiClass(), i);
	}
}
 
开发者ID:consulo,项目名称:consulo-ikvm,代码行数:10,代码来源:IkvmIconDescriptorUpdater.java

示例11: buildDialog

import consulo.ide.IconDescriptor; //导入依赖的package包/类
@Override
@RequiredDispatchThread
protected void buildDialog(Project project, PsiDirectory psiDirectory, CreateFileFromTemplateDialog.Builder builder)
{
	Set<String> used = new HashSet<>();
	addKind(builder, used, "Class", new IconDescriptor(AllIcons.Nodes.Class).toIcon(), "CSharpClass");
	addKind(builder, used, "Interface", new IconDescriptor(AllIcons.Nodes.Interface).toIcon(), "CSharpInterface");
	addKind(builder, used, "Enum", new IconDescriptor(AllIcons.Nodes.Enum).toIcon(), "CSharpEnum");
	addKind(builder, used, "Struct", new IconDescriptor(AllIcons.Nodes.Struct).toIcon(), "CSharpStruct");
	addKind(builder, used, "Attribute", new IconDescriptor(AllIcons.Nodes.Attribute).toIcon(), "CSharpAttribute");
	if(isCreationOfAssemblyFileAvailable(psiDirectory))
	{
		addKind(builder, used, "Assembly File", AllIcons.FileTypes.Config, "CSharpAssemblyFile");
	}
	addKind(builder, used, "Empty File", CSharpFileType.INSTANCE.getIcon(), "CSharpFile");

	final CSharpCreateFromTemplateHandler handler = CSharpCreateFromTemplateHandler.getInstance();
	for(FileTemplate template : FileTemplateManager.getInstance(project).getAllTemplates())
	{
		if(handler.handlesTemplate(template))
		{
			String name = template.getName().replaceFirst("CSharp", "");
			if(!used.add(name))
			{
				name = template.getName();
			}
			addKind(builder, used, name, CSharpFileType.INSTANCE.getIcon(), template.getName());
		}
	}

	builder.setTitle("Create New File");
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:33,代码来源:CSharpCreateFileAction.java

示例12: getTemplateIcon

import consulo.ide.IconDescriptor; //导入依赖的package包/类
@NotNull
public static Icon getTemplateIcon(String name) {
  name = getTemplateShortName(name);
  if ("Class".equals(name)) {
    return new IconDescriptor(AllIcons.Nodes.Class).addLayerIcon(HaxeIcons.HaxeLang).toIcon();
  }
  else if ("Interface".equals(name)) {
    return new IconDescriptor(AllIcons.Nodes.Interface).addLayerIcon(HaxeIcons.HaxeLang).toIcon();
  }
  else if ("Enum".equals(name)) {
    return new IconDescriptor(AllIcons.Nodes.Enum).addLayerIcon(HaxeIcons.HaxeLang).toIcon();
  }
  return icons.HaxeIcons.Haxe;
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:15,代码来源:HaxeFileTemplateUtil.java

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

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

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


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