本文整理汇总了Java中com.intellij.ui.CustomizeColoredTreeCellRenderer类的典型用法代码示例。如果您正苦于以下问题:Java CustomizeColoredTreeCellRenderer类的具体用法?Java CustomizeColoredTreeCellRenderer怎么用?Java CustomizeColoredTreeCellRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CustomizeColoredTreeCellRenderer类属于com.intellij.ui包,在下文中一共展示了CustomizeColoredTreeCellRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTreeCellRendererComponent
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Override
public Component getTreeCellRendererComponent(JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
final ErrorTreeElement element = getElement(value);
if (element != null) {
final CustomizeColoredTreeCellRenderer leftSelfRenderer = element.getLeftSelfRenderer();
final CustomizeColoredTreeCellRenderer rightSelfRenderer = element.getRightSelfRenderer();
if (leftSelfRenderer != null || rightSelfRenderer != null) {
myColoredTreeCellRenderer.setCurrentCallback(leftSelfRenderer);
myRightCellRenderer.setCurrentCallback(rightSelfRenderer);
return myWrapperRenderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
}
}
return super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
}
示例2: FixedHotfixGroupElement
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
public FixedHotfixGroupElement(String name, Object data, VirtualFile file) {
super(name, data, file);
myCustomizeColoredTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
public void customizeCellRenderer(SimpleColoredComponent renderer,
JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
renderer.setIcon(AllIcons.General.Information);
renderer.append("Fixed: ", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
final String[] text = getText();
final String checkedText = ((text != null) && (text.length > 0)) ? text[0] : "";
renderer.append(checkedText, SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
};
}
示例3: HotfixGroupElement
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
public HotfixGroupElement(final String name, final Object data, final VirtualFile file, final Consumer<HotfixGate> hotfix,
final String fixDescription, final MutableErrorTreeView view) {
super(name, data, file);
myHotfix = hotfix;
myFixDescription = fixDescription;
myView = view;
myLeftTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
public void customizeCellRenderer(SimpleColoredComponent renderer,
JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
renderer.setIcon(AllIcons.General.Error);
final String[] text = getText();
final String errorText = ((text != null) && (text.length > 0)) ? text[0] : "";
renderer.append("Error: " + errorText, SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
};
myRightTreeCellRenderer = new MyRightRenderer();
}
示例4: MyNavigatableWithDataElement
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
private MyNavigatableWithDataElement(final Project project,
@NotNull ErrorTreeElementKind kind,
GroupingElement parent,
String[] message,
@NotNull final VirtualFile vf,
String exportText,
String rendererTextPrefix) {
super(kind, parent, message, new OpenFileDescriptor(project, vf, -1, -1), exportText, rendererTextPrefix);
myVf = vf;
myCustomizeColoredTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
@Override
public void customizeCellRenderer(SimpleColoredComponent renderer,
JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
final Icon icon = myVf.getFileType().getIcon();
renderer.setIcon(icon);
final String[] messages = getText();
final String text = messages == null || messages.length == 0 ? vf.getPath() : messages[0];
renderer.append(text);
}
};
}
示例5: getTreeCellEditorComponent
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Override
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row) {
final ErrorTreeElement element = getElement(value);
if (element instanceof EditableMessageElement) {
EditableMessageElement editableMessageElement = (EditableMessageElement)element;
final CustomizeColoredTreeCellRenderer leftSelfRenderer = editableMessageElement.getLeftSelfRenderer();
final TreeCellEditor rightSelfEditor = editableMessageElement.getRightSelfEditor();
myColoredTreeCellRenderer.setCurrentCallback(leftSelfRenderer);
myRightCellRenderer.setCurrentCallback(rightSelfEditor);
return myWrapperEditor.getTreeCellEditorComponent(tree, value, selected, expanded, leaf, row);
}
return myTree.getCellRenderer().getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, true);
}
示例6: MyNavigatableWithDataElement
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
private MyNavigatableWithDataElement(final Project project,
@Nonnull ErrorTreeElementKind kind,
GroupingElement parent,
String[] message,
@Nonnull final VirtualFile vf,
String exportText,
String rendererTextPrefix) {
super(kind, parent, message, new OpenFileDescriptor(project, vf, -1, -1), exportText, rendererTextPrefix);
myVf = vf;
myCustomizeColoredTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
@Override
public void customizeCellRenderer(SimpleColoredComponent renderer,
JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus) {
final Icon icon = myVf.getFileType().getIcon();
renderer.setIcon(icon);
final String[] messages = getText();
final String text = messages == null || messages.length == 0 ? vf.getPath() : messages[0];
renderer.append(text);
}
};
}
示例7: getRightSelfRenderer
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Nullable
@Override
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
return myRightTreeCellRenderer;
}
示例8: getLeftSelfRenderer
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Nullable
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
return myLeftTreeCellRenderer;
}
示例9: setCurrentCallback
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
public void setCurrentCallback(final CustomizeColoredTreeCellRenderer currentCallback) {
myCurrentCallback = currentCallback;
}
示例10: getLeftSelfRenderer
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Nullable
CustomizeColoredTreeCellRenderer getLeftSelfRenderer();
示例11: getLeftSelfRenderer
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
return myCustomizeColoredTreeCellRenderer;
}
示例12: getLeftSelfRenderer
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
return myLeftTreeCellRenderer;
}
示例13: getRightSelfRenderer
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Override
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
return myRightTreeCellRenderer;
}
示例14: getLeftSelfRenderer
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Nullable
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
return null;
}
示例15: getRightSelfRenderer
import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Nullable
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
return null;
}