Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] ContentOutlinePage - help?


call super.createControl(parent) to create the treeViewer,
then TreeViewer viewer = getTreeViewer() will return the viewer.
See the readme example.

This type of question is usually asked on the newsgroup with this list used for development issues.
       


Mike.McGowan@xxxxxxxxxx
Sent by: platform-ui-dev-admin@xxxxxxxxxxx

04/29/2002 10:24 AM
Please respond to platform-ui-dev

       
        To:        platform-ui-dev@xxxxxxxxxxx
        cc:        
        Subject:        [platform-ui-dev] ContentOutlinePage - help?


Trying to create a new Outliner for a custom editor.  Here is the relevant
code snippet from createControl in a class that is a subClass of
ContentOutlinePage
================================
     public void createControl(Composite parent)
     {
           parent.setLayout(new FillLayout());
           viewer = new TreeViewer(parent, SWT.MULTI);

           //TreeViewer viewer = getTreeViewer();
           drillDownAdapter = new DrillDownAdapter(viewer);
           viewer.setContentProvider(new ViewContentProvider());
           viewer.setLabelProvider(new ViewLabelProvider());
           viewer.setSorter(new NameSorter());
           viewer.setInput(ResourcesPlugin.getWorkspace());

     }
==========================================

With the code as shown, I get my tree view display in the "right hand" half
of the outline window.  Commenting out the setLayout yields shows nothing.
As does commenting out the creation of the TreeViewer in the next line and
trying to access the "internally created TreeViewer" documented in the
ContentOutlinePage.  Has Eclipse already created a TreeViewer that I should
be using or do I need to create one?  Any help would be appreciated.

Mike McGowan
mike.mcgowan@xxxxxxxxxx


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev



Back to the top