Displaying custom Magritte view on FAMIX model

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Displaying custom Magritte view on FAMIX model

Peter Uhnak
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
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-users] Displaying custom Magritte view on FAMIX model

Tudor Girba-2
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:

Inline image 1

Inline image 2

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,

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




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev