Java 类com.intellij.util.xml.ElementPresentationManager 实例源码

项目:intellij-ce-playground    文件:DomElementsToggleAction.java   
public DomElementsToggleAction(final DomModelTreeView treeView, final Class aClass) {
  myTreeView = treeView;
  myClass = aClass;

  Icon myIcon = ElementPresentationManager.getIcon(myClass);
  if (myIcon == null) {
    myIcon = AllIcons.Nodes.Pointcut;
  }
  this.myIcon = myIcon;

  myText = TypePresentationService.getService().getTypePresentableName(myClass);

  if(getHiders() == null) DomUtil.getFile(myTreeView.getRootElement()).putUserData(AbstractDomElementNode.TREE_NODES_HIDERS_KEY, new HashMap<Class, Boolean>());

  if(getHiders().get(myClass) == null) getHiders().put(myClass, true);
}
项目:tools-idea    文件:DomElementsToggleAction.java   
public DomElementsToggleAction(final DomModelTreeView treeView, final Class aClass) {
  myTreeView = treeView;
  myClass = aClass;

  Icon myIcon = ElementPresentationManager.getIcon(myClass);
  if (myIcon == null) {
    myIcon = AllIcons.Nodes.Pointcut;
  }
  this.myIcon = myIcon;

  myText = TypePresentationService.getService().getTypePresentableName(myClass);

  if(getHiders() == null) DomUtil.getFile(myTreeView.getRootElement()).putUserData(BaseDomElementNode.TREE_NODES_HIDERS_KEY, new HashMap<Class, Boolean>());

  if(getHiders().get(myClass) == null) getHiders().put(myClass, true);
}
项目:consulo-xml    文件:DomElementsToggleAction.java   
public DomElementsToggleAction(final DomModelTreeView treeView, final Class aClass) {
  myTreeView = treeView;
  myClass = aClass;

  Icon myIcon = ElementPresentationManager.getIcon(myClass);
  if (myIcon == null) {
    myIcon = AllIcons.Nodes.Pointcut;
  }
  this.myIcon = myIcon;

  myText = TypePresentationService.getInstance().getTypePresentableName(myClass);

  if(getHiders() == null) DomUtil.getFile(myTreeView.getRootElement()).putUserData(BaseDomElementNode.TREE_NODES_HIDERS_KEY, new HashMap<Class, Boolean>());

  if(getHiders().get(myClass) == null) getHiders().put(myClass, true);
}
项目:intellij-ce-playground    文件:IconUtilEx.java   
public static Icon getIcon(Object object, @Iconable.IconFlags int flags, Project project) {
  if (object instanceof PsiElement) {
    return ((PsiElement)object).getIcon(flags);
  }
  if (object instanceof Module) {
    return ModuleType.get((Module)object).getIcon();
  }
  if (object instanceof VirtualFile) {
    VirtualFile file = (VirtualFile)object;
    return IconUtil.getIcon(file, flags, project);
  }
  return ElementPresentationManager.getIcon(object);
}
项目:intellij-ce-playground    文件:DomElementsGroupNode.java   
@Override
  public Icon getNodeIcon() {
    Class clazz = ReflectionUtil.getRawType(myChildDescription.getType());
//        Class arrayClass = Array.newInstance(clazz, 0).getClass();
    ElementPresentationTemplate template = myChildDescription.getPresentationTemplate();
    if (template != null) {
      return template.createPresentation(null).getIcon();
    }
    return ElementPresentationManager.getIconForClass(clazz);
  }
项目:intellij-ce-playground    文件:MavenGenerateTemplateAction.java   
public MavenGenerateTemplateAction(@NotNull final String description,
                                   @NotNull final Class<? extends DomElement> childElementClass,
                                   @Nullable final String mappingId,
                                   @NotNull Function<MavenDomProjectModel, DomElement> parentFunction) {
  super(new MavenGenerateDomElementProvider(description, childElementClass, mappingId, parentFunction));

  getTemplatePresentation().setIcon(ElementPresentationManager.getIconForClass(childElementClass));
}
项目:tools-idea    文件:IconUtilEx.java   
public static Icon getIcon(Object object, @Iconable.IconFlags int flags, Project project) {
  if (object instanceof PsiElement) {
    return ((PsiElement)object).getIcon(flags);
  }
  if (object instanceof Module) {
    return ModuleType.get((Module)object).getIcon();
  }
  if (object instanceof VirtualFile) {
    VirtualFile file = (VirtualFile)object;
    return IconUtil.getIcon(file, flags, project);
  }
  return ElementPresentationManager.getIcon(object);
}
项目:tools-idea    文件:DomElementsGroupNode.java   
public Icon getNodeIcon() {
    Class clazz = ReflectionUtil.getRawType(myChildDescription.getType());
//        Class arrayClass = Array.newInstance(clazz, 0).getClass();
    ElementPresentationTemplate template = myChildDescription.getPresentationTemplate();
    if (template != null) {
      return template.createPresentation(null).getIcon();
    }
    return ElementPresentationManager.getIconForClass(clazz);
  }
项目:tools-idea    文件:MavenGenerateTemplateAction.java   
public MavenGenerateTemplateAction(@NotNull final String description,
                                   @NotNull final Class<? extends DomElement> childElementClass,
                                   @Nullable final String mappingId,
                                   @NotNull Function<MavenDomProjectModel, DomElement> parentFunction) {
  super(new MavenGenerateDomElementProvider(description, childElementClass, mappingId, parentFunction));

  getTemplatePresentation().setIcon(ElementPresentationManager.getIconForClass(childElementClass));
}
项目:ibatis-plugin    文件:GoToSymbolProvider.java   
@Nullable
protected static NavigationItem createNavigationItem(final DomElement domElement) {
    XmlTag xmlTag = domElement.getXmlTag();
    if (xmlTag == null) return null;
    final String value = xmlTag.getAttributeValue("id");
    if (value == null) return null;
    final Icon icon = ElementPresentationManager.getIcon(domElement);
    return createNavigationItem(xmlTag.getAttribute("id"), value, icon);
}
项目:consulo-javaee    文件:EjbCommonModelUtil.java   
@NotNull
public static EnterpriseBean getMergedEnterpriseBean(@NotNull final EjbBase base)
{
    final Module module = base.getModule();
    if(module != null)
    {
        final EnterpriseBean bean = ElementPresentationManager.findByName(getAllEjbs(module.getProject(), module, null), base.getEjbName().getValue());
        if(bean != null)
        {
            return bean;
        }
    }
    return base;
}
项目:consulo-javaee    文件:JamSimpleReferenceConverter.java   
@NotNull
protected LookupElement createLookupElementFor(@NotNull T target) {
  String name = ElementPresentationManager.getElementName(target);
  if (name != null) {
    return LookupElementBuilder.create(name);
  }
  final PsiElement psiElement = getPsiElementFor(target);
  if (psiElement instanceof PsiNamedElement) {
    return LookupElementBuilder.create((PsiNamedElement)psiElement).withIcon(ElementPresentationManager.getIcon(target));
  }
  throw new UnsupportedOperationException("Cannot convert "+target+", PSI:" + psiElement);
}
项目:consulo-xml    文件:DomElementsGroupNode.java   
public Icon getNodeIcon() {
    Class clazz = ReflectionUtil.getRawType(myChildDescription.getType());
//        Class arrayClass = Array.newInstance(clazz, 0).getClass();
    ElementPresentationTemplate template = myChildDescription.getPresentationTemplate();
    if (template != null) {
      return template.createPresentation(null).getIcon();
    }
    return ElementPresentationManager.getIconForClass(clazz);
  }
项目:intellij-ce-playground    文件:DefaultDomTargetIconProvider.java   
@Override
public Icon getIcon(@NotNull DomElement element, int flags) {
  Icon icon = element.getPresentation().getIcon();
  return icon == null ? ElementPresentationManager.getIconOld(element) : icon;
}
项目:intellij-ce-playground    文件:ActionOrGroupResolveConverter.java   
@Nullable
private static String getName(@NotNull ActionOrGroup actionOrGroup) {
  return ElementPresentationManager.getElementName(actionOrGroup);
}
项目:tools-idea    文件:DefaultDomTargetIconProvider.java   
public Icon getIcon(@NotNull DomElement element, int flags) {
  Icon icon = element.getPresentation().getIcon();
  return icon == null ? ElementPresentationManager.getIconOld(element) : icon;
}
项目:consulo-javaee    文件:EjbLocalRefConverter.java   
@Override
@Nullable
public EjbLocalRef fromString(String value, ConvertContext context) {
    return ElementPresentationManager.findByName(getVariants(context), value);
}
项目:consulo-javaee    文件:MessageDestinationRefConverter.java   
@Override
@Nullable
public MessageDestinationRef fromString(String value, ConvertContext context) {
    return ElementPresentationManager.findByName(getVariants(context), value);
}
项目:consulo-javaee    文件:CmpFieldConverter.java   
@Override
@Nullable
public CmpField fromString(String value, ConvertContext context) {
    EntityBean bean = getEntityBean(context);
    return (bean != null) ? ElementPresentationManager.findByName(bean.getCmpFields(), value) : null;
}
项目:consulo-javaee    文件:ResourceEnvRefConverter.java   
@Override
@Nullable
public ResourceEnvRef fromString(String value, ConvertContext context) {
    return ElementPresentationManager.findByName(getVariants(context), value);
}
项目:consulo-javaee    文件:ResourceRefConverter.java   
@Override
@Nullable
public ResourceRef fromString(String value, ConvertContext context) {
    return ElementPresentationManager.findByName(getVariants(context), value);
}
项目:consulo-javaee    文件:MessageBeanConverter.java   
@Override
@Nullable
public MessageDrivenBean fromString(String value, ConvertContext context) {
    return ElementPresentationManager.findByName(getVariants(context), value);
}
项目:consulo-javaee    文件:SecurityRoleConverter.java   
@Override
@Nullable
public SecurityRole fromString(String value, ConvertContext context)
{
    return ElementPresentationManager.findByName(getVariants(context), value);
}
项目:consulo-javaee    文件:SessionBeanConverter.java   
@Override
@Nullable
public SessionBean fromString(String value, ConvertContext context) {
    return ElementPresentationManager.findByName(getVariants(context), value);
}
项目:consulo-javaee    文件:EjbRefConverter.java   
@Override
@Nullable
public EjbRef fromString(String value, ConvertContext context) {
    return ElementPresentationManager.findByName(getVariants(context), value);
}
项目:consulo-javaee    文件:EntityBeanConverter.java   
@Override
@Nullable
public EntityBean fromString(String value, ConvertContext context) {
    return ElementPresentationManager.findByName(getVariants(context), value);
}
项目:consulo-javaee    文件:JavaeeResolvingConverter.java   
public String toString(final T t, final ConvertContext context) {
  return t == null ? null : ElementPresentationManager.getElementName(t);
}
项目:consulo-javaee    文件:CmpFieldResolvingConverter.java   
public CmpField fromString(final String s, final ConvertContext context) {
  final EntityBean entityBean = getEntityBean(context);
  return entityBean != null ? ElementPresentationManager.findByName(entityBean.getCmpFields(), s) : null;
}
项目:consulo-javaee    文件:JamCommonUtil.java   
@Nullable
public static String getElementName(final CommonModelElement element)
{
    return ElementPresentationManager.getElementName(element);
}
项目:consulo-javaee    文件:JamCommonUtil.java   
public static String getClassName(final CommonModelElement element)
{
    return ElementPresentationManager.getTypeNameForObject(element);
}
项目:consulo-javaee    文件:JamSupportMetaData.java   
@NonNls
public final String getName() {
  return StringUtil.notNullize(ElementPresentationManager.getElementName(myElement));
}
项目:consulo-javaee    文件:JamSupportMetaData.java   
public Icon getIcon() {
  return ElementPresentationManager.getIcon(myElement);
}
项目:consulo-javaee    文件:DefaultCommonModelTarget.java   
public String getName() {
  return ElementPresentationManager.getElementName(myElement);
}
项目:consulo-xml    文件:DomNavigationGutterIconBuilder.java   
@Override
protected NullableFunction<T,String> createDefaultNamer() {
  return ElementPresentationManager.namer();
}