Search in sources :

Example 1 with CustomizeColoredTreeCellRenderer

use of com.intellij.ui.CustomizeColoredTreeCellRenderer in project intellij-community by JetBrains.

the class NewErrorTreeEditor method getTreeCellEditorComponent.

@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);
}
Also used : TreeCellEditor(javax.swing.tree.TreeCellEditor) CustomizeColoredTreeCellRenderer(com.intellij.ui.CustomizeColoredTreeCellRenderer)

Example 2 with CustomizeColoredTreeCellRenderer

use of com.intellij.ui.CustomizeColoredTreeCellRenderer in project intellij-community by JetBrains.

the class NewErrorTreeRenderer method getTreeCellRendererComponent.

@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);
}
Also used : CustomizeColoredTreeCellRenderer(com.intellij.ui.CustomizeColoredTreeCellRenderer)

Aggregations

CustomizeColoredTreeCellRenderer (com.intellij.ui.CustomizeColoredTreeCellRenderer)2 TreeCellEditor (javax.swing.tree.TreeCellEditor)1