Hi,
I would like to build custom magritte view for a FAMIX model, however it seems that Fame/Metanool are somehow interfering with it.. Imagine a simple model (a class with an attribute): ~~~~~~~~~~~~~~~~~~~~~~~~~~~ cls := FAMIXClass new name: 'Something'. (attr := FAMIXAttribute new) name: 'myAttribute'; declaredType: (FAMIXClass new name: 'OtherThing'). cls addAttribute: attr. ~~~~~~~~~~~~~~~~~~~~~~~~~~~ now I can open the magritte description ~~~~~~~~~~~~~~~~~~~~~~~~~~~ attr mooseDescription asMagritteDescription asMagritteMorph openInWindow. ~~~~~~~~~~~~~~~~~~~~~~~~~~~ However this is a meta description, which I don't want... So second option was to build it manually; I extract descriptions that I am interested in.... ~~~~~~~~~~~~~~~~~~~~~~~~~~~ container := MAContainer new addAll: ({ attr mooseDescription at: 'name'. attr mooseDescription at: 'declaredType'. } collect: #asMagritteDescription). (container asMorphOn: attr) openInWindow. ~~~~~~~~~~~~~~~~~~~~~~~~~~~ However the problem with this is, that the declaredType is presented as TextField, which is not very useful. So I'm kind of lost... basically what I want to do is to have a MAContainer that contains both the Attribute's name and #declaredType's name. Is this possible? Thanks, Peter |
Hi, Metanool offers you a way to define new properties and edit those. Thus, it works at the FM3 level (which is a meta-model of FAMIX). You seem to want to work directly at FAMIX level. This means that you just have an object, which happens to be a FAMIXClass instance, and want to describe it with Magritte. For example, for adding a Name property, you can add this method: FAMIXClass>>descriptionName <magritteDescription> ^ MAStringDescription new accessor: #name; label: 'Name'; yourself And you get: What would you expect to get for declaredType? Cheers, Doru On Mon, Sep 21, 2015 at 5:25 PM, Peter Uhnák <[hidden email]> wrote: Hi, |
Hmm, > You seem to want to work directly at FAMIX level. This means that you just have an object, which happens to be a FAMIXClass instance, and want to describe it with Magritte. I thought that I don't need to describe FAMIX models with magritte, because it is autogenerated from <MSEProperty: #someSelector type: #SomeClass>. So I must describe it myself? > What would you expect to get for declaredType? Well the descriptions of it... so in a single form I would have all the descriptions. If I do it with my own descriptions... e.g. FAMIXBehavioralEntity>>descriptionDeclaredType <magritteDescription> ^ MAToOneRelationDescription new selectorAccessor: #declaredType; label: 'Declared Type'; yourself Then I at least get buttons for it (I didn't manage to achieve this with the autogenerated descriptions) However I would still like the option to specify whether I want a new window to show up or let it be embedded in a single form. I managed to track down something like MAInternalEditorMorph which maybe should do what I want but if I apply it it has no effect... so maybe it's broken or I don't know how to use it. Thanks, Peter On Mon, Sep 21, 2015 at 9:31 PM, Tudor Girba <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |