glamour question

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

glamour question

Fabrizio Perin-3
Hi,
I was writing a report in Arki. The result of the report is a dictionary. An entry of the dictionary has as key a FAMIXMethod and as value an ordered collection with inside one or more ordered collections.

What I want to do is to have a browser with two rows, in the top row I want a MooseFinder opening on the keys of the dictionary, on the bottom row I want to see the content of the dictionary at the selected key.

The problem is that I'm not able to make the MooseFinder opening on the keys of the element.

Here a script that reproduce this scenario:
| dic myBrowser |

dic := Dictionary new.

dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 1 with: 2 with: 3)). 
dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 4 with: 5 with: 6)).  
dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 7 with: 8 with: 9)). 

myBrowser := GLMTabulator new.
myBrowser 
row: #methods; 
row: #info.
myBrowser transmit to: #methods; andShow: [:a |
a custom: (MooseFinder new first startOn: dic keys asMooseGroup) ].
myBrowser transmit to: #info; from: #methods; andShow: [:a | 
a list
title: 'Columns to map';
display: [:method | (self result at: method) ]].

  myBrowser openOn: dic.

Any suggestion will be more than welcome. Thanks.

Cheers,
Fabrizio

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: glamour question

Tudor Girba-2
The ListPresentation does not work well with dictionaries due to MorphTreeMorph.

What you can do is to use the associations:
| dic myBrowser |
dic := Dictionary new.
dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 1 with: 2 with: 3)).
dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 4 with: 5 with: 6)).  
dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 7 with: 8 with: 9)).
myBrowser := GLMTabulator new.
        myBrowser
                row: #methods;
                row: #info.
        myBrowser transmit to: #methods; andShow: [:a |
                 a custom: (MooseFinder new first startOn: (dic associations collect: #key) asMooseGroup) ].
       
        myBrowser transmit to: #info; from: #methods; andShow: [:a |
                a list
                        title: 'Columns to map';
                        display: [:method | (self result at: method) ]].
  myBrowser openOn: dic associations.


But, when using the Finder, you might end up clicking on an object that is not a method, and in this case, the second transmission might fail. At least, you should put a condition on the transmission.

Cheers,
Doru



On Mar 14, 2013, at 7:40 PM, Fabrizio Perin <[hidden email]> wrote:

> Hi,
> I was writing a report in Arki. The result of the report is a dictionary. An entry of the dictionary has as key a FAMIXMethod and as value an ordered collection with inside one or more ordered collections.
>
> What I want to do is to have a browser with two rows, in the top row I want a MooseFinder opening on the keys of the dictionary, on the bottom row I want to see the content of the dictionary at the selected key.
>
> The problem is that I'm not able to make the MooseFinder opening on the keys of the element.
>
> Here a script that reproduce this scenario:
> | dic myBrowser |
>
> dic := Dictionary new.
>
> dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 1 with: 2 with: 3)).
> dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 4 with: 5 with: 6)).  
> dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 7 with: 8 with: 9)).
>
> myBrowser := GLMTabulator new.
> myBrowser
> row: #methods;
> row: #info.
>
> myBrowser transmit to: #methods; andShow: [:a |
> a custom: (MooseFinder new first startOn: dic keys asMooseGroup) ].
>
> myBrowser transmit to: #info; from: #methods; andShow: [:a |
> a list
> title: 'Columns to map';
> display: [:method | (self result at: method) ]].
>
>   myBrowser openOn: dic.
>
> Any suggestion will be more than welcome. Thanks.
>
> Cheers,
> Fabrizio
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Obvious things are difficult to teach."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: glamour question

Fabrizio Perin-3

Thanks a lot Doru i will try as you said. About the condition i was already thinking to use it :)

I'll let you know if it works.


Cheers,

Fabrizio


 

On Mar 14, 2013 9:30 PM, "Tudor Girba" <[hidden email]> wrote:
The ListPresentation does not work well with dictionaries due to MorphTreeMorph.

What you can do is to use the associations:
| dic myBrowser |
dic := Dictionary new.
dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 1 with: 2 with: 3)).
dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 4 with: 5 with: 6)).
dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 7 with: 8 with: 9)).
myBrowser := GLMTabulator new.
        myBrowser
                row: #methods;
                row: #info.
        myBrowser transmit to: #methods; andShow: [:a |
                 a custom: (MooseFinder new first startOn: (dic associations collect: #key) asMooseGroup) ].

        myBrowser transmit to: #info; from: #methods; andShow: [:a |
                a list
                        title: 'Columns to map';
                        display: [:method | (self result at: method) ]].
  myBrowser openOn: dic associations.


But, when using the Finder, you might end up clicking on an object that is not a method, and in this case, the second transmission might fail. At least, you should put a condition on the transmission.

Cheers,
Doru



On Mar 14, 2013, at 7:40 PM, Fabrizio Perin <[hidden email]> wrote:

> Hi,
> I was writing a report in Arki. The result of the report is a dictionary. An entry of the dictionary has as key a FAMIXMethod and as value an ordered collection with inside one or more ordered collections.
>
> What I want to do is to have a browser with two rows, in the top row I want a MooseFinder opening on the keys of the dictionary, on the bottom row I want to see the content of the dictionary at the selected key.
>
> The problem is that I'm not able to make the MooseFinder opening on the keys of the element.
>
> Here a script that reproduce this scenario:
> | dic myBrowser |
>
> dic := Dictionary new.
>
> dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 1 with: 2 with: 3)).
> dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 4 with: 5 with: 6)).
> dic at: FAMIXMethod new put: (OrderedCollection with: (OrderedCollection with: 7 with: 8 with: 9)).
>
> myBrowser := GLMTabulator new.
>       myBrowser
>               row: #methods;
>               row: #info.
>
>       myBrowser transmit to: #methods; andShow: [:a |
>                a custom: (MooseFinder new first startOn: dic keys asMooseGroup) ].
>
>       myBrowser transmit to: #info; from: #methods; andShow: [:a |
>               a list
>                       title: 'Columns to map';
>                       display: [:method | (self result at: method) ]].
>
>   myBrowser openOn: dic.
>
> Any suggestion will be more than welcome. Thanks.
>
> Cheers,
> Fabrizio
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Obvious things are difficult to teach."




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

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