Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » remove palette context menu actions
remove palette context menu actions [message #248913] Tue, 12 May 2009 15:46 Go to next message
Eclipse UserFriend
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 #248937 is a reply to message #248913] Tue, 12 May 2009 23:51 Go to previous messageGo to next message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
What actions specifically?

markitus wrote:
> 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 #248942 is a reply to message #248937] Wed, 13 May 2009 07:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jxtamarc.gmail.com

Hi Ben ,

I'd like to remove specifically the 'customize' action. Any ideas on how
to proceed?

thanks!

El dia Tue, 12 May 2009 19:51:10 -0400, en/na Ben Vitale va escriure:

> What actions specifically?
>
> markitus wrote:
>> 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 #248972 is a reply to message #248942] Thu, 14 May 2009 01:06 Go to previous messageGo to next message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
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 #248986 is a reply to message #248972] Thu, 14 May 2009 15:18 Go to previous messageGo to next message
Eclipse UserFriend
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 10:31 Go to previous message
Dominic Hanlan is currently offline Dominic HanlanFriend
Messages: 98
Registered: July 2009
Member
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
Previous Topic:[Announce] GEF 3.5.0 I200905281631 is available
Next Topic:Editor (GraphicalEditorWithFlyoutPalette ) won't open
Goto Forum:
  


Current Time: Sat Apr 20 01:51:05 GMT 2024

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

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

Back to the top