remove palette context menu actions [message #248913] |
Tue, 12 May 2009 11:46  |
Eclipse User |
|
|
|
Originally posted by: jxtamarc.gmail.com
Hi there,
after upgrading my GEF plugins to the newest versions and
regenerating the diagram code, I've noticed that some actions have been
added to the context menu of my palette (right-clicking on the palette).
I'd like to remove some of them.
I've been investigating my plugins.xml file for a while but it seems to
me that these changes must be applied somewhere else.
does anyone know how to disable/remove these actions?
thanks in advance!
|
|
|
|
|
|
Re: remove palette context menu actions [message #248986 is a reply to message #248972] |
Thu, 14 May 2009 11:18   |
Eclipse User |
|
|
|
Originally posted by: jxtamarc.gmail.com
Hello,
after several hours struggling against the palette I finally found the
light to take out the context menu associated to it. I've decided to
remove all the actions since in my opinion they weren't pretty useful. In
order to do so, I've overriden the createPartControl(composite parent)
function, which belongs to the class
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.
I did this in a class extending from this. I've overriden it as follows:
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
//we get the palette. It has to be done after the
operation createPartControl, otherwise the viewer is null
PaletteViewer viewer = super.getEditDomain
().getPaletteViewer();
//removes the context menu
viewer.getContextMenu().dispose();
}
Hope it helps !
Thanks Ben for your suggestion, which it definitely showed me the way to
get here.
El dia Wed, 13 May 2009 21:06:32 -0400, en/na Ben Vitale va escriure:
> Some poking around seems to indicate that you can specify a palette
> customizer for a given palette viewer. It looks like that customize
> action is only added to the menu if a customizer is set. You could call
> PaletteViewer#setCustomizer(null).
>
> HTH,
> Ben
>
> markitus wrote:
>> Hi Ben ,
>>
>> I'd like to remove specifically the 'customize' action. Any ideas on
>> how to proceed?
>>
>> thanks!
|
|
|
Re: remove palette context menu actions [message #249121 is a reply to message #248986] |
Wed, 03 June 2009 06:31  |
Eclipse User |
|
|
|
In relation to this topic I would like add to the context menu.
I have tried the following
MenuManager menu = getEditDomain().getPaletteViewer().getContextMenu();
GroupMarker marker = new GroupMarker("Test");
menu.add(marker);
menu.appendToGroup("Test", getActionRegistry().getAction(TestAction.ID));
To no avail ... the context menu is unchanged! Any suggestions!
/Dominic
|
|
|
Powered by
FUDForum. Page generated in 0.04860 seconds