Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Different custom presentations for different sites
Different custom presentations for different sites [message #521304] Wed, 17 March 2010 08:36 Go to next message
Andrei Lissovski is currently offline Andrei Lissovski
Messages: 13
Registered: July 2009
Junior Member
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 08:42 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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


Re: Different custom presentations for different sites [message #521640 is a reply to message #521392] Thu, 18 March 2010 11:27 Go to previous message
Andrei Lissovski is currently offline Andrei Lissovski
Messages: 13
Registered: July 2009
Junior Member
Thanks a lot Paul! The combination of IFolderLayout.setProperty() in the perspective and IStackPresentationSite.getProperty() in the presentation factory is exactly what I was looking for.
Previous Topic:ACTION_ARRANGE_ALL: how to execute it from custom Action?
Next Topic:RCP Classes Apr. 12-May 28
Goto Forum:
  


Current Time: Sat Oct 25 00:46:10 GMT 2014

Powered by FUDForum. Page generated in 0.01850 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software