use of org.erlide.backend.debug.IErlangBreakpoint in project erlide_eclipse by erlang.
the class ErlangLineBreakpointPropertyPage method createConditionEditor.
/**
* Validates the watchpoint...if we are one
*/
// private void validateWatchpoint() {
// if (fEnabledButton.getSelection()
// && !(fFieldAccess.getSelection() || fFieldModification
// .getSelection())) {
// addErrorMessage(fgWatchpointError);
// } else {
// removeErrorMessage(fgWatchpointError);
// }
// }
/**
* Validates the method breakpoint, if we are one
*/
// private void validateMethodBreakpoint() {
// boolean valid = true;
// if (fEnabledButton.getSelection()
// && !(fMethodEntry.getSelection() || fMethodExit.getSelection())) {
// setErrorMessage(fgMethodBreakpointError);
// valid = false;
// } else {
// setErrorMessage(null);
// }
// setValid(valid);
// }
/**
* Creates the controls that allow the user to specify the breakpoint's condition
*
* @param parent
* the composite in which the condition editor should be created
* @throws CoreException
* if an exception occurs accessing the breakpoint
*/
private void createConditionEditor(final Composite parent) throws CoreException {
final IErlangBreakpoint breakpoint = getBreakpoint();
// String label = null;
// if (BreakpointUtils.getType(breakpoint) != null) {
// final IBindingService bindingService = (IBindingService) PlatformUI
// .getWorkbench().getAdapter(IBindingService.class);
// if (bindingService != null) {
// final TriggerSequence keyBinding = bindingService
// .getBestActiveBindingFor(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
// if (keyBinding != null) {
// label = MessageFormat.format(
// PropertyPageMessages.JavaLineBreakpointPage_12,
// new String[] { keyBinding.format() });
// }
// }
// }
// if (label == null) {
// label = PropertyPageMessages.JavaLineBreakpointPage_13;
// }
final Group g = new Group(parent, SWT.NONE);
g.setLayout(new GridLayout(1, false));
g.setText(ErlangBreakpointPropertyPage.EMPTY_STRING);
g.setFont(parent.getFont());
final GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 1;
g.setLayoutData(gd);
final Composite conditionComposite = g;
fEnableConditionButton = createCheckButton(conditionComposite, "Enable");
fEnableConditionButton.setSelection(breakpoint.isConditionEnabled());
fEnableConditionButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
setConditionEnabled(fEnableConditionButton.getSelection());
}
});
fConditionEditor = new BreakpointConditionEditor(conditionComposite, this);
// fSuspendWhenLabel = createLabel(conditionComposite,
// PropertyPageMessages.JavaLineBreakpointPage_15);
// fConditionIsTrue = createRadioButton(conditionComposite,
// "condition is 'tr&ue'");
// fConditionHasChanged = createRadioButton(conditionComposite,
// "value of condition ch&anges");
// if (breakpoint.isConditionSuspendOnTrue()) {
// fConditionIsTrue.setSelection(true);
// } else {
// fConditionHasChanged.setSelection(true);
// }
setConditionEnabled(fEnableConditionButton.getSelection());
}
use of org.erlide.backend.debug.IErlangBreakpoint in project erlide_eclipse by erlang.
the class BreakpointMarkerUpdater method lineBreakpointExists.
/**
* Searches for an existing line breakpoint on the specified line in the current type
* that does not match the id of the specified marker
*
* @param resource
* the resource to care about
* @param typeName
* the name of the type the breakpoint is in
* @param lineNumber
* the number of the line the breakpoint is on
* @param currentmarker
* the current marker we are comparing to see if it will be moved onto an
* existing one
* @return an existing line breakpoint on the current line of the given resource and
* type if there is one
* @throws CoreException
*
* @since 3.4
*/
private IErlangBreakpoint lineBreakpointExists(final IResource resource, final int lineNumber, final IMarker currentmarker) throws CoreException {
final IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
final IBreakpoint[] breakpoints = manager.getBreakpoints(ErlDebugConstants.ID_ERLANG_DEBUG_MODEL);
final String markerType = currentmarker.getType();
for (final IBreakpoint breakpoint1 : breakpoints) {
if (!(breakpoint1 instanceof IErlangBreakpoint)) {
continue;
}
final IErlangBreakpoint breakpoint = (IErlangBreakpoint) breakpoint1;
final IMarker marker = breakpoint.getMarker();
if (marker != null && marker.exists() && marker.getType().equals(markerType) && currentmarker.getId() != marker.getId()) {
if (marker instanceof ErlangLineBreakpoint) {
final ErlangLineBreakpoint erlangLineBreakpoint = (ErlangLineBreakpoint) marker;
if (erlangLineBreakpoint.getLineNumber() == lineNumber) {
return erlangLineBreakpoint;
}
}
}
}
return null;
}
use of org.erlide.backend.debug.IErlangBreakpoint in project erlide_eclipse by erlang.
the class ErlangBreakpointPropertyPage method doStore.
/**
* Stores the values configured in this page. This method should be called from within
* a workspace runnable to reduce the number of resource deltas.
*/
protected void doStore() throws CoreException {
final IErlangBreakpoint breakpoint = getBreakpoint();
// storeHitCount(breakpoint);
storeEnabled(breakpoint);
storeBreakAction(breakpoint);
}
Aggregations