Search in sources :

Example 1 with IErlangBreakpoint

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();
}
Also used : IWorkspaceRunnable(org.eclipse.core.resources.IWorkspaceRunnable) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IErlangBreakpoint(org.erlide.backend.debug.IErlangBreakpoint) CoreException(org.eclipse.core.runtime.CoreException)

Example 2 with IErlangBreakpoint

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);
// }
}
Also used : IErlangBreakpoint(org.erlide.backend.debug.IErlangBreakpoint)

Example 3 with IErlangBreakpoint

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);
// }
// }
}
Also used : IErlangBreakpoint(org.erlide.backend.debug.IErlangBreakpoint)

Example 4 with IErlangBreakpoint

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);
        }
    }
}
Also used : IErlangBreakpoint(org.erlide.backend.debug.IErlangBreakpoint) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 5 with IErlangBreakpoint

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);
}
Also used : IErlangBreakpoint(org.erlide.backend.debug.IErlangBreakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint)

Aggregations

IErlangBreakpoint (org.erlide.backend.debug.IErlangBreakpoint)8 IBreakpoint (org.eclipse.debug.core.model.IBreakpoint)2 IMarker (org.eclipse.core.resources.IMarker)1 IWorkspaceRunnable (org.eclipse.core.resources.IWorkspaceRunnable)1 CoreException (org.eclipse.core.runtime.CoreException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IBreakpointManager (org.eclipse.debug.core.IBreakpointManager)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Group (org.eclipse.swt.widgets.Group)1 ErlangLineBreakpoint (org.erlide.backend.debug.ErlangLineBreakpoint)1