Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Get the shell
Get the shell [message #268364] Fri, 06 February 2009 18:54 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Hi, I'm playing around with the JFace dialogs. The following line
produces a 'discouraged access' warning, so I guess I'm messing around
with something:

Shell shell = Workbench.getInstance().getDisplay().getActiveShell();

Maybe there's a better way?

Felix
Re: Get the shell [message #268373 is a reply to message #268364] Fri, 06 February 2009 23:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 2/6/2009 1:54 PM, Felix Dorner wrote:
> Hi, I'm playing around with the JFace dialogs. The following line
> produces a 'discouraged access' warning, so I guess I'm messing around
> with something:
>
> Shell shell = Workbench.getInstance().getDisplay().getActiveShell();
>
> Maybe there's a better way?

The Workbench class is in an internal package and should not be accessed
directly. The correct (API) way to get a reference to the Workbench
isntance is via org.eclipse.ui.PlatformUI.getWorkbench().

Hope this helps,
Eric
Re: Get the shell [message #268380 is a reply to message #268373] Sat, 07 February 2009 16:41 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Hi Eric,

yeah this helps of course. I also found that getSite().getShell() would
work.

> The Workbench class is in an internal package and should not be accessed
> directly. The correct (API) way to get a reference to the Workbench
> isntance is via org.eclipse.ui.PlatformUI.getWorkbench().

Felix
Previous Topic:Adding "USER DEFINED" VIEWS in Eclipse Workbench
Next Topic:"Open" - "Close" Projects in Eclipse
Goto Forum:
  


Current Time: Tue Jul 16 10:06:33 GMT 2024

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

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

Back to the top