Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How To Remove a Representation Programatically
How To Remove a Representation Programatically [message #1720765] Wed, 20 January 2016 18:47 Go to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi,

I was wondering how we can delete a representation (file) ? I'm designing a dashboard so that the user can see the list of representations as a list (Similar to what is designed in UMLDesigner) !

Now, I 'm writing a java service to be run when the user hits the delete button on keyboard.

Thanks,
Best Regards,
Parsa

P.S. - The thing is that the default action of delete button of course deletes the representation, but I need to write a java service to show the confirmation dialog to the user and then delete.
Re: How To Remove a Representation Programatically [message #1720827 is a reply to message #1720765] Thu, 21 January 2016 10:00 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Parsa,

I think you might have two solutions:
. the first is to take a look to the org.eclipse.sirius.deleteHook
extension point. It will be called when the user uses the delete
menus/action/buttons.
. the second is to look into [1] & [2] and to use a ModelChangeTrigger
(will be called in pre-commit of the transaction) and to react to any
EObject detachment (delete tools, but also every other interaction which
might result in the detachment/deletion of one of your domain EObject).


Regards

--
Maxime - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
--
[1]
https://github.com/ObeoNetwork/UML-Designer/blob/master/plugins/org.obeonetwork.dsl.uml2.design/src/org/obeonetwork/dsl/uml2/design/internal/triggers/ConfirmDeletionTrigger.java
[2]
https://github.com/ObeoNetwork/UML-Designer/blob/master/plugins/org.obeonetwork.dsl.uml2.design/src/org/obeonetwork/dsl/uml2/design/internal/listeners/UmlDesignerSessionManagerListener.java#L97


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How To Remove a Representation Programatically [message #1720893 is a reply to message #1720827] Thu, 21 January 2016 17:06 Go to previous message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi Maxime ,

Thanks a lot for your quick reply Smile

Best Regards,
Parsa
Previous Topic:Suppressing default validation messages
Next Topic:ECORE plugin generation and existing odesign model
Goto Forum:
  


Current Time: Thu Apr 25 09:29:28 GMT 2024

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

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

Back to the top