Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Extending the action of making a connection
Extending the action of making a connection [message #551888] Tue, 10 August 2010 00:42 Go to next message
Yu Sun is currently offline Yu SunFriend
Messages: 58
Registered: July 2009
Member
Hi everyone,

I would like to realize such a feature in my GMF editor:

When I make a connection from a source node to a target node, I would like to automatically copy an attribute of the source node to the target node.

I think that this could be done by some event listener, right? Or is there other better solutions?

For GMF event listener, where should I start? I checked some threads already, but still not clear enough.

Thanks a lot.

Yu

Re: Extending the action of making a connection [message #551929 is a reply to message #551888] Tue, 10 August 2010 08:31 Go to previous messageGo to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
You could do one of the following:

- modify the MyConnectionCreateCommand#execute() method

- implement (override) the MyConnectionEditHelper#getCreateCommand(CreationRequest) (see method in super class ) and provide a command for setting your attribute.

Emil.
Re: Extending the action of making a connection [message #551964 is a reply to message #551888] Tue, 10 August 2010 10:17 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

maybe you can also use Feature seq initializer.

Regards


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Extending the action of making a connection [message #552019 is a reply to message #551929] Tue, 10 August 2010 14:36 Go to previous message
Yu Sun is currently offline Yu SunFriend
Messages: 58
Registered: July 2009
Member
Thanks a lot, guys.

I modified the CreateCommand.doExecuteWithResult(). And it works very well.

Yu

Previous Topic:Dynamically change connection decoration
Next Topic:Remove default icon in front of element label
Goto Forum:
  


Current Time: Fri Apr 26 19:21:17 GMT 2024

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

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

Back to the top