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 09:18 Go to next message
gerard  is currently offline gerard
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 10:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25999
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 01:44 Go to previous messageGo to next message
Sven Krause is currently offline Sven Krause
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 10:06 Go to previous messageGo to next message
Mirco Franzago is currently offline Mirco Franzago
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 06:42 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
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 Aug 21 02:37:35 EDT 2014

Powered by FUDForum. Page generated in 0.01743 seconds