Yes, your response was helpful, as always.
One thing I don't quite get though is whether it is
safe/smart/possible to use a description editor on the hard-coded
descriptions (eg. change priority; add more options to an
MASingleOptionDescription).
Chad
On 4/21/07, Lukas Renggli <renggli(a)iam.unibe.ch> wrote:
On 19 Apr 2007, at 22:56, Chad Nantais wrote:
Subclassing MAAdaptiveModel works with the
MADescriptionEditor.
However, when I try to get an edit for for my model with "mymodel
asComponent", none of the descriptions appear in the form, not even
the ones that are hard-coded into the class-side. BTW, I have cleared
caches and initialized my model class.
MAAdaptiveModel doesn't take the hard-coded class side descriptions
into account as it overrides #description without calling super. You
can change that of course, but doing something like I did in the
class PRForm in the package Pier-Forms.
description
"Answer a generic description with the properties of the structure."
^ (MAContainer withAll: super description) , self metamodel
readUsing: aDescription
^ (self metamodel includes: aDescription)
ifFalse: [ super readUsing: aDescription ]
ifTrue: [ self model at: aDescription ifAbsent: [ aDescription
default ] ]
write: anObject using: aDescription
(self metamodel includes: aDescription)
ifFalse: [ super write: anObject using: aDescription ]
ifTrue: [ self model at: aDescription put: anObject ]
In this example I store the adaptive descriptions in the variable
metamodel. You need change your description editor to reflect that.
HTH,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki