Java 类com.intellij.psi.impl.ElementPresentationUtil 实例源码

项目:intellij-ce-playground    文件:ClassTreeNode.java   
public static int getClassPosition(final PsiClass aClass) {
  if (aClass == null || !aClass.isValid()) {
    return 0;
  }
  try {
    int pos = aClass instanceof JspClass ? ElementPresentationUtil.CLASS_KIND_JSP : ElementPresentationUtil.getClassKind(aClass);
    //abstract class before concrete
    if (pos == ElementPresentationUtil.CLASS_KIND_CLASS || pos == ElementPresentationUtil.CLASS_KIND_EXCEPTION) {
      boolean isAbstract = aClass.hasModifierProperty(PsiModifier.ABSTRACT) && !aClass.isInterface();
      if (isAbstract) {
        pos --;
      }
    }
    return pos;
  }
  catch (IndexNotReadyException e) {
    return 0;
  }
}
项目:tools-idea    文件:ClassTreeNode.java   
public static int getClassPosition(final PsiClass aClass) {
  if (aClass == null || !aClass.isValid()) {
    return 0;
  }
  try {
    int pos = aClass instanceof JspClass ? ElementPresentationUtil.CLASS_KIND_JSP : ElementPresentationUtil.getClassKind(aClass);
    //abstract class before concrete
    if (pos == ElementPresentationUtil.CLASS_KIND_CLASS || pos == ElementPresentationUtil.CLASS_KIND_EXCEPTION) {
      boolean isAbstract = aClass.hasModifierProperty(PsiModifier.ABSTRACT) && !aClass.isInterface();
      if (isAbstract) {
        pos --;
      }
    }
    return pos;
  }
  catch (IndexNotReadyException e) {
    return 0;
  }
}
项目:intellij-ce-playground    文件:LightMethodBuilder.java   
@Override
public Icon getElementIcon(final int flags) {
  Icon methodIcon = myBaseIcon != null ? myBaseIcon :
                    hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:intellij-ce-playground    文件:BasePsiMemberNode.java   
@Override
protected String calcTooltip() {
  T t = getValue();
  if (t != null && t.isValid()) {
    return ElementPresentationUtil.getDescription(t);
  }
  return super.calcTooltip();
}
项目:intellij-ce-playground    文件:GrLightMethodBuilder.java   
@Override
public Icon getElementIcon(final int flags) {
  Icon methodIcon = myBaseIcon != null ? myBaseIcon :
                    hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:tools-idea    文件:LightMethodBuilder.java   
@Override
public Icon getElementIcon(final int flags) {
  Icon methodIcon = myBaseIcon != null ? myBaseIcon :
                    hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:tools-idea    文件:BasePsiMemberNode.java   
@Override
protected String calcTooltip() {
  T t = getValue();
  if (t != null && t.isValid()) {
    return ElementPresentationUtil.getDescription(t);
  }
  return super.calcTooltip();
}
项目:tools-idea    文件:GrLightMethodBuilder.java   
@Override
public Icon getElementIcon(final int flags) {
  Icon methodIcon = myBaseIcon != null ? myBaseIcon :
                    hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:a-file-icon-idea    文件:PsiElementAssociation.java   
public Icon getIconForFile(final FileInfo file) {
  final PsiElement psiElement = file.getPsiElement();
  final int basicClassKind = ElementPresentationUtil.getBasicClassKind((PsiClass) psiElement);
  return ElementPresentationUtil.getClassIconOfKind((PsiClass) psiElement, basicClassKind);
}
项目:intellij-ce-playground    文件:LightMethod.java   
@Override
public Icon getElementIcon(final int flags) {
  Icon methodIcon = hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:intellij-ce-playground    文件:LightVariableBuilder.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(myBaseIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:intellij-ce-playground    文件:LightVariableBase.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(PlatformIcons.VARIABLE_ICON, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:intellij-ce-playground    文件:ClsMethodImpl.java   
@Override
public Icon getElementIcon(final int flags) {
  Icon methodIcon = hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:intellij-ce-playground    文件:ClsParameterImpl.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = createLayeredIcon(this, PlatformIcons.PARAMETER_ICON, 0);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:intellij-ce-playground    文件:PsiEnumConstantImpl.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(PlatformIcons.FIELD_ICON, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:intellij-ce-playground    文件:PsiParameterImpl.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = createLayeredIcon(this, PlatformIcons.PARAMETER_ICON, 0);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:intellij-ce-playground    文件:PsiMethodImpl.java   
@Override
public Icon getElementIcon(final int flags) {
  Icon methodIcon = hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:intellij-ce-playground    文件:PsiClassInitializerImpl.java   
@Override
public Icon getElementIcon(int flags) {
  return ElementPresentationUtil.createLayeredIcon(PlatformIcons.CLASS_INITIALIZER, this, false);
}
项目:intellij-ce-playground    文件:AndroidLightField.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(PlatformIcons.FIELD_ICON, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:intellij-ce-playground    文件:GrMethodBaseImpl.java   
@Nullable
@Override
protected Icon getElementIcon(@IconFlags int flags) {
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(JetgroovyIcons.Groovy.Method, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:material-theme-jetbrains    文件:PsiElementAssociation.java   
public Icon getIconForFile(final FileInfo file) {
  final PsiElement psiElement = file.getPsiElement();
  final int basicClassKind = ElementPresentationUtil.getBasicClassKind((PsiClass) psiElement);
  return ElementPresentationUtil.getClassIconOfKind((PsiClass) psiElement, basicClassKind);
}
项目:holdr    文件:HoldrLightMethodBuilder.java   
private void setIcon(boolean isAbstract) {
    Icon icon = isAbstract ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
    final RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(icon, this, false);
    setBaseIcon(baseIcon);
}
项目:tools-idea    文件:LightMethod.java   
@Override
public Icon getElementIcon(final int flags) {
  Icon methodIcon = hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:tools-idea    文件:ClsMethodImpl.java   
@Override
public Icon getElementIcon(final int flags) {
  Icon methodIcon = hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:tools-idea    文件:ClsParameterImpl.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = createLayeredIcon(this, PlatformIcons.PARAMETER_ICON, 0);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:tools-idea    文件:PsiEnumConstantImpl.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(PlatformIcons.FIELD_ICON, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:tools-idea    文件:PsiParameterImpl.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = createLayeredIcon(this, PlatformIcons.PARAMETER_ICON, 0);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:tools-idea    文件:PsiMethodImpl.java   
@Override
public Icon getElementIcon(final int flags) {
  Icon methodIcon = hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:tools-idea    文件:PsiClassInitializerImpl.java   
@Override
public Icon getElementIcon(int flags) {
  return ElementPresentationUtil.createLayeredIcon(PlatformIcons.CLASS_INITIALIZER, this, false);
}
项目:tools-idea    文件:LightVariableBuilder.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(myBaseIcon, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:tools-idea    文件:LightVariableBase.java   
@Override
public Icon getElementIcon(final int flags) {
  final RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(PlatformIcons.VARIABLE_ICON, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
项目:tools-idea    文件:GrMethodBaseImpl.java   
@Override
public Icon getIcon(int flags) {
  RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(JetgroovyIcons.Groovy.Method, this, false);
  return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}