Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Name of deleted Node
Name of deleted Node [message #1058922] Wed, 15 May 2013 19:14 Go to next message
bradai hazem is currently offline bradai hazemFriend
Messages: 20
Registered: March 2013
Junior Member
Hi,
How can i know the name(figuring in the label)of a node after deleting it.
In fact i want to write this name in .txt file
Please Help me my brothers..
Re: Name of deleted Node [message #1058981 is a reply to message #1058922] Thu, 16 May 2013 06:45 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

you can add a handleNotification method to the parent editpart this will inform you about all changes in its content including things like old and new value. You can also attach a listener to your editing domain, or to the model which would be a more gmf independent approach.

Ralph
Re: Name of deleted Node [message #1059081 is a reply to message #1058981] Thu, 16 May 2013 15:03 Go to previous messageGo to next message
bradai hazem is currently offline bradai hazemFriend
Messages: 20
Registered: March 2013
Junior Member
Thnaks Ralgh for your reply,
Can u help me more and tell me what code should i add to my project ?
I will give u the EditPart of the parent(EchelleSpecifique.EditPart) and of the child(Composant.EditPar)
And a lot for your Help my bro Smile
Re: Name of deleted Node [message #1059235 is a reply to message #1059081] Fri, 17 May 2013 12:43 Go to previous messageGo to next message
Dan Tololoi is currently offline Dan TololoiFriend
Messages: 33
Registered: September 2012
Location: Iasi, Romania
Member

/**
* @generated
*/
protected void handleNotificationEvent(Notification notification) {
super.handleNotificationEvent(notification);

if (notification.getEventType() == Notification.SET) {

NodeImpl node = (NodeImpl) this.getModel();

if (node.getElement() instanceof xxxYourDeletedFigureXXX) {
xxxYourDeletedFigureXXX bdtState = (xxxYourDeletedFigureXXX) node
.getElement();

if (notification.getNotifier() instanceof xxxYourDeletedFigureImplXXX) {
xxxYourDeletedFigureImplXXX stateNofitier = (xxxYourDeletedFigureImplXXX) notification
.getNotifier();


...............

So in the bdtState you have your element that received the event . If it was derived from a class that had name as EAttribute, then you can access its name through getName() method.

Hope this helps.
Re: Name of deleted Node [message #1059423 is a reply to message #1059235] Sat, 18 May 2013 08:48 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

if Dan's code works for you, you should consider to put it in a custom template. This helps you to separate the generated code and the custom code. Here you find a tutorial http://www.bonitasoft.org/blog/eclipse/customize-your-gmf-editor-by-customizing-templates/.

Ralph

[Updated on: Sat, 18 May 2013 08:49]

Report message to a moderator

Previous Topic:EVL constraints
Next Topic:XXXDocumentProvider Class DoSave() Method
Goto Forum:
  


Current Time: Mon Dec 30 16:19:49 GMT 2024

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

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

Back to the top