IFolderLayout - All Views shall be created at application startup [message #666196] |
Tue, 19 April 2011 08:45  |
Eclipse User |
|
|
|
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 09:05   |
Eclipse User |
|
|
|
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 02:49  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.07813 seconds