Merlin question

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

Merlin question

abergel
Hi!

I am building a wizard and I am stopped on something that looks trivial.
Consider the following script:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
        | control firstPane lastPane part1 dropListPart part2 |
        control := WizardControl new.
        firstPane := WizardFirstPane new.
        lastPane := WizardLastPane new.

        control addPane: firstPane; addPane: lastPane.
       
        "First pane: picking the configuration we are interested in"
        part1 := TextPart new inGroupboxNamed: 'Select the configuration you want to load versions from'.
        firstPane addPart: part1 associatedTo: #selectedConfiguration.
       
        dropListPart := DropListPart  new
                                        inGroupboxNamed: 'Configurations';
                                        list: self listOfConfigurations;
                                        useLatePopulateContents: false;
                                        yourself.
        firstPane row: dropListPart associatedTo: #selectedConfiguration2.
       
        "Second pane"
        part2 := MultiSelectionItemSelectorPart new initialList: ([:input | {input at: #selectedConfiguration2}]).
        lastPane addPart: part2 associatedTo: #selectedVersions.
       
        "Open the controler"
        control open.
        ^ control
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The problem is that I do not know how to initialize the MultiSelectionItemSelectorPart in the second pane since I need the result of what I selected in part1. I tried to inspire myself from the merlin example #itemsSelectorPartUsing: , but without success.

So, how part2 can refer to the result selected in part1 ?

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





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

Re: Merlin question

jfabry
Hi Alex.

I had similar problems for AspectMaps and was also surprised that Merlin did not have built-in flow of data between different panes. So I built a hack. What I do is to initialize the second pane with dummy data, and then have a callback of the first pane replace the dummy data with real data. The code that does this is below:

AspectMapsUI >>importWizard

        "Second pane contents is actually built using callback of first pane"
        "Third pane contents is actually built using callback of second pane"
        | wizard aiPane psPane javaPane resultPane labelPart filePart importConfigs |
        wizard := WizardControl new.

        importConfigs := OrderedCollection new.

        " == aspect info pane == "
        aiPane := WizardFirstPane named: 'Please choose a .xcr aspect file.'.
        filePart := (ChooseFilePart  new) validExtensions: #(xcr).
        filePart callback: [:fileName |
                        self projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs ].
               
        aiPane row: filePart associatedTo: #aspectInfoFile.
        wizard addPane: aiPane.
       
        "== project select pane =="
       
        psPane := WizardMiddlePane named: 'Please select which projects to import'.
        psPane row: (LabelPart on: 'This will be removed by the callback').
        wizard addPane: psPane.
       
        "== java source select pane =="
       
        javaPane := WizardMiddlePane named: 'Please provide Java data'.
        javaPane row: (LabelPart on: 'This will be removed by the callback').
        wizard addPane: javaPane.
       
        " == last pane with report of what will be done == "
       
        resultPane := WizardLastPane named: 'Will Import'.
        javaPane row: (LabelPart on: 'This will be removed by the callback').
        wizard addPane: resultPane.
       
        wizard atEndDo: [ :outDict | self importProjects: importConfigs aspects: (outDict at: #aspectInfoFile) ]; open

On 17 Oct 2011, at 10:50, Alexandre Bergel wrote:

> Hi!
>
> I am building a wizard and I am stopped on something that looks trivial.



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry  
[hidden email] - http://dcc.uchile.cl/~jfabry
PLEIAD Lab - Computer Science Department (DCC) - University of Chile







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

Re: Merlin question

Stéphane Ducasse
Are you sure that you cannot get the result of the previous pane?
Because it looks strange to me.

Stef

On Oct 18, 2011, at 4:45 AM, Johan Fabry wrote:

> Hi Alex.
>
> I had similar problems for AspectMaps and was also surprised that Merlin did not have built-in flow of data between different panes. So I built a hack. What I do is to initialize the second pane with dummy data, and then have a callback of the first pane replace the dummy data with real data. The code that does this is below:
>
> AspectMapsUI >>importWizard
>
> "Second pane contents is actually built using callback of first pane"
> "Third pane contents is actually built using callback of second pane"
> | wizard aiPane psPane javaPane resultPane labelPart filePart importConfigs |
> wizard := WizardControl new.
>
> importConfigs := OrderedCollection new.
>
> " == aspect info pane == "
> aiPane := WizardFirstPane named: 'Please choose a .xcr aspect file.'.
> filePart := (ChooseFilePart  new) validExtensions: #(xcr).
> filePart callback: [:fileName |
> self projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs ].
>
> aiPane row: filePart associatedTo: #aspectInfoFile.
> wizard addPane: aiPane.
>
> "== project select pane =="
>
> psPane := WizardMiddlePane named: 'Please select which projects to import'.
> psPane row: (LabelPart on: 'This will be removed by the callback').
> wizard addPane: psPane.
>
> "== java source select pane =="
>
> javaPane := WizardMiddlePane named: 'Please provide Java data'.
> javaPane row: (LabelPart on: 'This will be removed by the callback').
> wizard addPane: javaPane.
>
> " == last pane with report of what will be done == "
>
> resultPane := WizardLastPane named: 'Will Import'.
> javaPane row: (LabelPart on: 'This will be removed by the callback').
> wizard addPane: resultPane.
>
> wizard atEndDo: [ :outDict | self importProjects: importConfigs aspects: (outDict at: #aspectInfoFile) ]; open
>
> On 17 Oct 2011, at 10:50, Alexandre Bergel wrote:
>
>> Hi!
>>
>> I am building a wizard and I am stopped on something that looks trivial.
>
>
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry  
> [hidden email] - http://dcc.uchile.cl/~jfabry
> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>
>
>
>
>
>
>
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Merlin question

Andre Hora


On Tue, Oct 18, 2011 at 8:14 AM, Stéphane Ducasse <[hidden email]> wrote:
Are you sure that you cannot get the result of the previous pane?
Because it looks strange to me.
Yes, you can in some Parts. You can check the examples #multiSelectionItemsSelectorPartUsing: #itemsSelectorPartUsing: #parametrizedChexboxesUsing: #parametrizedDropListsUsing:.
The problem is that is not implemented for MultiSelectionItemSelectorPart.

Stef

On Oct 18, 2011, at 4:45 AM, Johan Fabry wrote:

> Hi Alex.
>
> I had similar problems for AspectMaps and was also surprised that Merlin did not have built-in flow of data between different panes. So I built a hack. What I do is to initialize the second pane with dummy data, and then have a callback of the first pane replace the dummy data with real data. The code that does this is below:
>
> AspectMapsUI >>importWizard
>
>       "Second pane contents is actually built using callback of first pane"
>       "Third pane contents is actually built using callback of second pane"
>       | wizard aiPane psPane javaPane resultPane labelPart filePart importConfigs |
>       wizard := WizardControl new.
>
>       importConfigs := OrderedCollection new.
>
>       " == aspect info pane == "
>       aiPane := WizardFirstPane named: 'Please choose a .xcr aspect file.'.
>       filePart := (ChooseFilePart  new) validExtensions: #(xcr).
>       filePart callback: [:fileName |
>                       self projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs ].
>
>       aiPane row: filePart associatedTo: #aspectInfoFile.
>       wizard addPane: aiPane.
>
>       "== project select pane =="
>
>       psPane := WizardMiddlePane named: 'Please select which projects to import'.
>       psPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: psPane.
>
>       "== java source select pane =="
>
>       javaPane := WizardMiddlePane named: 'Please provide Java data'.
>       javaPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: javaPane.
>
>       " == last pane with report of what will be done == "
>
>       resultPane := WizardLastPane named: 'Will Import'.
>       javaPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: resultPane.
>
>       wizard atEndDo: [ :outDict | self importProjects: importConfigs aspects: (outDict at: #aspectInfoFile) ]; open
>
> On 17 Oct 2011, at 10:50, Alexandre Bergel wrote:
>
>> Hi!
>>
>> I am building a wizard and I am stopped on something that looks trivial.
>
>
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry
> [hidden email] - http://dcc.uchile.cl/~jfabry
> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>
>
>
>
>
>
>
> _______________________________________________
> 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



--
Andre Hora


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

Re: Merlin question

cdelaunay
Sorry, I did not pay attention and I only answered to alex Here was the answer:

I think that here you should specify something like:

     lastPane addPart: part2 associatedTo: #selectedVersions requiring: #selectedConfiguration2.

Like that the input of the MultiSelectionItemSelectorPart get populated with output of the dropListPart. That means that the line:


     part2 := MultiSelectionItemSelectorPart new initialList: ([:input | {input at: #selectedConfiguration2}]).

will work corectly.

Now, like andre said,  this is possible that this mechanism does not work well for 
MultiSelectionItemSelectorPart

I can have a look today
  

2011/10/18 Andre Hora <[hidden email]>


On Tue, Oct 18, 2011 at 8:14 AM, Stéphane Ducasse <[hidden email]> wrote:
Are you sure that you cannot get the result of the previous pane?
Because it looks strange to me.
Yes, you can in some Parts. You can check the examples #multiSelectionItemsSelectorPartUsing: #itemsSelectorPartUsing: #parametrizedChexboxesUsing: #parametrizedDropListsUsing:.
The problem is that is not implemented for MultiSelectionItemSelectorPart.

Stef

On Oct 18, 2011, at 4:45 AM, Johan Fabry wrote:

> Hi Alex.
>
> I had similar problems for AspectMaps and was also surprised that Merlin did not have built-in flow of data between different panes. So I built a hack. What I do is to initialize the second pane with dummy data, and then have a callback of the first pane replace the dummy data with real data. The code that does this is below:
>
> AspectMapsUI >>importWizard
>
>       "Second pane contents is actually built using callback of first pane"
>       "Third pane contents is actually built using callback of second pane"
>       | wizard aiPane psPane javaPane resultPane labelPart filePart importConfigs |
>       wizard := WizardControl new.
>
>       importConfigs := OrderedCollection new.
>
>       " == aspect info pane == "
>       aiPane := WizardFirstPane named: 'Please choose a .xcr aspect file.'.
>       filePart := (ChooseFilePart  new) validExtensions: #(xcr).
>       filePart callback: [:fileName |
>                       self projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs ].
>
>       aiPane row: filePart associatedTo: #aspectInfoFile.
>       wizard addPane: aiPane.
>
>       "== project select pane =="
>
>       psPane := WizardMiddlePane named: 'Please select which projects to import'.
>       psPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: psPane.
>
>       "== java source select pane =="
>
>       javaPane := WizardMiddlePane named: 'Please provide Java data'.
>       javaPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: javaPane.
>
>       " == last pane with report of what will be done == "
>
>       resultPane := WizardLastPane named: 'Will Import'.
>       javaPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: resultPane.
>
>       wizard atEndDo: [ :outDict | self importProjects: importConfigs aspects: (outDict at: #aspectInfoFile) ]; open
>
> On 17 Oct 2011, at 10:50, Alexandre Bergel wrote:
>
>> Hi!
>>
>> I am building a wizard and I am stopped on something that looks trivial.
>
>
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry
> [hidden email] - http://dcc.uchile.cl/~jfabry
> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>
>
>
>
>
>
>
> _______________________________________________
> 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



--
Andre Hora


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Merlin question

cdelaunay
I just looked and indeed , for now, there is no 'easy' way to set a default list to a 'list-kind' part. The best for now is to do it like johan did.
I will check that today 


2011/10/18 Cyrille Delaunay <[hidden email]>
Sorry, I did not pay attention and I only answered to alex Here was the answer:

I think that here you should specify something like:

     lastPane addPart: part2 associatedTo: #selectedVersions requiring: #selectedConfiguration2.

Like that the input of the MultiSelectionItemSelectorPart get populated with output of the dropListPart. That means that the line:


     part2 := MultiSelectionItemSelectorPart new initialList: ([:input | {input at: #selectedConfiguration2}]).

will work corectly.

Now, like andre said,  this is possible that this mechanism does not work well for 
MultiSelectionItemSelectorPart

I can have a look today
  

2011/10/18 Andre Hora <[hidden email]>


On Tue, Oct 18, 2011 at 8:14 AM, Stéphane Ducasse <[hidden email]> wrote:
Are you sure that you cannot get the result of the previous pane?
Because it looks strange to me.
Yes, you can in some Parts. You can check the examples #multiSelectionItemsSelectorPartUsing: #itemsSelectorPartUsing: #parametrizedChexboxesUsing: #parametrizedDropListsUsing:.
The problem is that is not implemented for MultiSelectionItemSelectorPart.

Stef

On Oct 18, 2011, at 4:45 AM, Johan Fabry wrote:

> Hi Alex.
>
> I had similar problems for AspectMaps and was also surprised that Merlin did not have built-in flow of data between different panes. So I built a hack. What I do is to initialize the second pane with dummy data, and then have a callback of the first pane replace the dummy data with real data. The code that does this is below:
>
> AspectMapsUI >>importWizard
>
>       "Second pane contents is actually built using callback of first pane"
>       "Third pane contents is actually built using callback of second pane"
>       | wizard aiPane psPane javaPane resultPane labelPart filePart importConfigs |
>       wizard := WizardControl new.
>
>       importConfigs := OrderedCollection new.
>
>       " == aspect info pane == "
>       aiPane := WizardFirstPane named: 'Please choose a .xcr aspect file.'.
>       filePart := (ChooseFilePart  new) validExtensions: #(xcr).
>       filePart callback: [:fileName |
>                       self projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs ].
>
>       aiPane row: filePart associatedTo: #aspectInfoFile.
>       wizard addPane: aiPane.
>
>       "== project select pane =="
>
>       psPane := WizardMiddlePane named: 'Please select which projects to import'.
>       psPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: psPane.
>
>       "== java source select pane =="
>
>       javaPane := WizardMiddlePane named: 'Please provide Java data'.
>       javaPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: javaPane.
>
>       " == last pane with report of what will be done == "
>
>       resultPane := WizardLastPane named: 'Will Import'.
>       javaPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: resultPane.
>
>       wizard atEndDo: [ :outDict | self importProjects: importConfigs aspects: (outDict at: #aspectInfoFile) ]; open
>
> On 17 Oct 2011, at 10:50, Alexandre Bergel wrote:
>
>> Hi!
>>
>> I am building a wizard and I am stopped on something that looks trivial.
>
>
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry
> [hidden email] - http://dcc.uchile.cl/~jfabry
> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>
>
>
>
>
>
>
> _______________________________________________
> 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



--
Andre Hora


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Merlin question

abergel
In reply to this post by abergel
Hi Cyrille,

Thanks for your help. This goes indeed in the right direction, however I have the impression I am now bumping into a bug.

Consider the following code:
-=-=-= -=-=-= -=-=-= -=-=-= -=-=-=
        | wizardControl  wizardPane1 wizardPane2  itemsSelectorsPart listPart aRenderer |
        aRenderer := MerlinMorphicWizardRenderer new .
        wizardControl := WizardControl new.
        wizardControl renderer: aRenderer.
        wizardPane1 := WizardFirstPane new.
        wizardPane2 := WizardLastPane new.
       
        itemsSelectorsPart := MultiSelectionItemSelectorPart new
                                                        initialList: #(item1 item2 item3 item4);
                                                        yourself.
                                                       
        listPart := MultiSelectionItemSelectorPart new
                                        initialList: [:requiredInputs |
                                                (requiredInputs at: #selectedItems)
                                                ];
                                        yourself.
               
        wizardPane1 row: itemsSelectorsPart associatedTo: #selectedItems.
        wizardPane2 row: listPart requiring: {#selectedItems}.
               
        wizardControl
                addPane: wizardPane1;
                addPane: wizardPane2.
               
        wizardControl open.
-=-=-= -=-=-= -=-=-= -=-=-= -=-=-=

This throws an error.
Shall I open an issue?

Cheers,
Alexandre


On 17 Oct 2011, at 14:45, Cyrille Delaunay wrote:

> Hello alex,
>
> 2011/10/17 Alexandre Bergel <[hidden email]>
> Hi!
>
> I am building a wizard and I am stopped on something that looks trivial.
> Consider the following script:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>        | control firstPane lastPane part1 dropListPart part2 |
>        control := WizardControl new.
>        firstPane := WizardFirstPane new.
>        lastPane := WizardLastPane new.
>
>        control addPane: firstPane; addPane: lastPane.
>
>        "First pane: picking the configuration we are interested in"
>        part1 := TextPart new inGroupboxNamed: 'Select the configuration you want to load versions from'.
>        firstPane addPart: part1 associatedTo: #selectedConfiguration.
>
>        dropListPart := DropListPart  new
>                                        inGroupboxNamed: 'Configurations';
>                                        list: self listOfConfigurations;
>                                        useLatePopulateContents: false;
>                                        yourself.
>        firstPane row: dropListPart associatedTo: #selectedConfiguration2.
>
>        "Second pane"
>        part2 := MultiSelectionItemSelectorPart new initialList: ([:input | {input at: #selectedConfiguration2}]).
>        lastPane addPart: part2 associatedTo: #selectedVersions.
>
> I think that here you should specify something like:
>
>      lastPane addPart: part2 associatedTo: #selectedVersions requiring: #selectedConfiguration2.
>
> Like that the input of the MultiSelectionItemSelectorPart get populated with output of the dropListPart. That means that the line:
>
>
>      part2 := MultiSelectionItemSelectorPart new initialList: ([:input | {input at: #selectedConfiguration2}]).
>
> will work corectly.
> Does it answer to your question?
>  
>
>        "Open the controler"
>        control open.
>        ^ control
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> The problem is that I do not know how to initialize the MultiSelectionItemSelectorPart in the second pane since I need the result of what I selected in part1. I tried to inspire myself from the merlin example #itemsSelectorPartUsing: , but without success.
>
> So, how part2 can refer to the result selected in part1 ?
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





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

Re: Merlin question

abergel
In reply to this post by Andre Hora
> Are you sure that you cannot get the result of the previous pane?
> Because it looks strange to me.
> Yes, you can in some Parts. You can check the examples #multiSelectionItemsSelectorPartUsing: #itemsSelectorPartUsing: #parametrizedChexboxesUsing: #parametrizedDropListsUsing:.
> The problem is that is not implemented for MultiSelectionItemSelectorPart.

Yep, this is what I just discovered.

Alexandre

>
> On Oct 18, 2011, at 4:45 AM, Johan Fabry wrote:
>
> > Hi Alex.
> >
> > I had similar problems for AspectMaps and was also surprised that Merlin did not have built-in flow of data between different panes. So I built a hack. What I do is to initialize the second pane with dummy data, and then have a callback of the first pane replace the dummy data with real data. The code that does this is below:
> >
> > AspectMapsUI >>importWizard
> >
> >       "Second pane contents is actually built using callback of first pane"
> >       "Third pane contents is actually built using callback of second pane"
> >       | wizard aiPane psPane javaPane resultPane labelPart filePart importConfigs |
> >       wizard := WizardControl new.
> >
> >       importConfigs := OrderedCollection new.
> >
> >       " == aspect info pane == "
> >       aiPane := WizardFirstPane named: 'Please choose a .xcr aspect file.'.
> >       filePart := (ChooseFilePart  new) validExtensions: #(xcr).
> >       filePart callback: [:fileName |
> >                       self projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs ].
> >
> >       aiPane row: filePart associatedTo: #aspectInfoFile.
> >       wizard addPane: aiPane.
> >
> >       "== project select pane =="
> >
> >       psPane := WizardMiddlePane named: 'Please select which projects to import'.
> >       psPane row: (LabelPart on: 'This will be removed by the callback').
> >       wizard addPane: psPane.
> >
> >       "== java source select pane =="
> >
> >       javaPane := WizardMiddlePane named: 'Please provide Java data'.
> >       javaPane row: (LabelPart on: 'This will be removed by the callback').
> >       wizard addPane: javaPane.
> >
> >       " == last pane with report of what will be done == "
> >
> >       resultPane := WizardLastPane named: 'Will Import'.
> >       javaPane row: (LabelPart on: 'This will be removed by the callback').
> >       wizard addPane: resultPane.
> >
> >       wizard atEndDo: [ :outDict | self importProjects: importConfigs aspects: (outDict at: #aspectInfoFile) ]; open
> >
> > On 17 Oct 2011, at 10:50, Alexandre Bergel wrote:
> >
> >> Hi!
> >>
> >> I am building a wizard and I am stopped on something that looks trivial.
> >
> >
> >
> > ---> Save our in-boxes! http://emailcharter.org <---
> >
> > Johan Fabry
> > [hidden email] - http://dcc.uchile.cl/~jfabry
> > PLEIAD Lab - Computer Science Department (DCC) - University of Chile
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > 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
>
>
>
> --
> Andre Hora
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





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

Re: Merlin question

abergel
In reply to this post by jfabry
Humm... I do not really understand what #projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs  is supposed to do.

How does the callback to modify the two panes?

Alexandre

On 17 Oct 2011, at 23:45, Johan Fabry wrote:

> Hi Alex.
>
> I had similar problems for AspectMaps and was also surprised that Merlin did not have built-in flow of data between different panes. So I built a hack. What I do is to initialize the second pane with dummy data, and then have a callback of the first pane replace the dummy data with real data. The code that does this is below:
>
> AspectMapsUI >>importWizard
>
> "Second pane contents is actually built using callback of first pane"
> "Third pane contents is actually built using callback of second pane"
> | wizard aiPane psPane javaPane resultPane labelPart filePart importConfigs |
> wizard := WizardControl new.
>
> importConfigs := OrderedCollection new.
>
> " == aspect info pane == "
> aiPane := WizardFirstPane named: 'Please choose a .xcr aspect file.'.
> filePart := (ChooseFilePart  new) validExtensions: #(xcr).
> filePart callback: [:fileName |
> self projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs ].
>
> aiPane row: filePart associatedTo: #aspectInfoFile.
> wizard addPane: aiPane.
>
> "== project select pane =="
>
> psPane := WizardMiddlePane named: 'Please select which projects to import'.
> psPane row: (LabelPart on: 'This will be removed by the callback').
> wizard addPane: psPane.
>
> "== java source select pane =="
>
> javaPane := WizardMiddlePane named: 'Please provide Java data'.
> javaPane row: (LabelPart on: 'This will be removed by the callback').
> wizard addPane: javaPane.
>
> " == last pane with report of what will be done == "
>
> resultPane := WizardLastPane named: 'Will Import'.
> javaPane row: (LabelPart on: 'This will be removed by the callback').
> wizard addPane: resultPane.
>
> wizard atEndDo: [ :outDict | self importProjects: importConfigs aspects: (outDict at: #aspectInfoFile) ]; open
>
> On 17 Oct 2011, at 10:50, Alexandre Bergel wrote:
>
>> Hi!
>>
>> I am building a wizard and I am stopped on something that looks trivial.
>
>
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry  
> [hidden email] - http://dcc.uchile.cl/~jfabry
> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>
>
>
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





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

Re: Merlin question

cdelaunay
Let say you have two lists: listPart1 and listPart2 (one in a first pane and the other one on the second pane).
You can write something like:

    listPart1 callback: [:output |
       listPart2 list: {output}. 
    ]

I think you want to do something like that ?  
The right solution (not implemented for now) would be to have a method like:

     listPart2 defaultList: [:requiredInputs | .... ]

Like that we don't have to refer directly the other part

2011/10/18 Alexandre Bergel <[hidden email]>
Humm... I do not really understand what #projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs  is supposed to do.

How does the callback to modify the two panes?

Alexandre

On 17 Oct 2011, at 23:45, Johan Fabry wrote:

> Hi Alex.
>
> I had similar problems for AspectMaps and was also surprised that Merlin did not have built-in flow of data between different panes. So I built a hack. What I do is to initialize the second pane with dummy data, and then have a callback of the first pane replace the dummy data with real data. The code that does this is below:
>
> AspectMapsUI >>importWizard
>
>       "Second pane contents is actually built using callback of first pane"
>       "Third pane contents is actually built using callback of second pane"
>       | wizard aiPane psPane javaPane resultPane labelPart filePart importConfigs |
>       wizard := WizardControl new.
>
>       importConfigs := OrderedCollection new.
>
>       " == aspect info pane == "
>       aiPane := WizardFirstPane named: 'Please choose a .xcr aspect file.'.
>       filePart := (ChooseFilePart  new) validExtensions: #(xcr).
>       filePart callback: [:fileName |
>                       self projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs ].
>
>       aiPane row: filePart associatedTo: #aspectInfoFile.
>       wizard addPane: aiPane.
>
>       "== project select pane =="
>
>       psPane := WizardMiddlePane named: 'Please select which projects to import'.
>       psPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: psPane.
>
>       "== java source select pane =="
>
>       javaPane := WizardMiddlePane named: 'Please provide Java data'.
>       javaPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: javaPane.
>
>       " == last pane with report of what will be done == "
>
>       resultPane := WizardLastPane named: 'Will Import'.
>       javaPane row: (LabelPart on: 'This will be removed by the callback').
>       wizard addPane: resultPane.
>
>       wizard atEndDo: [ :outDict | self importProjects: importConfigs aspects: (outDict at: #aspectInfoFile) ]; open
>
> On 17 Oct 2011, at 10:50, Alexandre Bergel wrote:
>
>> Hi!
>>
>> I am building a wizard and I am stopped on something that looks trivial.
>
>
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry
> [hidden email] - http://dcc.uchile.cl/~jfabry
> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>
>
>
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Merlin question

jfabry
In reply to this post by abergel
Oops, sorry. Jetlag ... Here is what happens in the first callback to fillin the 2nd pane. Note that it adds a callback to fill in the 3rd pane (and this pattern repeats itself). The code is in the Squeaksource AspectMaps repository, if you want to see everything.

AspectMapsUI>>projectSelectFrom: aFilename forWizard: aWizard andConfig: aConfigCollection
        | psPane stream pnames projname |

        "aFilename is first processed to extract the names of the eclipse projects"
        pnames := OrderedCollection  new.
        stream := (CrLfFileStream fileNamed: aFilename).
        stream position: 0.
        stream nextLine. "skip 'Projects list'"
        [((projname := stream nextLine) = '')not] whileTrue:[pnames add: projname].
        stream close.
       
        aConfigCollection removeAll.
       
        psPane := aWizard wizardPanes at: 2.
        psPane removeAllParts.
       
        pnames do: [ :name | | cbx config|
                        config := AMImportConfig new projectName: name.
                        aConfigCollection add: config.
                        cbx := CheckboxPart new label: name.
                        cbx defaultValue: config doImport.
                        cbx callback: [ :state |
                                config doImport: state.
                                self changeJavaSourcePaneOf:  aWizard with: aConfigCollection.].
                        psPane row: cbx associatedTo: name.].


On 18 Oct 2011, at 11:26, Alexandre Bergel wrote:

> Humm... I do not really understand what #projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs  is supposed to do.
>
> How does the callback to modify the two panes?
>
> Alexandre
>
> On 17 Oct 2011, at 23:45, Johan Fabry wrote:
>
>> Hi Alex.
>>
>> I had similar problems for AspectMaps and was also surprised that Merlin did not have built-in flow of data between different panes. So I built a hack. What I do is to initialize the second pane with dummy data, and then have a callback of the first pane replace the dummy data with real data. The code that does this is below:
>>
>> AspectMapsUI >>importWizard
>>
>> "Second pane contents is actually built using callback of first pane"
>> "Third pane contents is actually built using callback of second pane"
>> | wizard aiPane psPane javaPane resultPane labelPart filePart importConfigs |
>> wizard := WizardControl new.
>>
>> importConfigs := OrderedCollection new.
>>
>> " == aspect info pane == "
>> aiPane := WizardFirstPane named: 'Please choose a .xcr aspect file.'.
>> filePart := (ChooseFilePart  new) validExtensions: #(xcr).
>> filePart callback: [:fileName |
>> self projectSelectFrom: fileName forWizard: wizard andConfig: importConfigs ].
>>
>> aiPane row: filePart associatedTo: #aspectInfoFile.
>> wizard addPane: aiPane.
>>
>> "== project select pane =="
>>
>> psPane := WizardMiddlePane named: 'Please select which projects to import'.
>> psPane row: (LabelPart on: 'This will be removed by the callback').
>> wizard addPane: psPane.
>>
>> "== java source select pane =="
>>
>> javaPane := WizardMiddlePane named: 'Please provide Java data'.
>> javaPane row: (LabelPart on: 'This will be removed by the callback').
>> wizard addPane: javaPane.
>>
>> " == last pane with report of what will be done == "
>>
>> resultPane := WizardLastPane named: 'Will Import'.
>> javaPane row: (LabelPart on: 'This will be removed by the callback').
>> wizard addPane: resultPane.
>>
>> wizard atEndDo: [ :outDict | self importProjects: importConfigs aspects: (outDict at: #aspectInfoFile) ]; open
>>
>> On 17 Oct 2011, at 10:50, Alexandre Bergel wrote:
>>
>>> Hi!
>>>
>>> I am building a wizard and I am stopped on something that looks trivial.
>>
>>
>>
>> ---> Save our in-boxes! http://emailcharter.org <---
>>
>> Johan Fabry  
>> [hidden email] - http://dcc.uchile.cl/~jfabry
>> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry  
[hidden email] - http://dcc.uchile.cl/~jfabry
PLEIAD Lab - Computer Science Department (DCC) - University of Chile







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