Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Default value of node attribute
Default value of node attribute [message #541992] Wed, 23 June 2010 13:18 Go to next message
gerard  is currently offline gerard Friend
Messages: 1
Registered: June 2010
Junior Member
Hi,

I need to increment the default value of node attribute when i create a new node, for exemple the first node will have the attribute id_node=1, the second id_node=2 ...

can you help me?
thanks
Re: Default value of node attribute [message #542021 is a reply to message #541992] Wed, 23 June 2010 14:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26278
Registered: July 2009
Senior Member
Gerard,

If now one helps quickly, I would use the debugger to answer this
question. Set a breakpoint in the constructor, look on the stack where
the object is being created, decide where best to specialize the code to
set some initial state.


gerard wrote:
> Hi,
>
> I need to increment the default value of node attribute when i create
> a new node, for exemple the first node will have the attribute
> id_node=1, the second id_node=2 ...
>
> can you help me? thanks
Re: Default value of node attribute [message #542148 is a reply to message #541992] Thu, 24 June 2010 05:44 Go to previous messageGo to next message
Sven Krause is currently offline Sven KrauseFriend
Messages: 119
Registered: July 2009
Senior Member
Hi Gerard,

there should be a XXXCreateCommand within your diagram edit.command
package having a doConfigure or at least a doExecuteWithResult method
you can customize.

Sven

Am 23.06.2010 15:18, schrieb gerard:
> Hi,
>
> I need to increment the default value of node attribute when i create a
> new node, for exemple the first node will have the attribute id_node=1,
> the second id_node=2 ...
>
> can you help me? thanks
Re: Default value of node attribute [message #990645 is a reply to message #542148] Thu, 13 December 2012 15:06 Go to previous messageGo to next message
Mirco Franzago is currently offline Mirco FranzagoFriend
Messages: 12
Registered: November 2012
Junior Member
I had the same problem and the Sven Krause's solution worked perfectly.
Re: Default value of node attribute [message #990836 is a reply to message #990645] Fri, 14 December 2012 11:42 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 697
Registered: November 2009
Senior Member
Hi,

you can alternatively use the FeatureSequenceInitializer in GMFMap to set values on creation.

Ralph
Previous Topic:"Diagram is not present" message when opening 2nd Editor
Next Topic:Update programmatically figure with EditPart
Goto Forum:
  


Current Time: Thu Dec 18 04:07:20 GMT 2014

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

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