by ktingle » Tue Oct 12, 2004 6:13 am
In case someone could use the help I will respond with what I found:
Insode your IEditorPart implementation, override the getAdapter() method.
public Object getAdapter(Class adapter) {
if (adapter == IContentOutlinePage.class) {
return new MyOutline();
}
return null;
}
Simplest way to implement IContentOutlinePage is to extend ContentOutlinePage.
class MyOutline extends ContentOutlinePage {...
Override the createControl() in your outline class and make sure to call the superclass version first so the treeviewer is created.
public void createControl(Composite parent) {
// Create the tree
super.createControl(parent);
// Content provider
if (getTreeViewer() != null) {
TreeViewer treeViewer = getTreeViewer();
Rest is just SWT treeviewer work, very simple to do this really., suprised no books cover this.