Search in sources :

Example 11 with ColoredTreeCellRenderer

use of com.intellij.ui.ColoredTreeCellRenderer in project intellij-plugins by JetBrains.

the class ActionScriptProfileControlPanel method setupComponents.

private void setupComponents() {
    EditSourceOnDoubleClickHandler.install(snapshotTree);
    PopupHandler.installPopupHandler(snapshotTree, PROFILER_SNAPSHOT_GROUP_ID, ActionPlaces.UNKNOWN);
    snapshotTree.setCellRenderer(new ColoredTreeCellRenderer() {

        @Override
        public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
            setIcon(value instanceof CPUSnapshotNode ? FlexProfilerIcons.SnapshotCPU : FlexProfilerIcons.LiveObjects);
            if (value.toString() != null) {
                append(value.toString());
            }
        }
    });
}
Also used : CPUSnapshotNode(com.jetbrains.actionscript.profiler.ui.node.CPUSnapshotNode) ColoredTreeCellRenderer(com.intellij.ui.ColoredTreeCellRenderer)

Aggregations

ColoredTreeCellRenderer (com.intellij.ui.ColoredTreeCellRenderer)11 NotNull (org.jetbrains.annotations.NotNull)6 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)3 ColumnTreeBuilder (com.android.tools.adtui.common.ColumnTreeBuilder)2 AppStatTreeNode (com.android.tools.idea.monitor.ui.cpu.view.AppStatTreeNode)2 TreeSelectionEvent (javax.swing.event.TreeSelectionEvent)2 TreeSelectionListener (javax.swing.event.TreeSelectionListener)2 Nullable (org.jetbrains.annotations.Nullable)2 License (com.android.repository.api.License)1 DnDTransferItem (com.android.tools.idea.uibuilder.model.DnDTransferItem)1 Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PsiFile (com.intellij.psi.PsiFile)1 PsiManager (com.intellij.psi.PsiManager)1 JBImageIcon (com.intellij.util.ui.JBImageIcon)1 ConfigFileSearcher (com.intellij.xml.config.ConfigFileSearcher)1 ConfigFilesTreeBuilder (com.intellij.xml.config.ConfigFilesTreeBuilder)1 IndexedRelevantResource (com.intellij.xml.index.IndexedRelevantResource)1 XsdNamespaceBuilder (com.intellij.xml.index.XsdNamespaceBuilder)1