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);
}
use of com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem in project intellij-community by JetBrains.
the class BreakpointsTreeCellRenderer method customizeRenderer.
private static void customizeRenderer(Project project, Object value, boolean selected, boolean expanded, ColoredTreeCellRenderer renderer) {
if (value instanceof BreakpointItemNode) {
BreakpointItemNode node = (BreakpointItemNode) value;
BreakpointItem breakpoint = node.getBreakpointItem();
breakpoint.setupRenderer(renderer, project, selected);
} else if (value instanceof BreakpointsGroupNode) {
XBreakpointGroup group = ((BreakpointsGroupNode) value).getGroup();
renderer.setIcon(group.getIcon(expanded));
if (group instanceof XBreakpointCustomGroup && ((XBreakpointCustomGroup) group).isDefault()) {
renderer.append(group.getName(), SIMPLE_CELL_ATTRIBUTES_BOLD);
} else {
renderer.append(group.getName(), SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES);
}
}
}
use of com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem in project intellij-community by JetBrains.
the class BreakpointItemsTreeController method rebuildTree.
public void rebuildTree(Collection<BreakpointItem> items) {
List<BreakpointItem> selectedBreakpoints = getSelectedBreakpoints(false);
TreePath path = myTreeView.getSelectionPath();
buildTree(items);
if (myTreeView.getRowForPath(path) == -1 && !selectedBreakpoints.isEmpty()) {
selectBreakpointItem(selectedBreakpoints.get(0), path);
} else {
selectBreakpointItem(null, path);
}
}
use of com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem in project intellij-community by JetBrains.
the class BreakpointItemsTreeController method getSelectedBreakpoints.
public List<BreakpointItem> getSelectedBreakpoints(boolean traverse) {
TreePath[] selectionPaths = myTreeView.getSelectionPaths();
if (selectionPaths == null || selectionPaths.length == 0)
return Collections.emptyList();
final ArrayList<BreakpointItem> list = new ArrayList<>();
for (TreePath selectionPath : selectionPaths) {
TreeNode startNode = (TreeNode) selectionPath.getLastPathComponent();
if (traverse) {
TreeUtil.traverseDepth(startNode, node -> {
if (node instanceof BreakpointItemNode) {
list.add(((BreakpointItemNode) node).getBreakpointItem());
}
return true;
});
} else {
if (startNode instanceof BreakpointItemNode) {
list.add(((BreakpointItemNode) startNode).getBreakpointItem());
}
}
}
return list;
}
use of com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem in project intellij-community by JetBrains.
the class BreakpointItemsTreeController method buildTree.
public void buildTree(@NotNull Collection<? extends BreakpointItem> breakpoints) {
final TreeState state = TreeState.createOn(myTreeView, myRoot);
myRoot.removeAllChildren();
myNodes.clear();
myGroups.clear();
for (BreakpointItem breakpoint : breakpoints) {
BreakpointItemNode node = new BreakpointItemNode(breakpoint);
CheckedTreeNode parent = getParentNode(breakpoint);
parent.add(node);
myNodes.put(breakpoint, node);
}
TreeUtil.sortRecursively(myRoot, myComparator);
myInBuild = true;
((DefaultTreeModel) (myTreeView.getModel())).nodeStructureChanged(myRoot);
state.applyTo(myTreeView, myRoot);
myInBuild = false;
}
Aggregations