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;
}
Aggregations