2009/1/23, Igor Stasenko <siguctua(a)gmail.com>om>:
Hello list,
I'm trying to describe a model, which values could have complex or
multiple types at once.
In general , a question is how to provide a description of following fields:
suppose you have a field, which in own turn having own fields, and you
want to display them in-line i.e.
position :: point(x,y)
point::x = integer
point::y = integer
so i'd like to describe a position, as a compound data type, lets say,
instances of class Point which having own fields (x,y).
So, then in form i could have this field displayed like following:
position x: [ ... ] y: [ ...]
Another case, is when value can use multiple types.
Following previous example, for position, now i reconsidered and want
a position accept not only instances of Point, but instances of
Point3D as well.
So, then Magritte should be able to display my 'position' field editor
like following:
position
* x: [ ... ] y: [ ...]
* x: [ ... ] y: [ ...] z: [...]
where * is radio button.
Or there can be different view where user can select a type first, and
then edit value:
position [<type selection combobox>] [ value editor for selected type ]
I don't want to get into detail how to render/build such editors, my
main question, is how to describe such things in less
painfull/controversial way using Magritte.
MARelationDescription new
selectorAccessor: #position;
classes: (Array with: Point with: Point3D);
yourself
of course Point and Point3D need to be described with Magritte.
Cheers
Philippe