Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:28 Go to next message
exquisitus is currently offline exquisitusFriend
Messages: 18
Registered: July 2009
Junior Member
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 05:21 Go to previous messageGo to next message
Prathibha is currently offline PrathibhaFriend
Messages: 12
Registered: July 2009
Junior Member
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 07:51 Go to previous messageGo to next message
paolo russian is currently offline paolo russianFriend
Messages: 81
Registered: July 2009
Member
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 08:35 Go to previous messageGo to next message
exquisitus is currently offline exquisitusFriend
Messages: 18
Registered: July 2009
Junior Member
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 09:03 Go to previous message
exquisitus is currently offline exquisitusFriend
Messages: 18
Registered: July 2009
Junior Member
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: Thu Apr 25 23:45:38 GMT 2024

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

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

Back to the top