use of org.python.pydev.shared_ui.quick_outline.DataAndImageTreeNodeContentProvider in project Pydev by fabioz.
the class HierarchyViewer method createPartControl.
public void createPartControl(Composite parent) {
this.fParent = parent;
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.verticalSpacing = 2;
layout.marginWidth = 0;
layout.marginHeight = 2;
parent.setLayout(layout);
sash = new SashForm(parent, SWT.VERTICAL);
GridData layoutData = new GridData();
layoutData.grabExcessHorizontalSpace = true;
layoutData.grabExcessVerticalSpace = true;
layoutData.horizontalAlignment = GridData.FILL;
layoutData.verticalAlignment = GridData.FILL;
sash.setLayoutData(layoutData);
parent = sash;
treeClassesViewer = new TreeViewer(parent);
treeClassesViewer.setContentProvider(new DataAndImageTreeNodeContentProvider());
treeClassesViewer.setLabelProvider(createLabelProvider());
treeClassesViewer.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
ISelection selection = event.getSelection();
handleSelection(selection, 2);
}
});
treeClassesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
handleSelection(selection, 1);
}
});
treeMembers = new Tree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
treeMembers.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
TreeItem[] selection = treeMembers.getSelection();
if (selection.length > 0) {
Object data = selection[0].getData();
ItemPointer p = (ItemPointer) data;
if (p != null) {
new PyOpenAction().run(p);
}
}
}
});
}
Aggregations