use of com.intellij.xdebugger.impl.breakpoints.XBreakpointBase in project intellij-community by JetBrains.
the class Breakpoint method readExternal.
public void readExternal(Element parentNode) throws InvalidDataException {
FilteredRequestorImpl requestor = new FilteredRequestorImpl(myProject);
requestor.readTo(parentNode, this);
try {
setEnabled(Boolean.valueOf(JDOMExternalizerUtil.readField(parentNode, "ENABLED")));
} catch (Exception ignored) {
}
try {
setLogEnabled(Boolean.valueOf(JDOMExternalizerUtil.readField(parentNode, "LOG_ENABLED")));
} catch (Exception ignored) {
}
try {
String logMessage = JDOMExternalizerUtil.readField(parentNode, LOG_MESSAGE_OPTION_NAME);
if (logMessage != null && !logMessage.isEmpty()) {
XExpressionImpl expression = XExpressionImpl.fromText(logMessage);
XDebuggerHistoryManager.getInstance(myProject).addRecentExpression(XBreakpointActionsPanel.LOG_EXPRESSION_HISTORY_ID, expression);
myXBreakpoint.setLogExpressionObject(expression);
((XBreakpointBase) myXBreakpoint).setLogExpressionEnabled(Boolean.valueOf(JDOMExternalizerUtil.readField(parentNode, "LOG_EXPRESSION_ENABLED")));
}
} catch (Exception ignored) {
}
try {
setRemoveAfterHit(Boolean.valueOf(JDOMExternalizerUtil.readField(parentNode, "REMOVE_AFTER_HIT")));
} catch (Exception ignored) {
}
}
use of com.intellij.xdebugger.impl.breakpoints.XBreakpointBase in project intellij-community by JetBrains.
the class BreakpointManager method getJavaBreakpoint.
@Nullable
public static Breakpoint getJavaBreakpoint(@Nullable final XBreakpoint xBreakpoint) {
if (xBreakpoint == null) {
return null;
}
Breakpoint breakpoint = xBreakpoint.getUserData(Breakpoint.DATA_KEY);
if (breakpoint == null && xBreakpoint.getType() instanceof JavaBreakpointType) {
Project project = ((XBreakpointBase) xBreakpoint).getProject();
breakpoint = ((JavaBreakpointType) xBreakpoint.getType()).createJavaBreakpoint(project, xBreakpoint);
xBreakpoint.putUserData(Breakpoint.DATA_KEY, breakpoint);
}
return breakpoint;
}
use of com.intellij.xdebugger.impl.breakpoints.XBreakpointBase in project kotlin by JetBrains.
the class KotlinBreakpointFiltersPanel method saveTo.
@Override
public void saveTo(@NotNull B breakpoint) {
JavaBreakpointProperties properties = breakpoint.getProperties();
if (properties == null) {
return;
}
boolean changed = false;
try {
String text = myPassCountField.getText().trim();
int filter = !text.isEmpty() ? Integer.parseInt(text) : 0;
if (filter < 0)
filter = 0;
changed = properties.setCOUNT_FILTER(filter);
} catch (Exception ignored) {
}
changed = properties.setCOUNT_FILTER_ENABLED(properties.getCOUNT_FILTER() > 0 && myPassCountCheckbox.isSelected()) || changed;
reloadInstanceFilters();
reloadClassFilters();
updateInstanceFilterEditor(true);
updateClassFilterEditor(true);
changed = properties.setINSTANCE_FILTERS_ENABLED(myInstanceFiltersField.getText().length() > 0 && myInstanceFiltersCheckBox.isSelected()) || changed;
changed = properties.setCLASS_FILTERS_ENABLED(myClassFiltersField.getText().length() > 0 && myClassFiltersCheckBox.isSelected()) || changed;
changed = properties.setClassFilters(myClassFilters) || changed;
changed = properties.setClassExclusionFilters(myClassExclusionFilters) || changed;
changed = properties.setInstanceFilters(myInstanceFilters) || changed;
if (changed) {
((XBreakpointBase) breakpoint).fireBreakpointChanged();
}
}
use of com.intellij.xdebugger.impl.breakpoints.XBreakpointBase 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.breakpoints.XBreakpointBase in project intellij-community by JetBrains.
the class JavaBreakpointFiltersPanel method saveTo.
@Override
public void saveTo(@NotNull B breakpoint) {
JavaBreakpointProperties properties = breakpoint.getProperties();
if (properties == null) {
return;
}
boolean changed = false;
try {
String text = myPassCountField.getText().trim();
int filter = !text.isEmpty() ? Integer.parseInt(text) : 0;
if (filter < 0)
filter = 0;
changed = properties.setCOUNT_FILTER(filter);
} catch (Exception ignored) {
}
changed = properties.setCOUNT_FILTER_ENABLED(properties.getCOUNT_FILTER() > 0 && myPassCountCheckbox.isSelected()) || changed;
reloadInstanceFilters();
updateInstanceFilterEditor(true);
if (properties instanceof JavaExceptionBreakpointProperties) {
JavaExceptionBreakpointProperties exceptionBreakpointProperties = (JavaExceptionBreakpointProperties) properties;
changed = exceptionBreakpointProperties.setCatchFiltersEnabled(!myCatchClassFilters.getText().isEmpty() && myCatchCheckBox.isSelected()) || changed;
changed = exceptionBreakpointProperties.setCatchClassFilters(myCatchClassFilters.getClassFilters()) || changed;
changed = exceptionBreakpointProperties.setCatchClassExclusionFilters(myCatchClassFilters.getClassExclusionFilters()) || changed;
}
changed = properties.setCLASS_FILTERS_ENABLED(!myClassFiltersField.getText().isEmpty() && myClassFiltersCheckBox.isSelected()) || changed;
changed = properties.setClassFilters(myClassFiltersField.getClassFilters()) || changed;
changed = properties.setClassExclusionFilters(myClassFiltersField.getClassExclusionFilters()) || changed;
changed = properties.setINSTANCE_FILTERS_ENABLED(!myInstanceFiltersField.getText().isEmpty() && myInstanceFiltersCheckBox.isSelected()) || changed;
changed = properties.setInstanceFilters(myInstanceFilters) || changed;
if (changed) {
((XBreakpointBase) breakpoint).fireBreakpointChanged();
}
}
Aggregations