本文整理汇总了Java中com.intellij.ide.TypePresentationService类的典型用法代码示例。如果您正苦于以下问题:Java TypePresentationService类的具体用法?Java TypePresentationService怎么用?Java TypePresentationService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypePresentationService类属于com.intellij.ide包,在下文中一共展示了TypePresentationService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: DomElementsToggleAction
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
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);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:DomElementsToggleAction.java
示例2: DomElementsToggleAction
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
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);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:DomElementsToggleAction.java
示例3: DomElementsToggleAction
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
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);
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:17,代码来源:DomElementsToggleAction.java
示例4: formatType
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
private static String formatType(@NotNull PsiVariable variable) {
FindUsagesProvider provider = LanguageFindUsages.INSTANCE.forLanguage(variable.getLanguage());
final String type = provider.getType(variable);
if (StringUtil.isNotEmpty(type)) {
return type;
}
return TypePresentationService.getService().getTypePresentableName(variable.getClass());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:VariableArrayTypeFix.java
示例5: getIconImpl
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
public static Icon getIconImpl(@NotNull VirtualFile vFile) {
Icon icon = TypePresentationService.getService().getIcon(vFile);
if (icon != null) {
return icon;
}
if (vFile.isDirectory() && vFile.isInLocalFileSystem()) {
return PlatformIcons.FOLDER_ICON;
}
return vFile.getFileType().getIcon();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:VirtualFilePresentation.java
示例6: getElementDescription
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
@Override
public String getElementDescription(@NotNull final PsiElement psiElement, @NotNull final ElementDescriptionLocation location) {
if (!(location instanceof UsageViewTypeLocation)) return null;
if (psiElement instanceof PsiMetaOwner) {
final PsiMetaData metaData = ((PsiMetaOwner)psiElement).getMetaData();
if (metaData instanceof PsiPresentableMetaData) {
return ((PsiPresentableMetaData)metaData).getTypeName();
}
}
if (psiElement instanceof PsiFile) {
return LangBundle.message("terms.file");
}
if (psiElement instanceof PsiDirectory) {
return LangBundle.message("terms.directory");
}
final Language lang = psiElement.getLanguage();
FindUsagesProvider provider = LanguageFindUsages.INSTANCE.forLanguage(lang);
final String type = provider.getType(psiElement);
if (StringUtil.isNotEmpty(type)) {
return type;
}
return TypePresentationService.getService().getTypePresentableName(psiElement.getClass());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:UsageViewTypeLocation.java
示例7: getActionText
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
@Override
protected String getActionText(final AnActionEvent e) {
String text = ApplicationBundle.message("action.add");
if (e.getPresentation().isEnabled()) {
final DomElementsGroupNode selectedNode = getDomElementsGroupNode(getTreeView(e));
if (selectedNode != null) {
final Type type = selectedNode.getChildDescription().getType();
text += " " + TypePresentationService.getService().getTypePresentableName(ReflectionUtil.getRawType(type));
}
}
return text;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AddElementInCollectionAction.java
示例8: ResolvingElementQuickFix
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
public ResolvingElementQuickFix(final Class<? extends DomElement> clazz, final String newName, final List<DomElement> parents,
final DomCollectionChildDescription childDescription) {
myClazz = clazz;
myNewName = newName;
myParents = parents;
myChildDescription = childDescription;
myTypeName = TypePresentationService.getService().getTypePresentableName(myClazz);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ResolvingElementQuickFix.java
示例9: getTypeNameForObject
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
public static String getTypeNameForObject(Object o) {
final Object firstImpl = ModelMergerUtil.getFirstImplementation(o);
o = firstImpl != null ? firstImpl : o;
String typeName = TypePresentationService.getService().getTypeName(o);
if (typeName != null) return typeName;
if (o instanceof DomElement) {
final DomElement element = (DomElement)o;
return StringUtil.capitalizeWords(element.getNameStrategy().splitIntoWords(element.getXmlElementName()), true);
}
return TypePresentationService.getDefaultTypeName(o.getClass());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ElementPresentationManager.java
示例10: getIconsForClass
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
@Nullable
private static Icon[] getIconsForClass(final Class clazz, @Nullable Object o) {
TypePresentationService service = TypePresentationService.getService();
final Icon icon = o == null ? service.getTypeIcon(clazz) : service.getIcon(o);
if (icon != null) {
return new Icon[]{icon};
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ElementPresentationManager.java
示例11: getIcon
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
public static Icon getIcon(VirtualFile vFile) {
Icon icon = TypePresentationService.getService().getIcon(vFile);
if (icon != null) {
return icon;
}
if (vFile.isDirectory() && vFile.isInLocalFileSystem()) {
return PlatformIcons.FOLDER_ICON;
}
return vFile.getFileType().getIcon();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:VirtualFilePresentation.java
示例12: getActionText
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
protected String getActionText(final AnActionEvent e) {
String text = ApplicationBundle.message("action.add");
if (e.getPresentation().isEnabled()) {
final DomElementsGroupNode selectedNode = getDomElementsGroupNode(getTreeView(e));
if (selectedNode != null) {
final Type type = selectedNode.getChildDescription().getType();
text += " " + TypePresentationService.getService().getTypePresentableName(ReflectionUtil.getRawType(type));
}
}
return text;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:AddElementInCollectionAction.java
示例13: getIcon
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
public static Icon getIcon(VirtualFile vFile) {
Icon icon = TypePresentationService.getInstance().getIcon(vFile);
if (icon != null) {
return icon;
}
if (vFile.isDirectory() && vFile.isInLocalFileSystem()) {
return AllIcons.Nodes.Folder;
}
return vFile.getFileType().getIcon();
}
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:VirtualFilePresentation.java
示例14: getElementDescription
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
@Override
public String getElementDescription(@Nonnull final PsiElement psiElement, @Nonnull final ElementDescriptionLocation location) {
if (!(location instanceof UsageViewTypeLocation)) return null;
if (psiElement instanceof PsiMetaOwner) {
final PsiMetaData metaData = ((PsiMetaOwner)psiElement).getMetaData();
if (metaData instanceof PsiPresentableMetaData) {
return ((PsiPresentableMetaData)metaData).getTypeName();
}
}
if (psiElement instanceof PsiFile) {
return LangBundle.message("terms.file");
}
if (psiElement instanceof PsiDirectory) {
return LangBundle.message("terms.directory");
}
final Language lang = psiElement.getLanguage();
FindUsagesProvider provider = LanguageFindUsages.INSTANCE.forLanguage(lang);
final String type = provider.getType(psiElement);
if (StringUtil.isNotEmpty(type)) {
return type;
}
return TypePresentationService.getInstance().getTypePresentableName(psiElement.getClass());
}
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:UsageViewTypeLocation.java
示例15: getIcon
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
@Override
public Icon getIcon() {
Icon icon = TypePresentationService.getInstance().getIcon(myTarget);
if (icon != null) return icon;
if (myTarget instanceof PsiTarget) {
return IconDescriptorUpdaters.getIcon(((PsiTarget)myTarget).getNavigationElement(), 0);
}
return null;
}
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:PomTargetPsiElementImpl.java
示例16: getActionText
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
protected String getActionText(final AnActionEvent e) {
String text = ApplicationBundle.message("action.add");
if (e.getPresentation().isEnabled()) {
final DomElementsGroupNode selectedNode = getDomElementsGroupNode(getTreeView(e));
if (selectedNode != null) {
final Type type = selectedNode.getChildDescription().getType();
text += " " + TypePresentationService.getInstance().getTypePresentableName(ReflectionUtil.getRawType(type));
}
}
return text;
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:13,代码来源:AddElementInCollectionAction.java
示例17: ResolvingElementQuickFix
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
public ResolvingElementQuickFix(final Class<? extends DomElement> clazz, final String newName, final List<DomElement> parents,
final DomCollectionChildDescription childDescription) {
myClazz = clazz;
myNewName = newName;
myParents = parents;
myChildDescription = childDescription;
myTypeName = TypePresentationService.getInstance().getTypePresentableName(myClazz);
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:10,代码来源:ResolvingElementQuickFix.java
示例18: getTypeNameForObject
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
public static String getTypeNameForObject(Object o) {
final Object firstImpl = ModelMergerUtil.getFirstImplementation(o);
o = firstImpl != null ? firstImpl : o;
String typeName = TypePresentationService.getInstance().getTypeName(o);
if (typeName != null) return typeName;
if (o instanceof DomElement) {
final DomElement element = (DomElement)o;
return StringUtil.capitalizeWords(element.getNameStrategy().splitIntoWords(element.getXmlElementName()), true);
}
return TypePresentationService.getDefaultTypeName(o.getClass());
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:12,代码来源:ElementPresentationManager.java
示例19: getIconsForClass
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
@Nullable
private static Icon[] getIconsForClass(final Class clazz, @Nullable Object o) {
TypePresentationService service = TypePresentationService.getInstance();
final Icon icon = o == null ? service.getTypeIcon(clazz) : service.getIcon(o);
if (icon != null) {
return new Icon[]{icon};
}
return null;
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:11,代码来源:ElementPresentationManager.java
示例20: formatType
import com.intellij.ide.TypePresentationService; //导入依赖的package包/类
private static String formatType(@NotNull PsiVariable variable)
{
FindUsagesProvider provider = LanguageFindUsages.INSTANCE.forLanguage(variable.getLanguage());
final String type = provider.getType(variable);
if(StringUtil.isNotEmpty(type))
{
return type;
}
return TypePresentationService.getInstance().getTypePresentableName(variable.getClass());
}
开发者ID:consulo,项目名称:consulo-java,代码行数:12,代码来源:VariableArrayTypeFix.java
注:本文中的com.intellij.ide.TypePresentationService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论