Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Avoiding Delete From Model/Delete from Diagram completely?(I need to avoid completely deletion of figures in my Diagram: is it possible?)
Avoiding Delete From Model/Delete from Diagram completely? [message #536941] Mon, 31 May 2010 15:24 Go to next message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi all,

I've implemented a custom GMF editor, in which I need to completely avoid deletion of figures (both from model and from diagram); I modified the default DeleteElementAction, adding a return UnexecutableCommand.INSTANCE; statement: it works (the items in popup menu are disabled), but I'm not able to avoid deletion by keyboard (DEL/BACKSPACE keystrokes).

Anyone has idea about that?

Thank you all

Regards,
Giovanni.
Re: Avoiding Delete From Model/Delete from Diagram completely? [message #537042 is a reply to message #536941] Tue, 01 June 2010 07:14 Go to previous messageGo to next message
Sven Krause is currently offline Sven KrauseFriend
Messages: 119
Registered: July 2009
Senior Member
Hi Giovanni,

I used the shouldProceed(DestroyRequest) method at the
SemanticEditPolicy and the createDeleteViewCommand(GroupRequest) at teh
ComponentEditPolicy preventing element deletion. But therefore I've used
custom templates extending the standard policies for all my affected
edit parts.

Sven

Am 31.05.2010 17:24, schrieb Giovanni:
> Hi all,
>
> I've implemented a custom GMF editor, in which I need to completely
> avoid deletion of figures (both from model and from diagram); I modified
> the default DeleteElementAction, adding a return
> UnexecutableCommand.INSTANCE; statement: it works (the items in popup
> menu are disabled), but I'm not able to avoid deletion by keyboard
> (DEL/BACKSPACE keystrokes).
>
> Anyone has idea about that?
>
> Thank you all
>
> Regards,
> Giovanni.
Re: Avoiding Delete From Model/Delete from Diagram completely? [message #537071 is a reply to message #537042] Tue, 01 June 2010 08:54 Go to previous message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi Sven,

thank you very much: I've tried, and it works.

Regards,
Giovanni.
Previous Topic:Using GMF and dynamic EMF with EEnumLiteral
Next Topic:Programmatically add child to compartment
Goto Forum:
  


Current Time: Sat Jul 27 15:41:29 GMT 2024

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

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

Back to the top