use of org.pentaho.platform.dataaccess.datasource.wizard.IWizardStep in project data-access by pentaho.
the class MainWizardController method setActiveStep.
public void setActiveStep(final int step) {
try {
if (this.steps == null || steps.isEmpty()) {
return;
}
final int oldActiveStep = this.activeStep;
if (oldActiveStep >= 0) {
final IWizardStep deactivatingWizardStep = steps.get(oldActiveStep);
if (step > oldActiveStep) {
if (!deactivatingWizardStep.stepDeactivatingForward()) {
return;
}
} else {
if (!deactivatingWizardStep.stepDeactivatingReverse()) {
return;
}
}
}
this.activeStep = step;
final IWizardStep activatingWizardStep = steps.get(activeStep);
updateBindings();
// update the controller panel
final XulDeck deck = (XulDeck) document.getElementById(CONTENT_DECK_ELEMENT_ID);
int index = deck.getChildNodes().indexOf(activatingWizardStep.getUIComponent());
deck.setSelectedIndex(index);
selectDataSourceMenuList(activatingWizardStep, index);
activatingWizardStep.refresh();
if (activeStep > oldActiveStep) {
activatingWizardStep.stepActivatingForward();
} else {
activatingWizardStep.stepActivatingReverse();
}
this.firePropertyChange(ACTIVE_STEP_PROPERTY_NAME, oldActiveStep, this.activeStep);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations