本文整理汇总了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);
}
};
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例7: getIcon
import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Override
@Nullable
@RequiredDispatchThread
public Icon getIcon(boolean open)
{
return IconDescriptorUpdaters.getIcon(myElement, Iconable.ICON_FLAG_VISIBILITY);
}
示例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);
}
};
}
示例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);
}
示例10: getIcon
import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Override
public Icon getIcon() {
if (myDirectory != null) {
return IconDescriptorUpdaters.getIcon(myDirectory, 0);
}
return AllIcons.Nodes.TreeOpen;
}
示例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;
}
示例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;
}
示例13: getIcon
import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Nullable
@Override
public Icon getIcon(boolean b)
{
return IconDescriptorUpdaters.getIcon(myDeclaration, Iconable.ICON_FLAG_VISIBILITY);
}
示例14: getIcon
import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
@Nullable
@Override
public Icon getIcon(boolean b) {
return IconDescriptorUpdaters.getIcon(myElement, 0);
}
示例15: getIcon
import consulo.ide.IconDescriptorUpdaters; //导入方法依赖的package包/类
public Icon getIcon() {
return IconDescriptorUpdaters.getIcon(this, 0);
}