本文整理汇总了Java中com.intellij.openapi.roots.ui.util.CompositeAppearance类的典型用法代码示例。如果您正苦于以下问题:Java CompositeAppearance类的具体用法?Java CompositeAppearance怎么用?Java CompositeAppearance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CompositeAppearance类属于com.intellij.openapi.roots.ui.util包,在下文中一共展示了CompositeAppearance类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: forNodeDescriptorInTree
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
public static CellAppearanceEx forNodeDescriptorInTree(Object node, boolean expanded) {
NodeDescriptor descriptor = getNodeDescriptor(node);
if (descriptor == null) return FileAppearanceService.getInstance().empty();
String name = descriptor.toString();
Object psiElement = descriptor.getElement();
ModifiableCellAppearanceEx result;
if (psiElement instanceof PsiElement && !((PsiElement)psiElement).isValid()) {
result = CompositeAppearance.single(name);
}
else {
PsiClass psiClass = getContainingClass(psiElement);
if (isInheritedMember(node, psiClass) && psiClass != null) {
CompositeAppearance.DequeEnd ending = new CompositeAppearance().getEnding();
ending.addText(name, applyDeprecation(psiElement, SimpleTextAttributes.DARK_TEXT));
ending.addComment(psiClass.getName(), applyDeprecation(psiClass, SimpleTextAttributes.GRAY_ATTRIBUTES));
result = ending.getAppearance();
}
else {
SimpleTextAttributes textAttributes = applyDeprecation(psiElement, SimpleTextAttributes.REGULAR_ATTRIBUTES);
result = CompositeAppearance.single(name, textAttributes);
}
}
result.setIcon(descriptor.getIcon());
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:StructureNodeRenderer.java
示例2: forJdk
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
@NotNull
@Override
public CellAppearanceEx forJdk(@Nullable final Sdk jdk, final boolean isInComboBox, final boolean selected, final boolean showVersion) {
if (jdk == null) {
return FileAppearanceService.getInstance().forInvalidUrl(NO_JDK);
}
String name = jdk.getName();
CompositeAppearance appearance = new CompositeAppearance();
SdkType sdkType = (SdkType)jdk.getSdkType();
appearance.setIcon(sdkType.getIcon());
SimpleTextAttributes attributes = getTextAttributes(sdkType.sdkHasValidPath(jdk), selected);
CompositeAppearance.DequeEnd ending = appearance.getEnding();
ending.addText(name, attributes);
if (showVersion) {
String versionString = jdk.getVersionString();
if (versionString != null && !versionString.equals(name)) {
SimpleTextAttributes textAttributes = isInComboBox && !selected ? SimpleTextAttributes.SYNTHETIC_ATTRIBUTES :
SystemInfo.isMac && selected ? new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN,
Color.WHITE): SimpleTextAttributes.GRAY_ATTRIBUTES;
ending.addComment(versionString, textAttributes);
}
}
return ending.getAppearance();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:OrderEntryAppearanceServiceImpl.java
示例3: ExternalSystemJdkComboBox
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
public ExternalSystemJdkComboBox(@Nullable Project project) {
myProject = project;
setRenderer(new ColoredListCellRendererWrapper() {
@Override
protected void doCustomize(JList list, Object value, int index, boolean selected, boolean hasFocus) {
JdkComboBoxItem item = (JdkComboBoxItem)value;
CompositeAppearance appearance = new CompositeAppearance();
SdkType sdkType = JavaSdk.getInstance();
appearance.setIcon(sdkType.getIcon());
SimpleTextAttributes attributes = getTextAttributes(item.valid, selected);
CompositeAppearance.DequeEnd ending = appearance.getEnding();
ending.addText(item.label, attributes);
if (item.comment != null && !item.comment.equals(item.jdkName)) {
final SimpleTextAttributes textAttributes;
if (!item.valid) {
textAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES;
}
else {
textAttributes = SystemInfo.isMac && selected
? new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.WHITE)
: SimpleTextAttributes.GRAY_ATTRIBUTES;
}
ending.addComment(item.comment, textAttributes);
}
final CompositeAppearance compositeAppearance = ending.getAppearance();
compositeAppearance.customize(this);
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:ExternalSystemJdkComboBox.java
示例4: addShortcutText
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
public static boolean addShortcutText(String actionId, CompositeAppearance appearance) {
Keymap activeKeymap = KeymapManager.getInstance().getActiveKeymap();
Shortcut[] shortcuts = activeKeymap.getShortcuts(actionId);
if (shortcuts != null && shortcuts.length > 0) {
appearance.getEnding().addText(" (" + KeymapUtil.getShortcutText(shortcuts[0]) + ")", SimpleTextAttributes.GRAY_ATTRIBUTES);
return true;
} else return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AntTargetNodeDescriptor.java
示例5: addShortcutText
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
public static boolean addShortcutText(String actionId, CompositeAppearance appearance) {
Keymap activeKeymap = KeymapManager.getInstance().getActiveKeymap();
Shortcut[] shortcuts = activeKeymap.getShortcuts(actionId);
if (shortcuts != null && shortcuts.length > 0) {
appearance.getEnding().addText(" (" + KeymapUtil.getShortcutText(shortcuts[0]) + ")", SimpleTextAttributes.GRAY_ATTRIBUTES);
return true;
} else return false;
}
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:9,代码来源:AbstractSlingServerNodeDescriptor.java
示例6: forSdk
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
@Nonnull
@Override
public CellAppearanceEx forSdk(@Nullable final Sdk jdk, final boolean isInComboBox, final boolean selected, final boolean showVersion) {
if (jdk == null) {
return SimpleTextCellAppearance.invalid(ProjectBundle.message("unknown.sdk"), AllIcons.Toolbar.Unknown);
}
String name = jdk.getName();
CompositeAppearance appearance = new CompositeAppearance();
SdkType sdkType = (SdkType)jdk.getSdkType();
appearance.setIcon(SdkUtil.getIcon(jdk));
SimpleTextAttributes attributes = getTextAttributes(sdkType.sdkHasValidPath(jdk), selected);
CompositeAppearance.DequeEnd ending = appearance.getEnding();
ending.addText(name, attributes);
if (showVersion) {
String versionString = jdk.getVersionString();
if (versionString != null && !versionString.equals(name)) {
SimpleTextAttributes textAttributes = isInComboBox && !selected ? SimpleTextAttributes.SYNTHETIC_ATTRIBUTES :
SystemInfo.isMac && selected ? new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN,
Color.WHITE): SimpleTextAttributes.GRAY_ATTRIBUTES;
ending.addComment(versionString, textAttributes);
}
}
return ending.getAppearance();
}
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:OrderEntryAppearanceServiceImpl.java
示例7: HierarchyNodeDescriptor
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
protected HierarchyNodeDescriptor(@NotNull Project project, final NodeDescriptor parentDescriptor, @NotNull PsiElement element, final boolean isBase) {
super(project, parentDescriptor, element);
myHighlightedText = new CompositeAppearance();
myName = "";
myIsBase = isBase;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:HierarchyNodeDescriptor.java
示例8: getHighlightedText
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
public final CompositeAppearance getHighlightedText() {
return myHighlightedText;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:HierarchyNodeDescriptor.java
示例9: AntTargetNodeDescriptor
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
public AntTargetNodeDescriptor(final Project project, final NodeDescriptor parentDescriptor, final AntBuildTargetBase target) {
super(project, parentDescriptor);
myTarget = target;
myHighlightedText = new CompositeAppearance();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:AntTargetNodeDescriptor.java
示例10: AbstractSlingServerNodeDescriptor
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
public AbstractSlingServerNodeDescriptor(final Project project, final NodeDescriptor parentDescriptor, final T target) {
super(project, parentDescriptor);
myTarget = target;
myHighlightedText = new CompositeAppearance();
}
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:6,代码来源:AbstractSlingServerNodeDescriptor.java
示例11: HierarchyNodeDescriptor
import com.intellij.openapi.roots.ui.util.CompositeAppearance; //导入依赖的package包/类
protected HierarchyNodeDescriptor(@Nonnull Project project, final NodeDescriptor parentDescriptor, @Nonnull PsiElement element, final boolean isBase) {
super(project, parentDescriptor, element);
myHighlightedText = new CompositeAppearance();
myName = "";
myIsBase = isBase;
}
开发者ID:consulo,项目名称:consulo,代码行数:7,代码来源:HierarchyNodeDescriptor.java
注:本文中的com.intellij.openapi.roots.ui.util.CompositeAppearance类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论