Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Where to manipulate node creation?
Where to manipulate node creation? [message #137921] Wed, 20 June 2007 13:50 Go to next message
Eclipse UserFriend
Originally posted by: snej_NO-SPAM_.esuark.de

Hi Newsgroup,

i want to make some changes programmatically when a node is created. I
read a lot of creation commands and i think that is where i have to
start, but where do i find those? Do i have to override a method from
the XXXEditPart like the handleNotificationEvent() method or similar?

Is there any workflow map or something similar where you can see what
happens (so which methods are called and which classes are involved) in
what order if a node/link is created? I mean, if you don't know the
"hole stuff", it could be kind of difficult to get a starting point ...

regards
jens
Re: Where to manipulate node creation? [message #138246 is a reply to message #137921] Thu, 21 June 2007 11:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: khai.n.situvista.com

What exactly are "some changes" that you want to make?
What to change in the code depends on what you really want to change.

Can you give more information?

-- Khai --

Jens Krause wrote:
> Hi Newsgroup,
>
> i want to make some changes programmatically when a node is created. I
> read a lot of creation commands and i think that is where i have to
> start, but where do i find those? Do i have to override a method from
> the XXXEditPart like the handleNotificationEvent() method or similar?
>
> Is there any workflow map or something similar where you can see what
> happens (so which methods are called and which classes are involved) in
> what order if a node/link is created? I mean, if you don't know the
> "hole stuff", it could be kind of difficult to get a starting point ...
>
> regards
> jens
Re: Where to manipulate node creation? [message #139468 is a reply to message #138246] Tue, 26 June 2007 08:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: snej_NO-SPAM_.esuark.de

Khai M Nguyen wrote:
> What exactly are "some changes" that you want to make?
> What to change in the code depends on what you really want to change.
>
> Can you give more information?

Sure, i want to generate an id for the node at creation time. In other
nodes i could do that simply with the handleNotificationEvent() method
because they need a label and when the user edits this i could generate
my id.
But now i have nodes that only have this id and some other attributes
but no label, so the handleNotificationEvent() method is not called and
i couldn't figure out where to start with my id generation ...

regards
jens
Re: Where to manipulate node creation? [message #139512 is a reply to message #139468] Tue, 26 June 2007 12:12 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Jens,

Sounds like your change will affect the semantic element in which case
you probably want to make the EditHelper infrastructure handle this.

Take a look at the "Developer's Guide to the Extensible Type Registry"
in the online help. Here for your convenience:
http://help.eclipse.org/help32/topic/org.eclipse.gmf.doc/pro g-guide/runtime/Developers%20Guide%20to%20the%20Extensible%2 0Type%20Registry/Developers%20Guide%20to%20the%20Extensible% 20Type%20Registry.html

In particular, take a look at the example titled "Configuring a new
Element".

Regards,
Cherie

Jens Krause wrote:
> Khai M Nguyen wrote:
>> What exactly are "some changes" that you want to make?
>> What to change in the code depends on what you really want to change.
>>
>> Can you give more information?
>
> Sure, i want to generate an id for the node at creation time. In other
> nodes i could do that simply with the handleNotificationEvent() method
> because they need a label and when the user edits this i could generate
> my id.
> But now i have nodes that only have this id and some other attributes
> but no label, so the handleNotificationEvent() method is not called and
> i couldn't figure out where to start with my id generation ...
>
> regards
> jens
Re: Where to manipulate node creation? [message #139535 is a reply to message #139512] Tue, 26 June 2007 13:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: snej_NO-SPAM_.esuark.de

Cherie Revells wrote:
> Jens,
>
> Sounds like your change will affect the semantic element in which case
> you probably want to make the EditHelper infrastructure handle this.
>
> Take a look at the "Developer's Guide to the Extensible Type Registry"
> in the online help. Here for your convenience:
> [Help url]
>
> In particular, take a look at the example titled "Configuring a new
> Element".

Thanks Cherie for your reply, but i think i didn't understand how to
manage this.

Well, in this example there is less information how it should work
theoretical. I mean i can't figure out what i need for my special
purpose. What is the structure behind this ConfigureLogicElementCommand?
And do this command exist in GMF 1.0.3? I can't resolve this.

I only need access to the moment the node is created, i then generate
the id in dependency on the parent of the node ...

jens
Re: Where to manipulate node creation? [message #139557 is a reply to message #139535] Tue, 26 June 2007 14:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: snej_NO-SPAM_.esuark.de

Jens Krause wrote:
> Thanks Cherie for your reply, but i think i didn't understand how to
> manage this.

Well, it was kind of confusing that i can't resolve this method, it seem
so that this is GMF 2.0 stuff. But now i get access to my object i need
with the ConfigureElementCommand .. So thans for all :).

regards
jens
Re: Where to manipulate node creation? [message #139860 is a reply to message #137921] Wed, 27 June 2007 10:44 Go to previous message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

Typically elements are created by CreateElementCommand and it's
subclasses. GMF tooling generates dedicated creation commands for all
diagram elements. You may override doDefaultElementCreation() method to
init newly created elements as needed.

Jens Krause wrote:
> Hi Newsgroup,
>
> i want to make some changes programmatically when a node is created. I
> read a lot of creation commands and i think that is where i have to
> start, but where do i find those? Do i have to override a method from
> the XXXEditPart like the handleNotificationEvent() method or similar?
>
> Is there any workflow map or something similar where you can see what
> happens (so which methods are called and which classes are involved) in
> what order if a node/link is created? I mean, if you don't know the
> "hole stuff", it could be kind of difficult to get a starting point ...
>
> regards
> jens
Previous Topic:Propsheet Customization Tutorial
Next Topic:XMI Folder
Goto Forum:
  


Current Time: Wed Jul 03 10:19:41 GMT 2024

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

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

Back to the top