Discouraged access for the use of WorkbenchWindow [message #747844] |
Mon, 24 October 2011 06:11  |
Eclipse User |
|
|
|
Hi,
I am using Eclipse IDE 3.7 for my RCP application.
In the application I am trying to use the WorkbenchWindow class from a file. I am coming accross the below mentioned warning:
Discouraged access: The type WorkbenchWindow is not accessible due to restriction on required project org.eclipse.ui.workbench_3.7.0.120110519
I have imported org.eclipse.ui.internal.WorkbenchWindow.
Please suggest for pointers, if any to resolve this warning.
Thanks in Advance,
Ajinkya
|
|
|
|
|
Re: Discouraged access for the use of WorkbenchWindow [message #749870 is a reply to message #749819] |
Tue, 25 October 2011 09:39  |
Eclipse User |
|
|
|
On 2011-10-25 15:10, Ajinkya wrote:
> Hi Daniel,
> Thanks for your reply.
> To be precise, I required the WorkbenchWindow for obtaining MenuManager.
> There is no getMenuManager method provided by IWorkbenchWindow.
> Is there any other alternative, apart from WorkbenchWindow to access the
> MenuManager?
> I am still looking out for some resolution. Please help.
Why should you need the menu manager in a "global" context? You get it
provided at the places where you need it, e.g. in your ActionBarAdvisor
implementation. If you really need it elsewhere you could store a
reference in you ActionBarAdvisor implementation and could make this
globally available by whichever means of the language you like. But I
don't recommend this approach. I would recommend to hold in for a moment
and would ask myself, whether I really need this global variable. I
never missed the lack of it, I always use the manager from the local
context that provides it to me, e.g. in a view part you have access to
the view site and via this site you get getActionBars() which again
provides the menu manager to you.
HTH & Greetings from Bremen,
Daniel Krügler
|
|
|
Powered by
FUDForum. Page generated in 0.24471 seconds