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
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 jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
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 jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
On Tue, Oct 18, 2011 at 8:14 AM, Stéphane Ducasse <stephane.ducasse@inria.fr
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 jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
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 andrehoraa@gmail.com
On Tue, Oct 18, 2011 at 8:14 AM, Stéphane Ducasse < stephane.ducasse@inria.fr> 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 jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- Andre Hora
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
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 cy.delaunay@gmail.com
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 andrehoraa@gmail.com
On Tue, Oct 18, 2011 at 8:14 AM, Stéphane Ducasse < stephane.ducasse@inria.fr> 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 jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- Andre Hora
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
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 jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- Andre Hora
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
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 jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
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 alexandre.bergel@me.com
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 jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
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 jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
---> Save our in-boxes! http://emailcharter.org <---
Johan Fabry jfabry@dcc.uchile.cl - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile