@Override
public void setState( State state ) {
super.setState(state);
UDIGConnectionPage tmp;
// create the specific connection page
if (state instanceof IntermediateState) {
IntermediateState intermediateState = (IntermediateState) state;
EndConnectionState endConnectionState = (EndConnectionState) intermediateState
.getEndState();
tmp = endConnectionState.getConnectionFactory().createConnectionPage(
intermediateState.getIndex());
} else {
EndConnectionState endConnectionState = (EndConnectionState) state;
tmp = (endConnectionState).getConnectionFactory().createConnectionPage(
endConnectionState.getDescriptor().getWizardPageCount() - 1);
}
this.page = tmp;
// we do the instance check to allow the connection page to
// optionally extend DataPipelinePage.
if (tmp instanceof WorkflowWizardPage) {
((WorkflowWizardPage) tmp).setState(state);
}
if( tmp.getWizard()!=getWizard() ){
tmp.setWizard(getWizard());
}
// add a listener to the workflow to determine when the workflow
// moves back, when this happens, we need to forget about the
// decorated page