Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » IFolderLayout - All Views shall be created at application startup
IFolderLayout - All Views shall be created at application startup [message #666196] Tue, 19 April 2011 12:45 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 3
Registered: April 2011
Junior Member
Hi,

I have put two views inside an IFolderLayout. Both views are SelectionListeners to the Selection Service of the IWorkbenchPage.

When my application starts, only the view which is on top in the IFolderLayout receives an Selection event, and executes its selectionChanged(...) method. Obviously the hide view is not created, but I would like to make sure, that on startup all views in the IFolderLayout are created, and react on the Selection event. How to do this?

The idea is, that based on a selection in a view outside the IFolderLayout, all views inside the IFolderLayout do some job, for example load and show data in tables or similar tasks.

It would be cumbersome, for example having five or more views in an IFolderLayout, having to click on each of the tabs of the hidden views manually to make them work and able to receive Selection events.

Regards
Re: IFolderLayout - All Views shall be created at application startup [message #666202 is a reply to message #666196] Tue, 19 April 2011 13:05 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 04/19/2011 08:45 AM, nebojsa.lazic@gmx.de wrote:
The idea is, that based on a selection in a view outside the
> IFolderLayout, all views inside the IFolderLayout do some job, for
> example load and show data in tables or similar tasks.
> It would be cumbersome, for example having five or more views in an
> IFolderLayout, having to click on each of the tabs of the hidden views
> manually to make them work and able to receive Selection events.

Arguably, if the views aren't visible, then they shouldn't be doing
anything. That's just chewing up computational cycles for nothing.

When they are first instantiated they can get the current selection (so
they're in the correct state) and then add their selection listener for
future events.

But in an RCP app, you could use your WorkbenchWindowAdvisor postRestore
to instantiate the views using IWorkbenchPage#showView(*) with the
VIEW_CREATE flag.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: IFolderLayout - All Views shall be created at application startup [message #666358 is a reply to message #666202] Wed, 20 April 2011 06:49 Go to previous message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 3
Registered: April 2011
Junior Member
As of the slightly different nameing I assume that you meant the following:

In

public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {


I added the method

public void postWindowRestore() throws WorkbenchException {


to override it from WorkbenchWindowAdvisor.

Within this method I added a System.out.println and a Breakpoint, but it was never executed while my RCP application was up and running.

Further, how to access the WorkbenchPage object from within this method to call showView on it?

Regards
Previous Topic:JVM terminated.Exit code=-2147483647
Next Topic:Start eclipse on Windows 7
Goto Forum:
  


Current Time: Sat Dec 20 03:49:44 GMT 2014

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

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