Search in sources :

Example 1 with CloudLineBreakpointProperties

use of com.google.cloud.tools.intellij.debugger.CloudLineBreakpointProperties 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();
            }
        }
    }
}
Also used : WatchNode(com.intellij.xdebugger.impl.ui.tree.nodes.WatchNode) XBreakpointBase(com.intellij.xdebugger.impl.breakpoints.XBreakpointBase) ArrayList(java.util.ArrayList) CloudLineBreakpointProperties(com.google.cloud.tools.intellij.debugger.CloudLineBreakpointProperties)

Aggregations

CloudLineBreakpointProperties (com.google.cloud.tools.intellij.debugger.CloudLineBreakpointProperties)1 XBreakpointBase (com.intellij.xdebugger.impl.breakpoints.XBreakpointBase)1 WatchNode (com.intellij.xdebugger.impl.ui.tree.nodes.WatchNode)1 ArrayList (java.util.ArrayList)1