use of org.erlide.backend.debug.IErlangBreakpoint in project erlide_eclipse by erlang.
the class ErlangBreakpointPropertyPage method performOk.
/**
* the hit count error message
*/
// private static final String fgHitCountErrorMessage =
// "Hit count must be a positive integer";
/**
* Store the breakpoint properties.
*
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
@Override
public boolean performOk() {
final IWorkspaceRunnable wr = new IWorkspaceRunnable() {
@Override
public void run(final IProgressMonitor monitor) throws CoreException {
final IErlangBreakpoint breakpoint = getBreakpoint();
final boolean delOnCancel = breakpoint.getMarker().getAttribute(ErlangBreakpointPropertyPage.ATTR_DELETE_ON_CANCEL) != null;
if (delOnCancel) {
// if this breakpoint is being created, remove the
// "delete on cancel" attribute
// and register with the breakpoint manager
breakpoint.getMarker().setAttribute(ErlangBreakpointPropertyPage.ATTR_DELETE_ON_CANCEL, (String) null);
breakpoint.setRegistered(true);
}
doStore();
}
};
try {
ResourcesPlugin.getWorkspace().run(wr, null, 0, null);
} catch (final CoreException e) {
ErlLogger.error(e);
}
return super.performOk();
}
use of org.erlide.backend.debug.IErlangBreakpoint in project erlide_eclipse by erlang.
the class ErlangLineBreakpointPropertyPage method createTypeSpecificEditors.
/**
* Create the condition editor and associated editors.
*
* @see org.eclipse.jdt.internal.debug.ui.propertypages.JavaBreakpointPage#createTypeSpecificEditors(org.eclipse.swt.widgets.Composite)
*/
@Override
protected void createTypeSpecificEditors(final Composite parent) throws CoreException {
setTitle("Line Breakpoint");
final IErlangBreakpoint breakpoint = getBreakpoint();
if (breakpoint.supportsCondition()) {
createConditionEditor(parent);
}
// if (breakpoint instanceof IJavaWatchpoint) {
// setTitle(PropertyPageMessages.JavaLineBreakpointPage_19);
// final IJavaWatchpoint watchpoint = (IJavaWatchpoint) getBreakpoint();
// final SelectionAdapter watchpointValidator = new SelectionAdapter() {
// @Override
// public void widgetSelected(final SelectionEvent e) {
// validateWatchpoint();
// }
// };
// createLabel(parent, PropertyPageMessages.JavaLineBreakpointPage_6);
// fEnabledButton.addSelectionListener(watchpointValidator);
// fFieldAccess = createCheckButton(parent,
// PropertyPageMessages.JavaLineBreakpointPage_7);
// fFieldAccess.setSelection(watchpoint.isAccess());
// fFieldAccess.addSelectionListener(watchpointValidator);
// fFieldModification = createCheckButton(parent,
// PropertyPageMessages.JavaLineBreakpointPage_8);
// fFieldModification.setSelection(watchpoint.isModification());
// fFieldModification.addSelectionListener(watchpointValidator);
// }
// if (breakpoint instanceof IJavaMethodBreakpoint) {
// setTitle(PropertyPageMessages.JavaLineBreakpointPage_20);
// final IJavaMethodBreakpoint methodBreakpoint =
// (IJavaMethodBreakpoint) getBreakpoint();
// final SelectionAdapter methodBreakpointValidator = new
// SelectionAdapter() {
// @Override
// public void widgetSelected(final SelectionEvent e) {
// validateMethodBreakpoint();
// }
// };
// createLabel(parent, PropertyPageMessages.JavaLineBreakpointPage_9);
// fEnabledButton.addSelectionListener(methodBreakpointValidator);
// fMethodEntry = createCheckButton(parent,
// PropertyPageMessages.JavaLineBreakpointPage_10);
// fMethodEntry.setSelection(methodBreakpoint.isEntry());
// fMethodEntry.addSelectionListener(methodBreakpointValidator);
// fMethodExit = createCheckButton(parent,
// PropertyPageMessages.JavaLineBreakpointPage_11);
// fMethodExit.setSelection(methodBreakpoint.isExit());
// fMethodExit.addSelectionListener(methodBreakpointValidator);
// }
}
use of org.erlide.backend.debug.IErlangBreakpoint in project erlide_eclipse by erlang.
the class ErlangLineBreakpointPropertyPage method doStore.
// private Button fConditionIsTrue;
// private Button fConditionHasChanged;
// private Label fSuspendWhenLabel;
// // Watchpoint editors
// private Button fFieldAccess;
// private Button fFieldModification;
// // Method breakpoint editors
// private Button fMethodEntry;
// private Button fMethodExit;
@Override
protected void doStore() throws CoreException {
final IErlangBreakpoint breakpoint = getBreakpoint();
super.doStore();
if (fConditionEditor != null) {
final boolean enableCondition = fEnableConditionButton.getSelection();
final String condition = fConditionEditor.getCondition();
// final boolean suspendOnTrue = fConditionIsTrue.getSelection();
if (breakpoint.isConditionEnabled() != enableCondition) {
breakpoint.setConditionEnabled(enableCondition);
}
if (!condition.equals(breakpoint.getCondition())) {
breakpoint.setCondition(condition);
}
// if (breakpoint.isConditionSuspendOnTrue() != suspendOnTrue) {
// breakpoint.setConditionSuspendOnTrue(suspendOnTrue);
// }
}
// if (breakpoint instanceof IJavaWatchpoint) {
// final IJavaWatchpoint watchpoint = (IJavaWatchpoint) getBreakpoint();
// final boolean access = fFieldAccess.getSelection();
// final boolean modification = fFieldModification.getSelection();
// if (access != watchpoint.isAccess()) {
// watchpoint.setAccess(access);
// }
// if (modification != watchpoint.isModification()) {
// watchpoint.setModification(modification);
// }
// }
// if (breakpoint instanceof IJavaMethodBreakpoint) {
// final IJavaMethodBreakpoint methodBreakpoint =
// (IJavaMethodBreakpoint) getBreakpoint();
// final boolean entry = fMethodEntry.getSelection();
// final boolean exit = fMethodExit.getSelection();
// if (entry != methodBreakpoint.isEntry()) {
// methodBreakpoint.setEntry(entry);
// }
// if (exit != methodBreakpoint.isExit()) {
// methodBreakpoint.setExit(exit);
// }
// }
}
use of org.erlide.backend.debug.IErlangBreakpoint in project erlide_eclipse by erlang.
the class ErlangBreakpointPropertiesAction method selectionChanged.
/**
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
@Override
public void selectionChanged(final IAction action, final ISelection selection) {
if (selection instanceof IStructuredSelection) {
final IStructuredSelection ss = (IStructuredSelection) selection;
if (ss.isEmpty() || ss.size() > 1) {
return;
}
final Object element = ss.getFirstElement();
if (element instanceof IErlangBreakpoint) {
setBreakpoint((IErlangBreakpoint) element);
} else {
setBreakpoint(null);
}
}
}
use of org.erlide.backend.debug.IErlangBreakpoint in project erlide_eclipse by erlang.
the class ErlangBreakpointPropertiesRulerAction method update.
/**
* @see IUpdate#update()
*/
@Override
public void update() {
fBreakpoint = null;
final IBreakpoint breakpoint = getBreakpoint();
if (breakpoint instanceof IErlangBreakpoint) {
fBreakpoint = breakpoint;
}
setEnabled(fBreakpoint != null);
}
Aggregations