Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Remove cut/copy/paste from Popup
Remove cut/copy/paste from Popup [message #209216] Wed, 22 October 2008 11:28 Go to next message
Eclipse UserFriend
Hi all,

I use GMF 2.0 with Eclipse Europa 3.3.

I didn't found how to remove the actions "cut"/"copy"/"paste" from the
popup menu. I know how to remove "deleteFromModel" and "deleteFromDiagram"
like this :

<popupContribution
class=" org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextM enuProvider ">
<popupStructuredContributionCriteria objectClass="MyEditPart"/>
<popupPredefinedItem id="deleteFromDiagramAction"
remove="true"/>
<popupPredefinedItem id="deleteFromModelAction"
remove="true"/>
</popupContribution>

But what must I specify for actions in sub-menu ?

Regards,
Sylvain
Re: Remove cut/copy/paste from Popup [message #209251 is a reply to message #209216] Thu, 23 October 2008 01:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi Sylvain,
comment the cut,copy,paste from you plugin.xml.Hope this solves your
problem.

<ElementType
class=" org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditP art ">
<!-- <GlobalActionId actionId="cut"/>
<GlobalActionId actionId="copy"/>
<GlobalActionId actionId="paste"/> -->
</ElementType>


regards,
Prathibha
Re: Remove cut/copy/paste from Popup [message #209267 is a reply to message #209251] Thu, 23 October 2008 03:51 Go to previous messageGo to next message
Eclipse UserFriend
Prathibha ha scritto:
> Hi Sylvain,
> comment the cut,copy,paste from you plugin.xml.Hope this solves your
> problem.
>
> <ElementType
> class=" org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditP art ">
> <!-- <GlobalActionId actionId="cut"/>
> <GlobalActionId actionId="copy"/>
> <GlobalActionId actionId="paste"/> -->
> </ElementType>
>
>
> regards,
> Prathibha
>

Hi there, what is the best practice to override these actions? In our
application there's the need to copy & paste an item, and since our
application transforms gmf diagrams in seam web pages via jetemitters,
we provide a objecttype_[timestamp] as node id when one creates an item,
to avoid duplicate id in the webpages.
But happens that if you copy & paste an item these id remain the same
,avoiding somehow the overriden "on creation event" method of the
corresponding
node that would place a new timestamp.
Debugging leads me into thread, runnable methods far away, so where is
the right place to look for me to intercept the "on paste event" method?

Regards

Paolo
Re: Remove cut/copy/paste from Popup [message #209275 is a reply to message #209251] Thu, 23 October 2008 04:35 Go to previous messageGo to next message
Eclipse UserFriend
Thanks you Prathibha for your answer.

Your solution allows to disable actions in the contextual menu.

BUT, is there a way to remove these actions from the contextual menu ?
like I can do with "deleteFromModel" for example.

More generally, I would like to control the content of the contextual menu.
Re: Remove cut/copy/paste from Popup [message #209293 is a reply to message #209275] Thu, 23 October 2008 05:03 Go to previous message
Eclipse UserFriend
I have found !

All predefined items can be found in the plugin.xml of
org.eclipse.gmf.runtime.diagram.ui.providers plugin.

So I was able to remove "cut" action for exemple like this :

<popupPredefinedItem id="cut" path="/editMenu/copyGroup" remove="true"/>

Sylvain
Previous Topic:How to create link and node at the same time
Next Topic:Synchronization between editors
Goto Forum:
  


Current Time: Wed Jul 23 15:46:09 EDT 2025

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

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

Back to the top