Example usage for org.apache.wicket.extensions.wizard WizardModel add

List of usage examples for org.apache.wicket.extensions.wizard WizardModel add

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.wizard WizardModel add.

Prototype

public void add(final IWizardStep step) 

Source Link

Document

Adds the next step to the wizard.

Usage

From source file:au.org.theark.core.web.component.wizard.ArkCommonWizard.java

License:Open Source License

/**
 * Constructor with specified wizard home/index page
 * /*from   w  ww  .j ava 2  s  . co m*/
 * @param id
 *           The component id
 * @param wizardSteps
 *           The custom wizard steps to be used
 */
public ArkCommonWizard(String id, WizardStep[] wizardSteps) {
    super(id);

    // create a model with the specified steps
    WizardModel model = new WizardModel();

    for (int i = 0; i < wizardSteps.length; i++) {
        model.add(wizardSteps[i]);
    }

    // initialize the wizard
    init(model);
}

From source file:au.org.theark.core.web.component.wizard.ArkCommonWizard.java

License:Open Source License

/**
 * Constructor with specified wizard home/index page
 * /*from ww w  .ja v  a  2 s. c  om*/
 * @param id
 *           The component id
 * @param wizardSteps
 *           The custom wizard steps to be used
 */
public ArkCommonWizard(String id, WizardStep[] wizardSteps, WebMarkupContainer resultListContainer,
        WebMarkupContainer wizardPanelContainer, WebMarkupContainer wizardPanelFormContainer,
        WebMarkupContainer searchPanelContainer, AjaxRequestTarget target) {
    super(id);

    this.setResultListContainer(resultListContainer);
    this.setWizardPanelContainer(wizardPanelContainer);
    this.setWizardPanelFormContainer(wizardPanelFormContainer);
    this.setSearchPanelContainer(searchPanelContainer);
    this.setTarget(target);
    this.wizardSteps = new WizardStep[wizardSteps.length];

    // create a model with the specified steps
    WizardModel model = new WizardModel();

    for (int i = 0; i < wizardSteps.length; i++) {
        this.wizardSteps[i] = wizardSteps[i];
        model.add(wizardSteps[i]);
    }

    // initialize the wizard
    init(model);
}

From source file:au.org.theark.core.web.component.wizard.ArkWizardWithPanels.java

License:Open Source License

/**
 * Default Constructor/*w  w  w.j a  v  a 2  s.c  o m*/
 * 
 * @param id
 *           The component id
 */
public ArkWizardWithPanels(String id) {
    super(id);
    wizardIndexClass = ArkWizardIndex.class;

    // create a model with a couple of custom panels
    // still not that spectacular, but at least it
    // will give you a hint of how nice it is to
    // be able to work with custom panels
    WizardModel model = new WizardModel();
    model.add(new Step1());
    model.add(new Step2());
    model.add(new Step3());
    model.add(new Step4());
    model.add(new Step5());

    // initialize the wizard
    init(model);
}

From source file:au.org.theark.core.web.component.wizard.ArkWizardWithPanels.java

License:Open Source License

/**
 * Constructor with specified wizard home/index page
 * //from  w w  w  .  j  a v a  2  s.  c  o  m
 * @param id
 *           The component id
 * @param wizardIndexClass
 *           The home/index page the wizard will go to on finish
 */
public ArkWizardWithPanels(String id, Class<ArkWizardIndex> wizardIndexClass) {
    super(id);

    // create a model with a couple of custom panels
    // still not that spectacular, but at least it
    // will give you a hint of how nice it is to
    // be able to work with custom panels
    WizardModel model = new WizardModel();
    model.add(new Step1());
    model.add(new Step2());
    model.add(new Step3());
    model.add(new Step4());
    model.add(new Step5());

    // initialize the wizard
    init(model);
}

From source file:au.org.theark.core.web.component.wizard.ArkWizardWithPanels.java

License:Open Source License

/**
 * Constructor with specified wizard home/index page
 * //  w  w w .  j av a 2s  .  c  o  m
 * @param id
 *           The component id
 * @param wizardSteps
 *           The custom wizard steps to be used
 */
public ArkWizardWithPanels(String id, WizardStep[] wizardSteps) {
    // FeedbackPanel feedBackPanel, WebMarkupContainer resultListContainer, WebMarkupContainer wizardPanelContainer, WebMarkupContainer
    // wizardPanelFormContainer,WebMarkupContainer searchPanelContainer
    super(id);
    // this.feedBackPanel = feedBackPanel;
    // this.resultListContainer = resultListContainer;
    // this.wizardPanelContainer = wizardPanelContainer;
    // this.wizardPanelFormContainer = wizardPanelFormContainer;
    // this.searchPanelContainer = searchPanelContainer;

    // create a model with the specified steps
    WizardModel model = new WizardModel();

    for (int i = 0; i < wizardSteps.length; i++) {
        model.add(wizardSteps[i]);
    }

    // initialize the wizard
    init(model);
}

From source file:com.evolveum.midpoint.web.page.admin.resources.PageResourceWizard.java

License:Apache License

private void initLayout() {
    WizardModel wizardModel = new WizardModel();
    wizardModel.add(new NameStep(model));
    wizardModel.add(new ConfigurationStep(model));
    wizardModel.add(new SchemaStep(model));
    wizardModel.add(new SchemaHandlingStep(model));
    wizardModel.add(new CapabilityStep(model));
    wizardModel.add(new SynchronizationStep(model));

    Wizard wizard = new Wizard(ID_WIZARD, new Model(wizardModel));
    add(wizard);/*  ww w  .  j  a va  2s  .co  m*/
}

From source file:com.rex.crm.dataport.ImportDataWizard.java

License:Apache License

/**
 * Construct./*from w w  w.  j  a va2  s  .  com*/
 * 
 * @param id
 *            The component id
 */
public ImportDataWizard(String id) {
    super(id);

    setDefaultModel(new CompoundPropertyModel<ImportDataWizard>(this));
    WizardModel model = new WizardModel();
    model.add(new SelectEntityNameStep());
    model.add(new SelectFileStep());

    // initialize the wizard with the wizard model we just built
    init(model);
    getForm().setMultiPart(true);
}

From source file:com.senacor.wbs.web.user.CreateUserWizard.java

License:Apache License

public CreateUserWizard(String id) {
    super(id);/*from ww w .  ja v a 2  s . c  om*/
    user = new User();
    setDefaultModel(new CompoundPropertyModel<CreateUserWizard>(this));
    WizardModel model = new WizardModel();
    model.add(new UserNameStep());
    model.add(new UserDetailsStep());
    model.add(new UserRolesStep());
    model.add(new ConfirmationStep());
    init(model);
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.experiments.ExperimentFormPage.java

License:Apache License

private void setupComponents(final Model<Experiment> model) {
    final ListModel<FileUpload> fileModel = new ListModel<FileUpload>(new ArrayList<FileUpload>());

    ComponentFeedbackMessageFilter filter = new ComponentFeedbackMessageFilter(this);
    getFeedback().setFilter(filter);/*from  w  w w .  j a  v  a  2 s  . c  o  m*/
    EEGDataBaseSession.get().clearCreateExperimentLicenseMap();

    WizardModel wizardModel = new WizardModel();
    wizardModel.add(new AddExperimentScenarioForm(model));
    wizardModel.add(new AddExperimentResultsForm(fileModel));

    Wizard wizard = new Wizard("wizard", wizardModel, false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onFinish() {

            Experiment experiment = model.getObject();

            ResearchGroup group = experiment.getResearchGroup();
            if (group != null && group.isLock()) {
                this.error(ResourceUtils.getString("text.group.lock.experiment.create", group.getTitle()));
                setResponsePage(getPage());
                return;
            }

            Set<DataFile> files = new HashSet<DataFile>();
            try {
                List<FileUpload> fileUploadList = fileModel.getObject();
                // files are required only for create experiment, not editation
                if (experiment.getExperimentId() == 0 && fileUploadList.isEmpty()) {
                    this.error(ResourceUtils.getString("required.dataFile"));
                    setResponsePage(getPage());
                    return;
                }
                for (FileUpload fileUpload : fileUploadList) {
                    DataFile file = new DataFile();
                    file.setMimetype(fileUpload.getContentType());
                    file.setFilename(fileUpload.getClientFileName());
                    file.setFileContentStream(fileUpload.getInputStream());
                    files.add(file);
                }
            } catch (Exception ex) {
                error("File saving failed");
                log.error(ex.getMessage(), ex);
            }

            Person logged = EEGDataBaseSession.get().getLoggedUser();
            experiment.setPersonByOwnerId(logged);

            // persist the experiment
            Integer id = experiment.getExperimentId();
            if (experiment.getExperimentId() != 0) {
                facade.update(experiment);
            } else {
                id = facade.create(experiment);
            }

            // persist licenses
            for (ExperimentLicence expLic : EEGDataBaseSession.get().getCreateExperimentLicenseMap().values()) {
                expLic.setExperiment(experiment);
                experimentLicenseFacade.create(expLic);
            }
            EEGDataBaseSession.get().clearCreateExperimentLicenseMap();

            // persist data files
            for (DataFile file : files) {
                file.setExperiment(experiment);
                fileFacade.create(file);
            }

            setResponsePage(ExperimentsDetailPage.class, PageParametersUtils.getDefaultPageParameters(id));
        }

        @Override
        protected Component newFeedbackPanel(String id) {

            ComponentFeedbackMessageFilter filter = new ComponentFeedbackMessageFilter(this);
            return new FeedbackPanel(id, filter);
        }

        @Override
        protected Component newButtonBar(String id) {
            return new AjaxWizardButtonBar(id, this);
        }

        @Override
        public void onCancel() {
            EEGDataBaseSession.get().clearCreateExperimentLicenseMap();
            throw new RestartResponseAtInterceptPageException(ExperimentsDetailPage.class, getPageParameters());
        }

    };

    add(wizard);
}

From source file:fi.passiba.groups.ui.pages.wizards.biblesession.NewBibleSessionWizard.java

License:Apache License

/**
 * Construct.//ww  w .j a  v a 2s  .  c  o  m
 * 
 * @param id
 *            The component id
 */
public NewBibleSessionWizard(String id) {
    super(id);

    setDefaultModel(new CompoundPropertyModel(this));
    WizardModel model = new WizardModel();
    model.add(new SessionInitializationStep());
    model.add(new VerseSelectionStep());
    model.add(new ConfirmationStep());

    // initialize the wizard with the wizard model we just built
    init(model);
}