Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to count number in time of initialization of a document
How to count number in time of initialization of a document [message #231844] Mon, 01 June 2009 00:37 Go to next message
Filip Sebesta is currently offline Filip SebestaFriend
Messages: 26
Registered: July 2009
Junior Member
Hi,

I have got a problem. One entity (node) in my model contains a variable
which value is the count of another entity (subnode) which the node
contains and the value is counted by a method. When I work with a new
document, it is OK because new nodes starts with a default value and
counting is triggered by making changes, but when I open an existing
document, a default value is initialized. I think it is becuase the
counting method is called in time when other entities does not exist. So
the method counts a wrong number.

Where should I call the method or what should I do for setting a variable
on a proper value?;


Thanks!
Re: How to count number in time of initialization of a document [message #231971 is a reply to message #231844] Tue, 02 June 2009 07:40 Go to previous message
Eclipse UserFriend
Originally posted by: tobk42.gmx.de

Hello Filip,

if I understand you corrently the purpose of the variable is only to
show how many of these child elements are contained in this node, and
the variable itself is unsettable (or only indirectly by adding or
removing child elements). In this case it would be better to use a
"derived" attribute instead, or even an eOperation, returning that
value. In this case the value is computed each time the getter (or the
eOperation) is called (should be no problem assuming that determining
the children is not overly complex).

Regards,
Tobias


Filip Sebesta schrieb:
> Hi,
>
> I have got a problem. One entity (node) in my model contains a variable
> which value is the count of another entity (subnode) which the node
> contains and the value is counted by a method. When I work with a new
> document, it is OK because new nodes starts with a default value and
> counting is triggered by making changes, but when I open an existing
> document, a default value is initialized. I think it is becuase the
> counting method is called in time when other entities does not exist. So
> the method counts a wrong number.
>
> Where should I call the method or what should I do for setting a
> variable on a proper value?;
>
>
> Thanks!
>
Previous Topic:Integration of 2 GMF editors
Next Topic:Grouping nodes visually
Goto Forum:
  


Current Time: Thu Apr 25 13:39:14 GMT 2024

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

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

Back to the top