First cut of dialog/wizard framework

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2577 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-03-27 10:40:39 +00:00
parent cb69c74d73
commit 9be6273144
25 changed files with 1628 additions and 169 deletions

View File

@@ -0,0 +1,50 @@
package org.alfresco.web.bean.wizard;
import javax.faces.context.FacesContext;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.config.WizardsConfigElement.WizardConfig;
/**
* Bean that manages the wizard framework
*
* @author gavinc
*/
public class WizardManager
{
protected WizardConfig currentWizardConfig;
protected IWizardBean currentWizard;
/**
* Sets the current wizard
*
* @param config The configuration for the wizard to set
*/
public void setCurrentWizard(WizardConfig config)
{
this.currentWizardConfig = config;
String beanName = this.currentWizardConfig.getManagedBean();
this.currentWizard = (IWizardBean)FacesHelper.getManagedBean(
FacesContext.getCurrentInstance(), beanName);
if (this.currentWizard == null)
{
throw new AlfrescoRuntimeException("Failed to find managed bean '" + beanName + "'");
}
// initialise the managed bean
this.currentWizard.init();
}
/**
* Returns the current wizard bean being managed
*
* @return The current managed bean
*/
public IWizardBean getBean()
{
return this.currentWizard;
}
}