3

I'm very new to RCP and I want to build a window with a TreeViewer as a menu on the left and views on the right. When clicking on a TreeItem the current view should be replaced with the new page. The Views shall not be moveable or closeable.

The menu works fine so far but I can't get the views to act like I want.

I tried using a Placeholder within my perspective:

layout.addStandaloneViewPlaceholder("gui.page:*", IPageLayout.TOP, 0.5f, editorArea, false);

The IDs of the views all start with gui.page... When I add one of the pages as standaloneView to the perspective it looks just as I want it. But when I add a View by calling

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(pageID);

in the listener of the TreeViewer, the Pages get tabbed and are move- and closeable.

A good example of what I want to have is the preferences dialog of eclipse. I searched in the eclipse source but I couldn't find the way they made it.

Any suggestions on how to make this?

MatF
  • 1,728
  • 2
  • 14
  • 31

1 Answers1

1

Views won't get replaced. So you have to hide the previous view by calling IWorkbenchPage.hideView()

Prakash G. R.
  • 4,746
  • 1
  • 24
  • 35
  • 2
    Thanks for your help. I got another tip from a workmate which I will use. Instead of placing my different pages in views, they are now different composites inside a single view with a stacklayout. Works just fine :) – MatF Apr 29 '11 at 08:47