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


Java IconDescriptorUpdaters.getIcon方法代码示例

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


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

示例1: getPresentation

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Override
public ItemPresentation getPresentation(final T variable) {
  return new ItemPresentation() {
    @Override
    public String getPresentableText() {
      //return PsiFormatUtil.formatVariable(variable, PsiFormatUtilBase.SHOW_TYPE, PsiSubstitutor.EMPTY);
      return variable.getName();
    }

    @Override
    public String getLocationString() {
      return "";
    }

    @Override
    public Icon getIcon(boolean open) {
      return IconDescriptorUpdaters.getIcon(variable, 0);
    }
  };
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:21,代码来源:VariablePresentationProvider.java

示例2: getPresentation

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Override
public ItemPresentation getPresentation(final ThriftDeclaration item) {
  return new ItemPresentation() {
    @Nullable
    @Override
    public String getPresentableText() {
      return item.getName();
    }

    @Nullable
    @Override
    public String getLocationString() {
      return item.getContainingFile().getName();
    }

    @Nullable
    @Override
    public Icon getIcon(boolean unused) {
      return IconDescriptorUpdaters.getIcon(item, Iconable.ICON_FLAG_VISIBILITY);
    }
  };
}
 
开发者ID:consulo,项目名称:consulo-apache-thrift,代码行数:23,代码来源:ThriftTopLevelDeclarationPresentationProvider.java

示例3: getExpressionIcon

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Nullable
private static Icon getExpressionIcon(@NotNull PsiExpression expression)
{
	if(expression instanceof PsiReferenceExpression)
	{
		final PsiElement element = ((PsiReferenceExpression) expression).resolve();
		if(element != null)
		{
			return IconDescriptorUpdaters.getIcon(element, 0);
		}
	}
	if(expression instanceof PsiMethodCallExpression)
	{
		return AllIcons.Nodes.Method;
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:18,代码来源:ExpressionLookupItem.java

示例4: getSingleArrayElementAccess

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Nullable
private static ExpressionLookupItem getSingleArrayElementAccess(PsiElement element, LookupElement item)
{
	if(item.getObject() instanceof PsiLocalVariable)
	{
		final PsiLocalVariable variable = (PsiLocalVariable) item.getObject();
		final PsiType type = variable.getType();
		final PsiExpression expression = variable.getInitializer();
		if(type instanceof PsiArrayType && expression instanceof PsiNewExpression)
		{
			final PsiNewExpression newExpression = (PsiNewExpression) expression;
			final PsiExpression[] dimensions = newExpression.getArrayDimensions();
			if(dimensions.length == 1 && "1".equals(dimensions[0].getText()) && newExpression.getArrayInitializer() == null)
			{
				final String text = variable.getName() + "[0]";
				return new ExpressionLookupItem(createExpression(text, element), IconDescriptorUpdaters.getIcon(variable, Iconable.ICON_FLAG_VISIBILITY), text, text);
			}
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:22,代码来源:ReferenceExpressionCompletionContributor.java

示例5: getIcon

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Nullable
@Override
public Icon getIcon(boolean b)
{
	T element = myPointer.getElement();
	if(element == null)
	{
		return null;
	}
	return IconDescriptorUpdaters.getIcon(element, Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:12,代码来源:CSharpBaseGroupingRule.java

示例6: buildIcon

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
private static Icon buildIcon(final JSNamedElement node)
{
	Icon icon = IconDescriptorUpdaters.getIcon(node, 0);

	if(node instanceof JSFunction)
	{
		final JSFunction function = (JSFunction) node;
		final Icon accessIcon;

		if(function.isGetProperty())
		{
			accessIcon = AllIcons.Nodes.Read_access;
		}
		else if(function.isSetProperty())
		{
			accessIcon = AllIcons.Nodes.Write_access;
		}
		else
		{
			accessIcon = null;
		}

		if(accessIcon != null)
		{
			final LayeredIcon layeredIcon = new LayeredIcon(1);
			layeredIcon.setIcon(accessIcon, 0, 1, 3);
			RowIcon rowIcon = new RowIcon(2);
			rowIcon.setIcon(layeredIcon, 1);
			rowIcon.setIcon(icon, 0);
			icon = rowIcon;
		}
	}
	return icon;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:35,代码来源:JSNamedElementNode.java

示例7: getIcon

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Override
@Nullable
@RequiredDispatchThread
public Icon getIcon(boolean open)
{
	return IconDescriptorUpdaters.getIcon(myElement, Iconable.ICON_FLAG_VISIBILITY);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:8,代码来源:JSItemPresentation.java

示例8: getPresentation

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Override
public ItemPresentation getPresentation()
{
	return new ItemPresentation()
	{
		@Override
		public String getPresentableText()
		{
			return getText();
		}

		@Override
		public String getLocationString()
		{
			return "";
		}

		public TextAttributesKey getTextAttributesKey()
		{
			return null;
		}

		@Override
		public Icon getIcon(boolean open)
		{
			return IconDescriptorUpdaters.getIcon(JSExpressionStatementImpl.this, 0);
		}
	};

}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:31,代码来源:JSExpressionStatementImpl.java

示例9: getIcon

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Override
@RequiredReadAction
public Icon getIcon(boolean open)
{
	final PsiElement psiElement = this.element.getRealElement();
	if(!psiElement.isValid())
	{
		return null;
	}
	return IconDescriptorUpdaters.getIcon(psiElement, 0);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:12,代码来源:JSStructureItemPresentation.java

示例10: getIcon

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Override
public Icon getIcon() {
  if (myDirectory != null) {
    return IconDescriptorUpdaters.getIcon(myDirectory, 0);
  }
  return AllIcons.Nodes.TreeOpen;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:DirectoryNode.java

示例11: getIcon

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
public static Icon getIcon(Object object, @Iconable.IconFlags int flags, Project project) {
  if (object instanceof PsiElement) {
    return IconDescriptorUpdaters.getIcon(((PsiElement)object), flags);
  }
  if (object instanceof Module) {
    return AllIcons.Nodes.Module;
  }
  if (object instanceof VirtualFile) {
    VirtualFile file = (VirtualFile)object;
    return VfsIconUtil.getIcon(file, flags, project);
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:IconUtilEx.java

示例12: update

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@RequiredDispatchThread
@Override
public boolean update() {
  PsiElement element = mySmartPointer.getElement();
  if (element == null) return true;
  int flags = Iconable.ICON_FLAG_VISIBILITY;
  if (isMarkReadOnly()){
    flags |= Iconable.ICON_FLAG_READ_STATUS;
  }
  Icon icon = null;
  try {
    icon = IconDescriptorUpdaters.getIcon(element, flags);
  }
  catch (IndexNotReadyException ignored) {
  }
  Color color = null;

  if (isMarkModified() ){
    VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element);
    if (virtualFile != null) {
      color = FileStatusManager.getInstance(myProject).getStatus(virtualFile).getColor();
    }
  }
  if (CopyPasteManager.getInstance().isCutElement(element)) {
    color = CopyPasteManager.CUT_COLOR;
  }

  boolean changes = !Comparing.equal(icon, getIcon()) || !Comparing.equal(color, myColor);
  setIcon(icon);
  myColor = color;
  return changes;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:33,代码来源:SmartElementDescriptor.java

示例13: getIcon

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Nullable
@Override
public Icon getIcon(boolean b)
{
	return IconDescriptorUpdaters.getIcon(myDeclaration, Iconable.ICON_FLAG_VISIBILITY);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:7,代码来源:CSharpQualifiedElementPresentationProvider.java

示例14: getIcon

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Nullable
@Override
public Icon getIcon(boolean b) {
  return IconDescriptorUpdaters.getIcon(myElement, 0);
}
 
开发者ID:consulo,项目名称:consulo-lua,代码行数:6,代码来源:LuaFileItemPresentation.java

示例15: getIcon

import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
public Icon getIcon() {
    return IconDescriptorUpdaters.getIcon(this, 0);
}
 
开发者ID:consulo,项目名称:consulo-apache-velocity,代码行数:4,代码来源:VtlImplicitVariable.java


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