Search in sources :

Example 1 with BreakpointItem

use of com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem in project intellij-community by JetBrains.

the class XBreakpointUtil method getDebuggerSupport.

@Nullable
public static DebuggerSupport getDebuggerSupport(Project project, BreakpointItem breakpointItem) {
    DebuggerSupport[] debuggerSupports = DebuggerSupport.getDebuggerSupports();
    List<BreakpointItem> items = new ArrayList<>();
    for (DebuggerSupport support : debuggerSupports) {
        support.getBreakpointPanelProvider().provideBreakpointItems(project, items);
        if (items.contains(breakpointItem)) {
            return support;
        }
        items.clear();
    }
    return null;
}
Also used : BreakpointItem(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem) ArrayList(java.util.ArrayList) DebuggerSupport(com.intellij.xdebugger.impl.DebuggerSupport) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with BreakpointItem

use of com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem in project intellij-community by JetBrains.

the class BreakpointsFavoriteListProvider method customizeRenderer.

@Override
public void customizeRenderer(ColoredTreeCellRenderer renderer, JTree tree, @NotNull Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
    renderer.clear();
    renderer.setIcon(AllIcons.Debugger.Db_set_breakpoint);
    if (value instanceof BreakpointItem) {
        BreakpointItem breakpointItem = (BreakpointItem) value;
        breakpointItem.setupGenericRenderer(renderer, true);
    } else if (value instanceof XBreakpointGroup) {
        renderer.append(((XBreakpointGroup) value).getName());
        renderer.setIcon(((XBreakpointGroup) value).getIcon(expanded));
    } else if (value instanceof XBreakpointGroupingRule) {
        renderer.append(((XBreakpointGroupingRule) value).getPresentableName());
    } else {
        renderer.append(String.valueOf(value));
    }
}
Also used : BreakpointItem(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem) XBreakpointGroupingRule(com.intellij.xdebugger.breakpoints.ui.XBreakpointGroupingRule) XBreakpointGroup(com.intellij.xdebugger.breakpoints.ui.XBreakpointGroup)

Example 3 with BreakpointItem

use of com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem in project intellij-community by JetBrains.

the class BreakpointsFavoriteListProvider method updateChildren.

private void updateChildren() {
    if (myProject.isDisposed())
        return;
    myChildren.clear();
    List<BreakpointItem> items = new ArrayList<>();
    for (final BreakpointPanelProvider provider : myBreakpointPanelProviders) {
        provider.provideBreakpointItems(myProject, items);
    }
    getEnabledGroupingRules(myRulesEnabled);
    myTreeController.setGroupingRules(myRulesEnabled);
    myTreeController.rebuildTree(items);
    CheckedTreeNode root = myTreeController.getRoot();
    for (int i = 0; i < root.getChildCount(); i++) {
        TreeNode child = root.getChildAt(i);
        if (child instanceof DefaultMutableTreeNode) {
            replicate((DefaultMutableTreeNode) child, myNode, myChildren);
        }
    }
    myFavoritesManager.fireListeners(getListName(myProject));
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) TreeNode(javax.swing.tree.TreeNode) AbstractTreeNode(com.intellij.ide.util.treeView.AbstractTreeNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CheckedTreeNode(com.intellij.ui.CheckedTreeNode) BreakpointItem(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem) CheckedTreeNode(com.intellij.ui.CheckedTreeNode) BreakpointPanelProvider(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointPanelProvider)

Example 4 with BreakpointItem

use of com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem in project intellij-community by JetBrains.

the class BreakpointItemsTreeController method removeSelectedBreakpoints.

public void removeSelectedBreakpoints(Project project) {
    final TreePath[] paths = myTreeView.getSelectionPaths();
    if (paths == null)
        return;
    final List<BreakpointItem> breakpoints = getSelectedBreakpoints(true);
    for (TreePath path : paths) {
        final Object node = path.getLastPathComponent();
        if (node instanceof BreakpointItemNode) {
            final BreakpointItem item = ((BreakpointItemNode) node).getBreakpointItem();
            if (!item.allowedToRemove()) {
                TreeUtil.unselect(myTreeView, (DefaultMutableTreeNode) node);
                breakpoints.remove(item);
            }
        }
    }
    if (breakpoints.isEmpty())
        return;
    TreeUtil.removeSelected(myTreeView);
    for (BreakpointItem breakpoint : breakpoints) {
        breakpoint.removed(project);
    }
}
Also used : TreePath(javax.swing.tree.TreePath) BreakpointItem(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem)

Example 5 with BreakpointItem

use of com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem in project intellij-community by JetBrains.

the class BreakpointsCheckboxTree method convertValueToText.

public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
    if (value instanceof BreakpointItemNode) {
        final BreakpointItem breakpointItem = ((BreakpointItemNode) value).getBreakpointItem();
        final String displayText = breakpointItem != null ? breakpointItem.getDisplayText() : null;
        if (!StringUtil.isEmptyOrSpaces(displayText)) {
            return displayText;
        }
    }
    return super.convertValueToText(value, selected, expanded, leaf, row, hasFocus);
}
Also used : BreakpointItem(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem)

Aggregations

BreakpointItem (com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem)10 CheckedTreeNode (com.intellij.ui.CheckedTreeNode)3 TreePath (javax.swing.tree.TreePath)3 XBreakpointGroup (com.intellij.xdebugger.breakpoints.ui.XBreakpointGroup)2 DebuggerSupport (com.intellij.xdebugger.impl.DebuggerSupport)2 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)2 TreeNode (javax.swing.tree.TreeNode)2 AbstractTreeNode (com.intellij.ide.util.treeView.AbstractTreeNode)1 TreeState (com.intellij.ide.util.treeView.TreeState)1 XBreakpointGroupingRule (com.intellij.xdebugger.breakpoints.ui.XBreakpointGroupingRule)1 BreakpointPanelProvider (com.intellij.xdebugger.impl.breakpoints.ui.BreakpointPanelProvider)1 XBreakpointCustomGroup (com.intellij.xdebugger.impl.breakpoints.ui.grouping.XBreakpointCustomGroup)1 ArrayList (java.util.ArrayList)1 DefaultTreeModel (javax.swing.tree.DefaultTreeModel)1 Nullable (org.jetbrains.annotations.Nullable)1