Outline View Support

Tell us what you think about our book and report any errata. Sample chapters are available at http://www.qualityeclipse.com/

(Note: Previous Editions were called "Eclipse: Building Commercial Quality Plugins")

Moderators: Eric Clayberg, Dan Rubel

Outline View Support

Postby ktingle » Mon Oct 11, 2004 7:12 am

I have built a simple editor plug-in for one of my companies proprietary file formats.

It works nicely but I would like to utilize the Outline window. Is there a special interface that my IEditorPart must implement to support the Outline View? How is this done?

Thanks in Advance,

Postby 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

// 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.

Postby dinu4u4ever » Wed Nov 08, 2006 4:37 am

hai... i have created a new editor and new view.... have to do similar action of breakpoint.... and add the editor atributes to my view.... can u pls guide me on this???thanks in advance
Posts: 3
Joined: Thu Nov 02, 2006 10:25 pm

Return to Book: Eclipse Plug-Ins (3rd Edition)

Who is online

Users browsing this forum: No registered users and 1 guest