Different custom presentations for different sites [message #521304] |
Wed, 17 March 2010 04:36  |
Eclipse User |
|
|
|
Hi,
I need to have different custom presentations for different sites in my RCP application. For example, I want to customize the appearance of the view tabs for views in one view folder, hide tabs altogether for views in another folder, have yet another way of presenting a fast view.
It appears that the best way of going about this is to furnish a desired instance of a custom presentation in the createViewPresentation(Composite parent, IStackPresentationSite site) of my custom presentation factory (a subclass of WorkbenchPresentationFactory). I assume the reason this API method has a site on it is to cover my use case. However, with the site instance provided with this call at runtime, I don't see any way of getting at any info that would let me decide which site a presentation is being created for. At the time of the invocation, site.getPartList() returns an empty array; I can't get to the view stack id either. How can this be accomplished?
I have to develop this application against the 3.3 version of the platform.
Thanks a lot!
|
|
|
Re: Different custom presentations for different sites [message #521392 is a reply to message #521304] |
Wed, 17 March 2010 04:42   |
Eclipse User |
|
|
|
A lot of what you want is determined in the perspective. i.e.
standalone view with no tabs/title, creating a view as a fast view, etc.
How the views are stacked together (CTabFolder or some other widget) is
controlled by the presentation, so if you want to customize the tabs in
a stack, you are correct, you'd have to overwrite it.
To pass information from the perspective to the presentation, you can
customize both a part and a folder/stack. So for your case where you
want to customize one set of view tabs, when you create your perspective
you would create a folder and get the IFolderLayout, and then call
setProperty(String id, String value) on it. Then use
org.eclipse.ui.presentations.IStackPresentationSite.getPrope rty(String)
to get the property when creating that stack.
Later,
PW
--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
|
|
|
|
Powered by
FUDForum. Page generated in 1.04721 seconds