use of com.intellij.xdebugger.impl.ui.tree.nodes.WatchNode in project google-cloud-intellij by GoogleCloudPlatform.
the class BreakpointConfigurationPanel method removeWatches.
@Override
public void removeWatches(List<? extends XDebuggerTreeNode> nodes) {
List<? extends WatchNode> children = rootNode.getAllChildren();
int minIndex = Integer.MAX_VALUE;
List<XDebuggerTreeNode> toRemove = new ArrayList<XDebuggerTreeNode>();
if (children != null) {
for (XDebuggerTreeNode node : nodes) {
@SuppressWarnings("SuspiciousMethodCalls") int index = children.indexOf(node);
if (index != -1) {
toRemove.add(node);
minIndex = Math.min(minIndex, index);
}
}
}
rootNode.removeChildren(toRemove);
List<? extends WatchNode> newChildren = rootNode.getAllChildren();
if (newChildren != null && !newChildren.isEmpty()) {
WatchNode node = minIndex < newChildren.size() ? newChildren.get(minIndex) : newChildren.get(newChildren.size() - 1);
TreeUtil.selectNode(treePanel.getTree(), node);
}
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.WatchNode in project google-cloud-intellij by GoogleCloudPlatform.
the class BreakpointConfigurationPanel method saveTo.
@SuppressWarnings("ConstantConditions")
@Override
public void saveTo(@NotNull final XLineBreakpoint<CloudLineBreakpointProperties> ideBreakpoint) {
CloudLineBreakpointProperties properties = ideBreakpoint.getProperties();
if (properties == null) {
LOG.error("Could not save changes to the breakpoint because for some reason it does not have cloud " + "properties.");
return;
}
XBreakpointBase lineBreakpointImpl = ideBreakpoint instanceof XBreakpointBase ? (XBreakpointBase) ideBreakpoint : null;
if (rootNode != null && lineBreakpointImpl != null) {
List<String> expressionsToSave = new ArrayList<String>();
List<? extends WatchNode> children = rootNode.getAllChildren();
if (children != null) {
for (WatchNode node : rootNode.getAllChildren()) {
expressionsToSave.add(node.getExpression().getExpression());
}
if (properties.setWatchExpressions(expressionsToSave.toArray(new String[expressionsToSave.size()]))) {
lineBreakpointImpl.fireBreakpointChanged();
}
}
}
}
use of com.intellij.xdebugger.impl.ui.tree.nodes.WatchNode in project intellij-community by JetBrains.
the class XSetValueAction method update.
@Override
public void update(final AnActionEvent e) {
super.update(e);
XValueNodeImpl node = getSelectedNode(e.getDataContext());
Presentation presentation = e.getPresentation();
if (node instanceof WatchNode) {
presentation.setVisible(false);
presentation.setEnabled(false);
} else {
presentation.setVisible(true);
}
}
Aggregations