/** * @return whether the step this wrapper is part of is the current step */ private boolean isActiveStep() { return (wizardModel.getActiveStep().equals(WizardStep.this)); } }
/** * @return whether the step this wrapper is part of is the current step */ private final boolean isActiveStep() { return (wizardModel.getActiveStep().equals(WizardStep.this)); } }
/** * Gets whether the finish button should be enabled. * <p> * By default the finish button is available for the last step only. * * @return True if the finish button should be enabled, false otherwise. * * @see #isLastStep(IWizardStep) * @see #finish() */ default boolean isFinishAvailable() { return isLastStep(getActiveStep()); }
/** * Convenience method to get the active step from the model. * * @return The active step */ public final IWizardStep getActiveStep() { return getWizardModel().getActiveStep(); }
/** * Convenience method to get the active step from the model. * * @return The active step */ public final IWizardStep getActiveStep() { return getWizardModel().getActiveStep(); }
@Override protected void onSubmit(AjaxRequestTarget target, DialogButton button) { // If the clicked button was a form-submitter, calls step#applyState() // IWizardModel wizardModel = this.getWizardModel(); wizardModel.getActiveStep().applyState(); }
@Override protected void onSubmit(AjaxRequestTarget target) { /* If the clicked button is a form-submitter, calls step#applyState() */ IWizardModel wizardModel = this.getWizardModel(); wizardModel.getActiveStep().applyState(); }
/** * @see org.apache.wicket.extensions.wizard.WizardButton#onClick() */ @Override public void onClick() { IWizardModel wizardModel = getWizardModel(); wizardModel.getActiveStep().applyState(); wizardModel.last(); } }
@Override public final boolean isEnabled() { IWizardStep activeStep = getWizardModel().getActiveStep(); return (activeStep != null && getWizardModel().isLastStep(activeStep)); }
/** * @see org.apache.wicket.Component#isEnabled() */ @Override public boolean isEnabled() { IWizardStep activeStep = getWizardModel().getActiveStep(); return (activeStep != null && getWizardModel().isLastStep(activeStep)); }
@Override public final boolean isEnabled() { IWizardStep activeStep = getWizardModel().getActiveStep(); return (activeStep != null && getWizardModel().isLastStep(activeStep)); }
@Override public final boolean isVisible() { IWizardStep activeStep = getWizardModel().getActiveStep(); return activeStep != null && getWizardModel().isLastStep(activeStep); }
/** * @see org.apache.wicket.extensions.wizard.WizardButton#onClick() */ @Override public void onClick() { IWizardModel wizardModel = getWizardModel(); wizardModel.getActiveStep().applyState(); wizardModel.last(); } }
@Override public boolean isEnabled() { switch (mode) { case EDIT: case TEMPLATE: return true; case READONLY: return false; default: if (!completed) { final IWizardStep activeStep = getWizardModel().getActiveStep(); completed = (activeStep != null) && getWizardModel().isLastStep(activeStep) && super.isEnabled(); } return completed; } }
@Override protected void onClick(AjaxRequestTarget target, Form form) { IWizardModel wizardModel = getWizardModel(); IWizardStep step = wizardModel.getActiveStep(); // let the step apply any state step.applyState(); // if the step completed after applying the state, move the model onward if (step.isComplete()) { wizardModel.next(); } else { error(getLocalizer().getString( "org.apache.wicket.extensions.wizard.NextButton.step.did.not.complete", this)); } target.add(wizard); } }
@Override protected void onClick(AjaxRequestTarget target, Form form) { IWizardModel wizardModel = getWizardModel(); IWizardStep step = wizardModel.getActiveStep(); // let the step apply any state step.applyState(); // if the step completed after applying the state, move the model onward if (step.isComplete()) { wizardModel.next(); } else { error(getLocalizer().getString( "org.apache.wicket.extensions.wizard.NextButton.step.did.not.complete", this)); } target.addComponent(wizard); }
@Override protected void onClick(AjaxRequestTarget target, Form form) { IWizardModel wizardModel = getWizardModel(); IWizardStep step = wizardModel.getActiveStep(); // let the step apply any state step.applyState(); // if the step completed after applying the state, move the model onward if (step.isComplete()) { wizardModel.next(); } else { error(getLocalizer().getString( "org.apache.wicket.extensions.wizard.NextButton.step.did.not.complete", this)); } target.add(wizard); }
@Override protected void onClick(AjaxRequestTarget target, Form form) { IWizardModel wizardModel = getWizardModel(); IWizardStep step = wizardModel.getActiveStep(); // let the step apply any state step.applyState(); // if the step completed after applying the state, notify the wizard if (step.isComplete()) { getWizardModel().finish(); } else { error(getLocalizer().getString( "org.apache.wicket.extensions.wizard.FinishButton.step.did.not.complete", this)); } // target.addComponent(wizard); } });
@Override protected void onClick(AjaxRequestTarget target, Form form) { IWizardModel wizardModel = getWizardModel(); IWizardStep step = wizardModel.getActiveStep(); // let the step apply any state step.applyState(); // if the step completed after applying the state, notify the wizard if (step.isComplete()) { getWizardModel().finish(); } else { error(getLocalizer().getString( "org.apache.wicket.extensions.wizard.FinishButton.step.did.not.complete", this)); } } }
/** * Called when the wizard needs to be configured. * * @param handler the {@link IPartialPageRequestHandler} */ protected void onConfigure(IPartialPageRequestHandler handler) { // configure buttons // this.btnPrev.setEnabled(this.wizardModel.isPreviousAvailable(), handler); this.btnNext.setEnabled(this.wizardModel.isNextAvailable(), handler); this.btnLast.setEnabled(this.wizardModel.isLastAvailable(), handler); this.btnLast.setVisible(this.wizardModel.isLastVisible(), handler); this.btnCancel.setVisible(this.wizardModel.isCancelVisible(), handler); boolean enabled = this.wizardModel.isLastStep(this.wizardModel.getActiveStep()); this.btnFinish.setEnabled(enabled, handler); // TODO: WizardModelStrategy#isLastStepEnabled() }