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); }
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); }
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); }
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); }
@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); }
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)); }
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); }
@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); }
@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; }
@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); }
@Override public Icon getIcon(@NotNull DomElement element, int flags) { Icon icon = element.getPresentation().getIcon(); return icon == null ? ElementPresentationManager.getIconOld(element) : icon; }
@Nullable private static String getName(@NotNull ActionOrGroup actionOrGroup) { return ElementPresentationManager.getElementName(actionOrGroup); }
public Icon getIcon(@NotNull DomElement element, int flags) { Icon icon = element.getPresentation().getIcon(); return icon == null ? ElementPresentationManager.getIconOld(element) : icon; }
@Override @Nullable public EjbLocalRef fromString(String value, ConvertContext context) { return ElementPresentationManager.findByName(getVariants(context), value); }
@Override @Nullable public MessageDestinationRef fromString(String value, ConvertContext context) { return ElementPresentationManager.findByName(getVariants(context), value); }
@Override @Nullable public CmpField fromString(String value, ConvertContext context) { EntityBean bean = getEntityBean(context); return (bean != null) ? ElementPresentationManager.findByName(bean.getCmpFields(), value) : null; }
@Override @Nullable public ResourceEnvRef fromString(String value, ConvertContext context) { return ElementPresentationManager.findByName(getVariants(context), value); }
@Override @Nullable public ResourceRef fromString(String value, ConvertContext context) { return ElementPresentationManager.findByName(getVariants(context), value); }
@Override @Nullable public MessageDrivenBean fromString(String value, ConvertContext context) { return ElementPresentationManager.findByName(getVariants(context), value); }
@Override @Nullable public SecurityRole fromString(String value, ConvertContext context) { return ElementPresentationManager.findByName(getVariants(context), value); }
@Override @Nullable public SessionBean fromString(String value, ConvertContext context) { return ElementPresentationManager.findByName(getVariants(context), value); }
@Override @Nullable public EjbRef fromString(String value, ConvertContext context) { return ElementPresentationManager.findByName(getVariants(context), value); }
@Override @Nullable public EntityBean fromString(String value, ConvertContext context) { return ElementPresentationManager.findByName(getVariants(context), value); }
public String toString(final T t, final ConvertContext context) { return t == null ? null : ElementPresentationManager.getElementName(t); }
public CmpField fromString(final String s, final ConvertContext context) { final EntityBean entityBean = getEntityBean(context); return entityBean != null ? ElementPresentationManager.findByName(entityBean.getCmpFields(), s) : null; }
@Nullable public static String getElementName(final CommonModelElement element) { return ElementPresentationManager.getElementName(element); }
public static String getClassName(final CommonModelElement element) { return ElementPresentationManager.getTypeNameForObject(element); }
@NonNls public final String getName() { return StringUtil.notNullize(ElementPresentationManager.getElementName(myElement)); }
public Icon getIcon() { return ElementPresentationManager.getIcon(myElement); }
public String getName() { return ElementPresentationManager.getElementName(myElement); }
@Override protected NullableFunction<T,String> createDefaultNamer() { return ElementPresentationManager.namer(); }