本文整理汇总了Java中com.intellij.navigation.ColoredItemPresentation类的典型用法代码示例。如果您正苦于以下问题:Java ColoredItemPresentation类的具体用法?Java ColoredItemPresentation怎么用?Java ColoredItemPresentation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColoredItemPresentation类属于com.intellij.navigation包,在下文中一共展示了ColoredItemPresentation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@Override
public ItemPresentation getPresentation(@NotNull final PsiPackage aPackage) {
return new ColoredItemPresentation() {
@Override
public TextAttributesKey getTextAttributesKey() {
return null;
}
@Override
public String getPresentableText() {
return aPackage.getName();
}
@Override
public String getLocationString() {
return aPackage.getQualifiedName();
}
@Override
public Icon getIcon(boolean open) {
return PlatformIcons.PACKAGE_ICON;
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:PackagePresentationProvider.java
示例2: getPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@NotNull
public ItemPresentation getPresentation() {
return new ColoredItemPresentation() {
@Nullable
@Override
public TextAttributesKey getTextAttributesKey() {
return (myPresentableName != null && myPresentableName.isEmpty()) ? GROUP_KEY :null;
}
public String getPresentableText() {
return myPresentableName == null
? myProperty.getUnescapedKey()
: (myPresentableName.isEmpty() ? ResourceBundlePropertyStructureViewElement.PROPERTY_GROUP_KEY_TEXT : myPresentableName);
}
public String getLocationString() {
return null;
}
public Icon getIcon(boolean open) {
return myProperty.getIcon(0);
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:PropertiesStructureViewElement.java
示例3: getPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@Override
public ItemPresentation getPresentation(final PsiPackage aPackage) {
return new ColoredItemPresentation() {
@Override
public TextAttributesKey getTextAttributesKey() {
return null;
}
@Override
public String getPresentableText() {
return aPackage.getName();
}
@Override
public String getLocationString() {
return aPackage.getQualifiedName();
}
@Override
public Icon getIcon(boolean open) {
return PlatformIcons.PACKAGE_ICON;
}
};
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:PackagePresentationProvider.java
示例4: getFieldPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
public static ItemPresentation getFieldPresentation(final PsiField psiField) {
return new ColoredItemPresentation() {
@Override
public String getPresentableText() {
return psiField.getName();
}
@Override
public TextAttributesKey getTextAttributesKey() {
if (psiField.isDeprecated()) {
return CodeInsightColors.DEPRECATED_ATTRIBUTES;
}
return null;
}
@Override
public String getLocationString() {
return getJavaSymbolContainerText(psiField);
}
@Override
public Icon getIcon(boolean open) {
return psiField.getIcon(Iconable.ICON_FLAG_VISIBILITY);
}
};
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:JavaPresentationUtil.java
示例5: getPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
public ItemPresentation getPresentation() {
return new ColoredItemPresentation() {
public String getPresentableText() {
return myPresentableName == null ? myPropertyName : myPresentableName;
}
public String getLocationString() {
return null;
}
public Icon getIcon(boolean open) {
return PlatformIcons.PROPERTY_ICON;
}
@Override
public TextAttributesKey getTextAttributesKey() {
boolean isComplete = PropertiesUtil.isPropertyComplete(myProject, myResourceBundle, myPropertyName);
if (isComplete) {
return PropertiesHighlighter.PROPERTY_KEY;
}
return INCOMPLETE_PROPERTY_KEY;
}
};
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:ResourceBundlePropertyStructureViewElement.java
示例6: getPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@Override
public ItemPresentation getPresentation(final PsiJavaPackage aPackage) {
return new ColoredItemPresentation() {
@Override
public TextAttributesKey getTextAttributesKey() {
return null;
}
@Override
public String getPresentableText() {
return aPackage.getName();
}
@Override
public String getLocationString() {
return aPackage.getQualifiedName();
}
@Override
public Icon getIcon(boolean open) {
return PlatformIcons.PACKAGE_ICON;
}
};
}
开发者ID:consulo,项目名称:consulo-java,代码行数:25,代码来源:PackagePresentationProvider.java
示例7: getFieldPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
public static ItemPresentation getFieldPresentation(final PsiField psiField) {
return new ColoredItemPresentation() {
@Override
public String getPresentableText() {
return psiField.getName();
}
@Override
public TextAttributesKey getTextAttributesKey() {
if (psiField.isDeprecated()) {
return CodeInsightColors.DEPRECATED_ATTRIBUTES;
}
return null;
}
@Override
public String getLocationString() {
return getJavaSymbolContainerText(psiField);
}
@Override
public Icon getIcon(boolean open) {
return IconDescriptorUpdaters.getIcon(psiField, Iconable.ICON_FLAG_VISIBILITY);
}
};
}
开发者ID:consulo,项目名称:consulo-java,代码行数:27,代码来源:JavaPresentationUtil.java
示例8: getPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@Override
public ItemPresentation getPresentation(@NotNull final PsiClass psiClass) {
return new ColoredItemPresentation() {
@Override
public String getPresentableText() {
return ClassPresentationUtil.getNameForClass(psiClass, false);
}
@Override
public String getLocationString() {
PsiFile file = psiClass.getContainingFile();
if (file instanceof PsiClassOwner) {
PsiClassOwner classOwner = (PsiClassOwner)file;
String packageName = classOwner.getPackageName();
if (packageName.isEmpty()) return null;
return "(" + packageName + ")";
}
return null;
}
@Override
public TextAttributesKey getTextAttributesKey() {
try {
if (psiClass.isDeprecated()) {
return CodeInsightColors.DEPRECATED_ATTRIBUTES;
}
}
catch (IndexNotReadyException ignore) {
}
return null;
}
@Override
public Icon getIcon(boolean open) {
return psiClass.getIcon(Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS);
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:ClassPresentationProvider.java
示例9: getMethodPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@NotNull
public static ColoredItemPresentation getMethodPresentation(@NotNull final PsiMethod psiMethod) {
return new ColoredItemPresentation() {
@Override
public String getPresentableText() {
return PsiFormatUtil.formatMethod(
psiMethod,
PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS,
PsiFormatUtilBase.SHOW_TYPE
);
}
@Override
public TextAttributesKey getTextAttributesKey() {
if (psiMethod.isDeprecated()) {
return CodeInsightColors.DEPRECATED_ATTRIBUTES;
}
return null;
}
@Override
public String getLocationString() {
return getJavaSymbolContainerText(psiMethod);
}
@Override
public Icon getIcon(boolean open) {
return psiMethod.getIcon(Iconable.ICON_FLAG_VISIBILITY);
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:JavaPresentationUtil.java
示例10: getFieldPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@NotNull
public static ItemPresentation getFieldPresentation(@NotNull final PsiField psiField) {
return new ColoredItemPresentation() {
@Override
public String getPresentableText() {
return psiField.getName();
}
@Override
public TextAttributesKey getTextAttributesKey() {
if (psiField.isDeprecated()) {
return CodeInsightColors.DEPRECATED_ATTRIBUTES;
}
return null;
}
@Override
public String getLocationString() {
return getJavaSymbolContainerText(psiField);
}
@Override
public Icon getIcon(boolean open) {
return psiField.getIcon(Iconable.ICON_FLAG_VISIBILITY);
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:JavaPresentationUtil.java
示例11: getSimpleTextAttributes
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
public static SimpleTextAttributes getSimpleTextAttributes(@Nullable final ItemPresentation presentation,
@NotNull EditorColorsScheme colorsScheme)
{
if (presentation instanceof ColoredItemPresentation) {
final TextAttributesKey textAttributesKey = ((ColoredItemPresentation) presentation).getTextAttributesKey();
if (textAttributesKey == null) return SimpleTextAttributes.REGULAR_ATTRIBUTES;
final TextAttributes textAttributes = colorsScheme.getAttributes(textAttributesKey);
return textAttributes == null ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.fromTextAttributes(textAttributes);
}
return SimpleTextAttributes.REGULAR_ATTRIBUTES;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:NodeRenderer.java
示例12: updateFrom
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
/**
* Copies the presentation parameters from the specified presentation instance.
*
* @param presentation the instance to copy the parameters from.
*/
public void updateFrom(ItemPresentation presentation) {
setIcon(presentation.getIcon(false));
setPresentableText(presentation.getPresentableText());
setLocationString(presentation.getLocationString());
if (presentation instanceof ColoredItemPresentation) {
setAttributesKey(((ColoredItemPresentation)presentation).getTextAttributesKey());
}
setSeparatorAbove(presentation instanceof ItemPresentationWithSeparator);
if (presentation instanceof LocationPresentation) {
myLocationPrefix = ((LocationPresentation)presentation).getLocationPrefix();
myLocationSuffix = ((LocationPresentation)presentation).getLocationSuffix();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:PresentationData.java
示例13: getNavigationItemAttributes
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@Nullable
protected TextAttributes getNavigationItemAttributes(Object value) {
TextAttributes attributes = null;
if (value instanceof NavigationItem) {
TextAttributesKey attributesKey = null;
final ItemPresentation presentation = ((NavigationItem)value).getPresentation();
if (presentation instanceof ColoredItemPresentation) attributesKey = ((ColoredItemPresentation) presentation).getTextAttributesKey();
if (attributesKey != null) {
attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attributesKey);
}
}
return attributes;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:PsiElementListCellRenderer.java
示例14: getPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@Override
@NotNull
public ItemPresentation getPresentation() {
return new ColoredItemPresentation() {
@Override
public String getPresentableText() {
return myPresentableName == null ? getProperty().getName() : myPresentableName.isEmpty() ? PROPERTY_GROUP_KEY_TEXT : myPresentableName;
}
@Override
public String getLocationString() {
return null;
}
@Override
public Icon getIcon(boolean open) {
return PlatformIcons.PROPERTY_ICON;
}
@Override
public TextAttributesKey getTextAttributesKey() {
final IgnoredPropertiesFilesSuffixesManager
ignoredPropertiesFilesSuffixesManager = IgnoredPropertiesFilesSuffixesManager.getInstance(myResourceBundle.getProject());
final boolean isPropertyComplete = ignoredPropertiesFilesSuffixesManager.isPropertyComplete(myResourceBundle, getProperty().getName());
if (myPresentableName != null && myPresentableName.isEmpty()) {
return isPropertyComplete ? GROUP_KEY : INCOMPLETE_GROUP_KEY;
}
return isPropertyComplete ? PropertiesHighlighter.PROPERTY_KEY : INCOMPLETE_PROPERTY_KEY;
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:ResourceBundlePropertyStructureViewElement.java
示例15: getPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@Override
public ItemPresentation getPresentation(final PsiClass psiClass) {
return new ColoredItemPresentation() {
@Override
public String getPresentableText() {
return ClassPresentationUtil.getNameForClass(psiClass, false);
}
@Override
public String getLocationString() {
PsiFile file = psiClass.getContainingFile();
if (file instanceof PsiClassOwner) {
PsiClassOwner classOwner = (PsiClassOwner)file;
String packageName = classOwner.getPackageName();
if (packageName.length() == 0) return null;
return "(" + packageName + ")";
}
return null;
}
@Override
public TextAttributesKey getTextAttributesKey() {
if (psiClass.isDeprecated()) {
return CodeInsightColors.DEPRECATED_ATTRIBUTES;
}
return null;
}
@Override
public Icon getIcon(boolean open) {
return psiClass.getIcon(Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS);
}
};
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:35,代码来源:ClassPresentationProvider.java
示例16: getMethodPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
public static ColoredItemPresentation getMethodPresentation(final PsiMethod psiMethod) {
return new ColoredItemPresentation() {
@Override
public String getPresentableText() {
return PsiFormatUtil.formatMethod(
psiMethod,
PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_NAME | PsiFormatUtil.SHOW_PARAMETERS,
PsiFormatUtil.SHOW_TYPE
);
}
@Override
public TextAttributesKey getTextAttributesKey() {
if (psiMethod.isDeprecated()) {
return CodeInsightColors.DEPRECATED_ATTRIBUTES;
}
return null;
}
@Override
public String getLocationString() {
return getJavaSymbolContainerText(psiMethod);
}
@Override
public Icon getIcon(boolean open) {
return psiMethod.getIcon(Iconable.ICON_FLAG_VISIBILITY);
}
};
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:JavaPresentationUtil.java
示例17: getNavigationItemAttributes
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@Nullable
protected static TextAttributes getNavigationItemAttributes(Object value) {
TextAttributes attributes = null;
if (value instanceof NavigationItem) {
TextAttributesKey attributesKey = null;
final ItemPresentation presentation = ((NavigationItem)value).getPresentation();
if (presentation instanceof ColoredItemPresentation) attributesKey = ((ColoredItemPresentation) presentation).getTextAttributesKey();
if (attributesKey != null) {
attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attributesKey);
}
}
return attributes;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:PsiElementListCellRenderer.java
示例18: getSimpleTextAttributes
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
public static SimpleTextAttributes getSimpleTextAttributes(@Nullable final ItemPresentation presentation,
@Nonnull EditorColorsScheme colorsScheme)
{
if (presentation instanceof ColoredItemPresentation) {
final TextAttributesKey textAttributesKey = ((ColoredItemPresentation) presentation).getTextAttributesKey();
if (textAttributesKey == null) return SimpleTextAttributes.REGULAR_ATTRIBUTES;
final TextAttributes textAttributes = colorsScheme.getAttributes(textAttributesKey);
return textAttributes == null ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.fromTextAttributes(textAttributes);
}
return SimpleTextAttributes.REGULAR_ATTRIBUTES;
}
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:NodeRenderer.java
示例19: getNavigationItemAttributes
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@Nullable
protected TextAttributes getNavigationItemAttributes(Object value) {
TextAttributes attributes = null;
if (value instanceof NavigationItem) {
TextAttributesKey attributesKey = null;
final ItemPresentation presentation = ((NavigationItem)value).getPresentation();
if (presentation instanceof ColoredItemPresentation) attributesKey = ((ColoredItemPresentation)presentation).getTextAttributesKey();
if (attributesKey != null) {
attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attributesKey);
}
}
return attributes;
}
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:PsiElementListCellRenderer.java
示例20: getPresentation
import com.intellij.navigation.ColoredItemPresentation; //导入依赖的package包/类
@Override
public ItemPresentation getPresentation(final PsiClass psiClass) {
return new ColoredItemPresentation() {
@Override
public String getPresentableText() {
return ClassPresentationUtil.getNameForClass(psiClass, false);
}
@Override
public String getLocationString() {
PsiFile file = psiClass.getContainingFile();
if (file instanceof PsiClassOwner) {
PsiClassOwner classOwner = (PsiClassOwner)file;
String packageName = classOwner.getPackageName();
if (packageName.length() == 0) return null;
return "(" + packageName + ")";
}
return null;
}
@Override
public TextAttributesKey getTextAttributesKey() {
if (psiClass.isDeprecated()) {
return CodeInsightColors.DEPRECATED_ATTRIBUTES;
}
return null;
}
@Override
public Icon getIcon(boolean open) {
return IconDescriptorUpdaters.getIcon(psiClass, Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS);
}
};
}
开发者ID:consulo,项目名称:consulo-java,代码行数:35,代码来源:ClassPresentationProvider.java
注:本文中的com.intellij.navigation.ColoredItemPresentation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论