Search in sources :

Example 1 with TaskInfo

use of abs.backend.java.debugging.TaskInfo in project abstools by abstools.

the class DebugView method createViewer.

@Override
protected Viewer createViewer(Composite parent) {
    final TreeViewer viewer = new TreeViewer(parent);
    viewer.setContentProvider(new DebugTreeContentProvider());
    viewer.setLabelProvider(new DebugTreeStyledLabelProvider());
    viewer.setInput(debugger.getModel());
    viewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            refreshButtonEnablement();
            Object selection = ((IStructuredSelection) event.getSelection()).getFirstElement();
            if (selection instanceof TaskView || selection instanceof ObjectView || selection instanceof TaskStackFrameView) {
                refreshVariableView();
                if (selection instanceof TaskView) {
                    TaskView tv = (TaskView) selection;
                    TaskInfo taskInfo = getDebugger().getModel().getTaskInfo(tv);
                    highlightLine(taskInfo);
                }
            }
            getSchedulerRef().taskSelectionChanged(selection);
        }
    });
    viewer.addDoubleClickListener(new IDoubleClickListener() {

        @Override
        public void doubleClick(DoubleClickEvent event) {
            Object selection = ((IStructuredSelection) event.getSelection()).getFirstElement();
            if (selection instanceof ObjectView || selection instanceof TaskStackFrameView) {
                openVariableView();
                refreshVariableView();
            } else {
                viewer.setExpandedState(selection, !viewer.getExpandedState(selection));
            }
        }
    });
    viewer.expandAll();
    return viewer;
}
Also used : TaskView(abs.backend.java.observing.TaskView) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) ObjectView(abs.backend.java.observing.ObjectView) TaskStackFrameView(abs.backend.java.observing.TaskStackFrameView) TaskInfo(abs.backend.java.debugging.TaskInfo) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener)

Aggregations

TaskInfo (abs.backend.java.debugging.TaskInfo)1 ObjectView (abs.backend.java.observing.ObjectView)1 TaskStackFrameView (abs.backend.java.observing.TaskStackFrameView)1 TaskView (abs.backend.java.observing.TaskView)1 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1