mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
50
source/java/org/alfresco/web/bean/wizard/WizardManager.java
Normal file
50
source/java/org/alfresco/web/bean/wizard/WizardManager.java
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user