Skip to main content



      Home
Home » Modeling » EMF » Simple Modification of generated EMF editor
Simple Modification of generated EMF editor [message #398548] Tue, 14 February 2006 16:09 Go to next message
Eclipse UserFriend
Hi,
I'm trying to make a simple modification to the generated EMF editor, all
I want to do is add some context menu actions for a couple of my EMF
classes when right-clicked in the default editor. I've made context
contributions in the past by using the eclipse.popup menu extension point.
However this does not seem like the right approach. I also looked through
the generated editor/edit code but am a little intimidated by it all
(in-fact still having nightmares). Can anyone give me some suggestions as
to how I can go about adding my actions to the context menu without having
to make a lot of modifications? - Duncan
Re: Simple Modification of generated EMF editor [message #398551 is a reply to message #398548] Tue, 14 February 2006 16:50 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------080506030504010809020701
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Duncan,

We use popups like this in org.eclipse.emf.ecore.editor/plugin.xml:

<extension point="org.eclipse.ui.popupMenus">
<objectContribution id="org.eclipse.emf.ecore.editor.Open"
objectClass="org.eclipse.core.resources.IFile">
<menu id="org.eclipse.emf.ecore.editor.Open"
label="%_UI_OpenAs_menu_item" path="org.eclipse.ui.OpenWithSubMenu">
<separator name="additions" />
</menu>

<action
id="org.eclipse.emf.ecore.editor.OpenXMLReflectiveEditorAction "
label="%_UI_EMFXML_menu_item"
menubarPath="org.eclipse.emf.ecore.editor.Open/additions"
class="org.eclipse.emf.ecore.action.OpenEditorAction" enablesFor="1">
</action>

<action
id="org.eclipse.emf.ecore.editor.OpenReflectiveEditorAction "
label="%_UI_EMFXMI_menu_item"
menubarPath="org.eclipse.emf.ecore.editor.Open/additions"
class="org.eclipse.emf.ecore.action.OpenEditorAction" enablesFor="1">
</action>
</objectContribution>

<objectContribution
id="org.eclipse.emf.ecore.editor.CreateDynamicInstance"
objectClass="org.eclipse.emf.ecore.EClass">
<action
id="org.eclipse.emf.ecore.editor.CreateDynamicInstanceAction "
label="%_UI_CreateDynamicInstance_menu_item" menubarPath="additions"
class="org.eclipse.emf.ecore.action.CreateDynamicInstanceAction "
enablesFor="1">
</action>
</objectContribution>
</extension>

It's a simple way. Why don't you think it's the right approach in your
case?

Duncan Krebs wrote:
> Hi, I'm trying to make a simple modification to the generated EMF
> editor, all I want to do is add some context menu actions for a couple
> of my EMF classes when right-clicked in the default editor. I've made
> context contributions in the past by using the eclipse.popup menu
> extension point. However this does not seem like the right approach. I
> also looked through the generated editor/edit code but am a little
> intimidated by it all (in-fact still having nightmares). Can anyone
> give me some suggestions as to how I can go about adding my actions to
> the context menu without having to make a lot of modifications? - Duncan
>
>


--------------080506030504010809020701
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Duncan,<br>
<br>
We use popups like this in org.eclipse.emf.ecore.editor/plugin.xml:<br>
<blockquote><small>
Re: Simple Modification of generated EMF editor [message #398554 is a reply to message #398551] Tue, 14 February 2006 17:35 Go to previous message
Eclipse UserFriend
Ed thanks,
Not sure what I missed the first time but I followed through the example
you gave me and got it working. - Duncan
Previous Topic:Change method signature, leave method body untouched
Next Topic:Custum path to the images
Goto Forum:
  


Current Time: Wed Nov 05 15:19:42 EST 2025

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

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

Back to the top