Search in sources :

Example 6 with TracePattern

use of org.erlide.tracing.core.mvc.model.TracePattern in project erlide_eclipse by erlang.

the class RemoveTracePatternHandler method execute.

@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
    final ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection();
    if (selection instanceof ITreeSelection) {
        final Object firstElement = ((ITreeSelection) selection).getFirstElement();
        if (firstElement instanceof IErlFunction) {
            final IErlFunction function = (IErlFunction) firstElement;
            final TracePattern tracePattern = new TracePattern(true);
            tracePattern.setFunctionName(function.getFunctionName());
            tracePattern.setModuleName(ErlangEngine.getInstance().getModelUtilService().getModule(function).getModuleName());
            tracePattern.setArity(function.getArity());
            TraceBackend.getInstance().removeTracePattern(tracePattern);
        }
    }
    return null;
}
Also used : ITreeSelection(org.eclipse.jface.viewers.ITreeSelection) IErlFunction(org.erlide.engine.model.erlang.IErlFunction) ISelection(org.eclipse.jface.viewers.ISelection) TracePattern(org.erlide.tracing.core.mvc.model.TracePattern)

Aggregations

TracePattern (org.erlide.tracing.core.mvc.model.TracePattern)6 ISelection (org.eclipse.jface.viewers.ISelection)4 ITreeSelection (org.eclipse.jface.viewers.ITreeSelection)4 IErlFunction (org.erlide.engine.model.erlang.IErlFunction)4 HashSet (java.util.HashSet)1 Set (java.util.Set)1 InputDialog (org.eclipse.jface.dialogs.InputDialog)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 LabelProvider (org.eclipse.jface.viewers.LabelProvider)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 RowData (org.eclipse.swt.layout.RowData)1 RowLayout (org.eclipse.swt.layout.RowLayout)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 MessageBox (org.eclipse.swt.widgets.MessageBox)1 ElementListSelectionDialog (org.eclipse.ui.dialogs.ElementListSelectionDialog)1 NodeLabelProvider (org.erlide.tracing.core.mvc.view.NodeLabelProvider)1 ProcessLabelProvider (org.erlide.tracing.core.mvc.view.ProcessLabelProvider)1