[design] ViewStackPresentation question [message #537695] |
Thu, 03 June 2010 07:52  |
Eclipse User |
|
|
|
Hi,
I need to change the business design, because I need the context menu on the
editor's tab. Therefore I added the following code to
ViewStackPresentation.createPartButton():
....
if (getType().equals( PresentationFactory.KEY_EDITOR )) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
MenuManager mgr = new MenuManager();
mgr.add( ActionFactory.CLOSE.create( window ) );
mgr.add( ActionFactory.CLOSE_OTHERS.create( window ) );
mgr.add( ActionFactory.CLOSE_ALL.create( window ) );
mgr.add( new Separator() );
mgr.add( ActionFactory.NEW_EDITOR.create( window ) );
partButton.setMenu( mgr.createContextMenu( partButton ) );
}
....
This works well besides the fact, that the CLOSE_OTHERS question is always
disabled. And I don't know how to get this solved.
Can anyone help?
Thanks, Niels
|
|
|
|
|
|
Re: [design] ViewStackPresentation question [message #538330 is a reply to message #538260] |
Mon, 07 June 2010 07:51  |
Eclipse User |
|
|
|
Thanks Holger,
and if you could also have a look at Bug #312271, I would be very grateful.
I think there's a call to showPartButton() missing.
Thanks, Niels
"Holger Staudacher" <hstaudacher@eclipsesource.com> schrieb im Newsbeitrag
news:hui5ut$uhd$1@build.eclipse.org...
> Hi Niels,
> thanks for reporting the problem. We will address the bug soon.
>
> Regards Holger
>
> On 2010-06-04 15:55:47 +0200, "Niels Lippke" <niels.lippke@airpas.com>
> said:
>
>> Not sure about this one. Digging in the UI sources I come across
>> StandardEditorSystemMenu.java in which I find a different implementation
>> of the "closeOthers" action (SystemMenuCloseOthers). Either this is a
>> relict of older versions of eclipse or ActionFactory.CLOSE_OTHERS is not
>> intended to be used this way...
>>
>> Anyway, Bug #315766
>>
>> For me I also created a custom action to get it work.
>>
>> Thanks, Niels
>>
>>
>
>
> --
> -----------------------------------------
>
> http://eclipsesource.com
>
> http://twitter.com/eclipsesource
>
|
|
|
Powered by
FUDForum. Page generated in 3.13189 seconds