Search in sources :

Example 6 with SpeedSearchComparator

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

the class LiveObjectsView method setupUI.

private void setupUI() {
    liveObjectsTreeTable.getTree().setRootVisible(false);
    setColumnWidth(liveObjectsTreeTable.getColumnModel().getColumn(1), MS_COLUMN_WIDTH);
    setColumnWidth(liveObjectsTreeTable.getColumnModel().getColumn(2), MS_COLUMN_WIDTH);
    new TreeTableSpeedSearch(liveObjectsTreeTable).setComparator(new SpeedSearchComparator(false));
    PopupHandler.installPopupHandler(liveObjectsTreeTable, PROFILER_VIEW_GROUP_ID, ActionPlaces.UNKNOWN);
    liveObjectsTreeTable.getEmptyText().setText(ProfilerBundle.message("live.objects.loading"));
    liveObjectsTreeTable.getTree().setCellRenderer(new SizeInfoCellRenderer() {

        @Override
        public void customizeCellRenderer(Object value, boolean selected) {
            Icon icon = AllIcons.General.Information;
            if (value instanceof SizeInfoNode) {
                icon = ((SizeInfoNode) value).isMethod() ? AllIcons.Nodes.Method : AllIcons.Nodes.Class;
            }
            setPaintFocusBorder(false);
            setIcon(icon);
            super.customizeCellRenderer(value, selected);
        }
    });
    final ComboBoxModel model = filterScope.getComboBox().getModel();
    if (model instanceof DefaultComboBoxModel) {
        ((DefaultComboBoxModel) model).insertElementAt(new ScopeDescriptor(new AllSearchScope(getProject())), 0);
    }
}
Also used : TreeTableSpeedSearch(com.intellij.ui.TreeTableSpeedSearch) ScopeDescriptor(com.intellij.ide.util.scopeChooser.ScopeDescriptor) SizeInfoCellRenderer(com.jetbrains.actionscript.profiler.render.SizeInfoCellRenderer) AllSearchScope(com.jetbrains.actionscript.profiler.util.AllSearchScope) SizeInfoNode(com.jetbrains.actionscript.profiler.livetable.SizeInfoNode) SpeedSearchComparator(com.intellij.ui.SpeedSearchComparator)

Example 7 with SpeedSearchComparator

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

the class CPUSnapshotView method setupUI.

private void setupUI() {
    myHotSpotsTreeTable.setRootVisible(false);
    myTracesTreeTable.setRootVisible(false);
    setColumnWidth(myHotSpotsTreeTable.getColumnModel().getColumn(1), MS_COLUMN_WIDTH);
    setColumnWidth(myHotSpotsTreeTable.getColumnModel().getColumn(2), MS_COLUMN_WIDTH);
    setColumnWidth(myTracesTreeTable.getColumnModel().getColumn(1), MS_COLUMN_WIDTH);
    setColumnWidth(myTracesTreeTable.getColumnModel().getColumn(2), MS_COLUMN_WIDTH);
    scopeLabel.setLabelFor(filterScope.getComboBox());
    invokedFunctionsLabel.setLabelFor(myHotSpotsTreeTable);
    mergedCalleesLabel.setLabelFor(myTracesTreeTable);
    new TreeTableSpeedSearch(myHotSpotsTreeTable).setComparator(new SpeedSearchComparator(false));
    new TreeTableSpeedSearch(myTracesTreeTable).setComparator(new SpeedSearchComparator(false));
    PopupHandler.installPopupHandler(myHotSpotsTreeTable, PROFILER_VIEW_GROUP_ID, ActionPlaces.UNKNOWN);
    PopupHandler.installPopupHandler(myTracesTreeTable, PROFILER_VIEW_GROUP_ID, ActionPlaces.UNKNOWN);
    final ComboBoxModel model = filterScope.getComboBox().getModel();
    if (model instanceof DefaultComboBoxModel) {
        ((DefaultComboBoxModel) model).insertElementAt(new ScopeDescriptor(new AllSearchScope(getProject())), 0);
    }
    myHotSpotsTreeTable.getTree().setCellRenderer(new FrameInfoCellRenderer(projectScope) {

        @Override
        public void customizeCellRenderer(Object value, boolean selected) {
            setPaintFocusBorder(false);
            setScopeIcon(FlexProfilerIcons.CallerArrow);
            setNonScopeIcon(FlexProfilerIcons.CallerLeafArrow);
            super.customizeCellRenderer(value, selected);
        }
    });
    myTracesTreeTable.getTree().setCellRenderer(new FrameInfoCellRenderer(projectScope) {

        @Override
        public void customizeCellRenderer(Object value, boolean selected) {
            setPaintFocusBorder(false);
            setScopeIcon(FlexProfilerIcons.CalleeArrow);
            setNonScopeIcon(FlexProfilerIcons.CalleeLeafArrow);
            super.customizeCellRenderer(value, selected);
        }
    });
    myFilterSystemStuff.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            buildPerformanceSamples(myHotSpotsTreeTable.getSortableTreeTableModel());
            TreeUtil.expand(myHotSpotsTreeTable.getTree(), 1);
        }
    });
    filterScope.getComboBox().addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            myAlarm.cancelAllRequests();
            myAlarm.addRequest(() -> {
                buildPerformanceSamples(myHotSpotsTreeTable.getSortableTreeTableModel());
                TreeUtil.expand(myHotSpotsTreeTable.getTree(), 1);
            }, 100);
        }
    });
}
Also used : TreeTableSpeedSearch(com.intellij.ui.TreeTableSpeedSearch) ScopeDescriptor(com.intellij.ide.util.scopeChooser.ScopeDescriptor) FrameInfoCellRenderer(com.jetbrains.actionscript.profiler.render.FrameInfoCellRenderer) ItemEvent(java.awt.event.ItemEvent) AllSearchScope(com.jetbrains.actionscript.profiler.util.AllSearchScope) ItemListener(java.awt.event.ItemListener) SpeedSearchComparator(com.intellij.ui.SpeedSearchComparator)

Aggregations

SpeedSearchComparator (com.intellij.ui.SpeedSearchComparator)7 TreeTableSpeedSearch (com.intellij.ui.TreeTableSpeedSearch)4 ScopeDescriptor (com.intellij.ide.util.scopeChooser.ScopeDescriptor)2 TreeSpeedSearch (com.intellij.ui.TreeSpeedSearch)2 Tree (com.intellij.ui.treeStructure.Tree)2 AbstractTableCellEditor (com.intellij.util.ui.AbstractTableCellEditor)2 AllSearchScope (com.jetbrains.actionscript.profiler.util.AllSearchScope)2 TableCellEditor (javax.swing.table.TableCellEditor)2 TableCellRenderer (javax.swing.table.TableCellRenderer)2 TableColumn (javax.swing.table.TableColumn)2 Value (com.intellij.psi.codeStyle.extractor.values.Value)1 CodeStyleSettingPresentation (com.intellij.psi.codeStyle.presentation.CodeStyleSettingPresentation)1 ClickListener (com.intellij.ui.ClickListener)1 JBScrollPane (com.intellij.ui.components.JBScrollPane)1 ListTreeTableModel (com.intellij.ui.treeStructure.treetable.ListTreeTableModel)1 TreeTable (com.intellij.ui.treeStructure.treetable.TreeTable)1 TreeTableCellRenderer (com.intellij.ui.treeStructure.treetable.TreeTableCellRenderer)1 TreeTableModel (com.intellij.ui.treeStructure.treetable.TreeTableModel)1 ColumnInfo (com.intellij.util.ui.ColumnInfo)1 SizeInfoNode (com.jetbrains.actionscript.profiler.livetable.SizeInfoNode)1