Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Context Menu
Context Menu [message #203233] Sun, 24 August 2008 15:42 Go to next message
Eclipse UserFriend
Originally posted by: andrestenorio.cable.net.co

Hello,

How do I customize the context menu for an editor in GMF? I want to remove
the default options and add some new features to work in my graphical
editor, but I cannot find what I have to change...

Thanks,

Andres Tenorio
Re: Context Menu [message #203242 is a reply to message #203233] Mon, 25 August 2008 02:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andrestenorio.cable.net.co

I solved the problem...

"Andres Tenorio" <andrestenorio@cable.net.co> wrote in message
news:g8rvh6$a67$1@build.eclipse.org...
> Hello,
>
> How do I customize the context menu for an editor in GMF? I want to remove
> the default options and add some new features to work in my graphical
> editor, but I cannot find what I have to change...
>
> Thanks,
>
> Andres Tenorio
Re: Context Menu [message #203248 is a reply to message #203242] Mon, 25 August 2008 04:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Hi! Andres,

How have you solved the problem, I am facing the same.

Moreover, could you please tell how to plug it(created editor) with with
exisating project?

Regards,
Manoj

Andres Tenorio wrote:
> I solved the problem...
>
> "Andres Tenorio" <andrestenorio@cable.net.co> wrote in message
> news:g8rvh6$a67$1@build.eclipse.org...
>
>> Hello,
>>
>> How do I customize the context menu for an editor in GMF? I want to
>> remove the default options and add some new features to work in my
>> graphical editor, but I cannot find what I have to change...
>>
>> Thanks,
>>
>> Andres Tenorio
>
>
Re: Context Menu [message #203270 is a reply to message #203248] Mon, 25 August 2008 09:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: martin.divbyzero.net

Manoj Mitra wrote:
> How have you solved the problem, I am facing the same.

This can be achieved using the extension point concept of plugins.xml.
See part 3 of the GMF Mindmap tutorial for an explanation.

Martin
Re: Context Menu [message #203292 is a reply to message #203270] Mon, 25 August 2008 11:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Thanks for your reply.

But, still I am unable to remove following menus-
Add, Navigate, Filters, Delete From Diagram/Model, Show Property View.

Regards,
Manoj

Martin Jansen wrote:
> Manoj Mitra wrote:
>
>> How have you solved the problem, I am facing the same.
>
>
> This can be achieved using the extension point concept of plugins.xml.
> See part 3 of the GMF Mindmap tutorial for an explanation.
>
> Martin
Re: Context Menu [message #203328 is a reply to message #203292] Mon, 25 August 2008 22:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andrestenorio.cable.net.co

Hi,

I solved part of the problem... I added new options in the context menu just
like part 3 of mindmap tutorial... but I'm still unable to remove default
options... I'm still looking for the answer.

Regards,

Andres


"Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
news:g8u59e$ia$1@build.eclipse.org...
> Thanks for your reply.
>
> But, still I am unable to remove following menus-
> Add, Navigate, Filters, Delete From Diagram/Model, Show Property View.
>
> Regards,
> Manoj
>
> Martin Jansen wrote:
>> Manoj Mitra wrote:
>>
>>> How have you solved the problem, I am facing the same.
>>
>>
>> This can be achieved using the extension point concept of plugins.xml.
>> See part 3 of the GMF Mindmap tutorial for an explanation.
>>
>> Martin
Re: Context Menu [message #204476 is a reply to message #203328] Fri, 05 September 2008 06:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Hi!

Have you found some way out?

Regards,
Manoj

Andres Tenorio wrote:
> Hi,
>
> I solved part of the problem... I added new options in the context menu
> just like part 3 of mindmap tutorial... but I'm still unable to remove
> default options... I'm still looking for the answer.
>
> Regards,
>
> Andres
>
>
> "Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
> news:g8u59e$ia$1@build.eclipse.org...
>
>> Thanks for your reply.
>>
>> But, still I am unable to remove following menus-
>> Add, Navigate, Filters, Delete From Diagram/Model, Show Property View.
>>
>> Regards,
>> Manoj
>>
>> Martin Jansen wrote:
>>
>>> Manoj Mitra wrote:
>>>
>>>> How have you solved the problem, I am facing the same.
>>>
>>>
>>>
>>> This can be achieved using the extension point concept of
>>> plugins.xml. See part 3 of the GMF Mindmap tutorial for an explanation.
>>>
>>> Martin
>
>
Re: Context Menu [message #204642 is a reply to message #204476] Sun, 07 September 2008 16:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andrestenorio.cable.net.co

Hi...

No, I haven't found a solution yet... I'm starting to think that there's no
way to delete the default context menu...

Regards,
Andres

"Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
news:48C0D395.2040803@blr.interrasystems.com...
> Hi!
>
> Have you found some way out?
>
> Regards,
> Manoj
>
> Andres Tenorio wrote:
>> Hi,
>>
>> I solved part of the problem... I added new options in the context menu
>> just like part 3 of mindmap tutorial... but I'm still unable to remove
>> default options... I'm still looking for the answer.
>>
>> Regards,
>>
>> Andres
>>
>>
>> "Manoj Mitra" <manojm@blr.interrasystems.com> wrote in message
>> news:g8u59e$ia$1@build.eclipse.org...
>>
>>> Thanks for your reply.
>>>
>>> But, still I am unable to remove following menus-
>>> Add, Navigate, Filters, Delete From Diagram/Model, Show Property View.
>>>
>>> Regards,
>>> Manoj
>>>
>>> Martin Jansen wrote:
>>>
>>>> Manoj Mitra wrote:
>>>>
>>>>> How have you solved the problem, I am facing the same.
>>>>
>>>>
>>>>
>>>> This can be achieved using the extension point concept of plugins.xml.
>>>> See part 3 of the GMF Mindmap tutorial for an explanation.
>>>>
>>>> Martin
>>
Re: Context Menu [message #206177 is a reply to message #204642] Mon, 22 September 2008 02:10 Go to previous messageGo to next message
Hoang Quach Dinh is currently offline Hoang Quach DinhFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,
I'm a new member.
I solved the problem.
We only need to modify method public void buildContextMenu(final
IMenuManager menu) of class
xxx.diagram.part.DiagramEditorContextMenuProvider.

public void buildContextMenu(final IMenuManager menu) {
getViewer().flush();
try {
TransactionUtil.getEditingDomain(
(EObject) getViewer().getContents().getModel())
.runExclusive(new Runnable() {

public void run() {
ContributionItemService
.getInstance()
.contributeToPopupMenu(
DiagramEditorContextMenuProvider.this,
part);
menu.remove(ActionIds.MENU_DIAGRAM_ADD);
menu.remove(ActionIds.MENU_NAVIGATE);
menu.remove(ActionIds.MENU_FILTERS);
menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
menu.remove(ActionIds.ACTION_DELETE_FROM_DIAGRAM);
menu.remove(ActionIds.ACTION_SHOW_PROPERTIES_VIEW);

}
});
} catch (Exception e) {
ResearchDiagramEditorPlugin.getInstance().logError(
"Error building context menu", e);
}
}

Hoang Quach Dinh.
Re: Context Menu [message #206214 is a reply to message #206177] Mon, 22 September 2008 07:44 Go to previous messageGo to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hi,
I'm also trying to modify the context menu,but I can't find the
buildContextMenu() function and not even the
DiagramEditorContextMenuProvider in the xxx.diagram.part?
Do I need to create this .java file by myself?


Thanks!


Ye








Hoang Quach Dinh wrote:

> Hi,
> I'm a new member.
> I solved the problem.
> We only need to modify method public void buildContextMenu(final
> IMenuManager menu) of class
> xxx.diagram.part.DiagramEditorContextMenuProvider.

> public void buildContextMenu(final IMenuManager menu) {
> getViewer().flush();
> try {
> TransactionUtil.getEditingDomain(
> (EObject) getViewer().getContents().getModel())
> .runExclusive(new Runnable() {

> public void run() {
> ContributionItemService
> .getInstance()
> .contributeToPopupMenu(
> DiagramEditorContextMenuProvider.this,
> part);
> menu.remove(ActionIds.MENU_DIAGRAM_ADD);
> menu.remove(ActionIds.MENU_NAVIGATE);
> menu.remove(ActionIds.MENU_FILTERS);
> menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
> menu.remove(ActionIds.ACTION_DELETE_FROM_DIAGRAM);
> menu.remove(ActionIds.ACTION_SHOW_PROPERTIES_VIEW);

> }
> });
> } catch (Exception e) {
> ResearchDiagramEditorPlugin.getInstance().logError(
> "Error building context menu", e);
> }
> }

> Hoang Quach Dinh.Hi,
I'm also trying to modify the context menu,but I can't find the
buildContext function in the xxx.Diagram.part.
Re: Context Menu [message #206221 is a reply to message #206214] Mon, 22 September 2008 10:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Hi!

Me too, have the same query.
Please suggest us.

Regards,
Manoj

ye wrote:
> Hi,
> I'm also trying to modify the context menu,but I can't find the
> buildContextMenu() function and not even the
> DiagramEditorContextMenuProvider in the xxx.diagram.part?
> Do I need to create this .java file by myself?
>
>
> Thanks!
>
>
> Ye
>
>
>
>
>
>
>
> Hoang Quach Dinh wrote:
>
>> Hi,
>> I'm a new member.
>> I solved the problem.
>> We only need to modify method public void buildContextMenu(final
>> IMenuManager menu) of class
>> xxx.diagram.part.DiagramEditorContextMenuProvider.
>
>
>> public void buildContextMenu(final IMenuManager menu) {
>> getViewer().flush();
>> try {
>> TransactionUtil.getEditingDomain(
>> (EObject) getViewer().getContents().getModel())
>> .runExclusive(new Runnable() {
>
>
>> public void run() {
>> ContributionItemService
>> .getInstance()
>> .contributeToPopupMenu(
>>
>> DiagramEditorContextMenuProvider.this,
>> part);
>> menu.remove(ActionIds.MENU_DIAGRAM_ADD);
>> menu.remove(ActionIds.MENU_NAVIGATE);
>> menu.remove(ActionIds.MENU_FILTERS);
>>
>> menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
>>
>> menu.remove(ActionIds.ACTION_DELETE_FROM_DIAGRAM);
>>
>> menu.remove(ActionIds.ACTION_SHOW_PROPERTIES_VIEW);
>
>
>> }
>> });
>> } catch (Exception e) {
>> ResearchDiagramEditorPlugin.getInstance().logError(
>> "Error building context menu", e);
>> }
>> }
>
>
>> Hoang Quach Dinh.Hi,
>
> I'm also trying to modify the context menu,but I can't find the
> buildContext function in the xxx.Diagram.part.
>
Re: Context Menu [message #206413 is a reply to message #206221] Tue, 23 September 2008 08:03 Go to previous messageGo to next message
Hoang Quach Dinh is currently offline Hoang Quach DinhFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

Ah, when you xxx.gmfgem from xxx.gmfmap you should check in RCP in GMF
Dashboard (I suppose you generate xxx.gmfgen by GMF Dashboard).

Hoang Quach Dinh.
Re: Context Menu [message #206421 is a reply to message #206413] Tue, 23 September 2008 08:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Hi!

Without creating RCP, I have built the Editor.
In that regard, how should I do that?

Regards,
Manoj


Hoang Quach Dinh wrote:
> Hi,
>
> Ah, when you xxx.gmfgem from xxx.gmfmap you should check in RCP in GMF
> Dashboard (I suppose you generate xxx.gmfgen by GMF Dashboard).
>
> Hoang Quach Dinh.
>
>
Re: Context Menu [message #206521 is a reply to message #206421] Tue, 23 September 2008 10:22 Go to previous messageGo to next message
Hoang Quach Dinh is currently offline Hoang Quach DinhFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,


If you don't check in RCP you can insert extension to plugin.xml. See at:
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg13235.html.

About id of popupPredefinedItem, see at class
org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds.

Hoang Quach Dinh.
Re: Context Menu [message #206688 is a reply to message #206521] Wed, 24 September 2008 06:49 Go to previous message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

I did the same, but not getting the desired output.

Regards,
Manoj

Hoang Quach Dinh wrote:
> Hi,
>
>
> If you don't check in RCP you can insert extension to plugin.xml. See
> at:
> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg13235.html.
>
> About id of popupPredefinedItem, see at class
> org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds.
>
> Hoang Quach Dinh.
>
Previous Topic:setConnectionAnchor when collapsing container
Next Topic:How to remove DiagramModelingAssistantProvider contributions
Goto Forum:
  


Current Time: Fri Apr 19 05:22:21 GMT 2024

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

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

Back to the top