Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to access active workbench page from a Facet?
How to access active workbench page from a Facet? [message #320240] Thu, 13 September 2007 20:42 Go to next message
Jean-Christophe Deprez is currently offline Jean-Christophe DeprezFriend
Messages: 133
Registered: July 2009
Senior Member
I'm trying to create a Project Facet to install components we've created
at my company into a Web project, to make it as simple to set up a project
to use our own app framework as it is to use Struts or JSF.

So what I want to do is when the Facet finishes running I want to open a
README file in an editor in the workspace so the developers see
instructions right in front of them that give them suggestions on what to
do next.

I can do this from a Wizard easily enough, but I can't figure out how to
do it from a Facet. The problem is, I need to have the active workbench
page. The normal method to get an active workbench page don't work
because the active workbench window is set to null. This is because a
dialog (the Facet wizard itself) has taken focus away from the window, As
far as I can see there is no way to know what the active window was before
the Facet Wizard dialog opened up.

Am I wrong about this? Is there some way within a Facet Install Delegate
to figure out what the active window was?

Thanks,

James Simmons
Re: How to access active workbench page from a Facet? [message #320317 is a reply to message #320240] Mon, 17 September 2007 11:49 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

While I don't know about the facet dialog specifically, in general
dialogs don't effect the active workbench window.

i.e. PlatformUI.getWorkbench().getActiveWorkbenchWindow() returns the
currently active workbench window even if it is not the currently active
SWT Shell.

It can return null, however, if it is not called from the UI thread. If
that's the case, use UIJob or display.asyncExec(*) to run your code on
the UI thread.

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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:using absolute url in href of topic elements of toc.xml
Next Topic:Schedule external tools launch?
Goto Forum:
  


Current Time: Thu Apr 25 14:45:09 GMT 2024

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

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

Back to the top