You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/11/26 19:06:02 UTC
svn commit: r598364 - in
/myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model:
AbstractWizard.java UIWizard.java Wizard.java
WizardBackwardNavigationStrategy.java
Author: bommel
Date: Mon Nov 26 10:06:01 2007
New Revision: 598364
URL: http://svn.apache.org/viewvc?rev=598364&view=rev
Log:
checkstyle
Modified:
myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/AbstractWizard.java
myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/UIWizard.java
myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/Wizard.java
myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/WizardBackwardNavigationStrategy.java
Modified: myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/AbstractWizard.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/AbstractWizard.java?rev=598364&r1=598363&r2=598364&view=diff
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/AbstractWizard.java (original)
+++ myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/AbstractWizard.java Mon Nov 26 10:06:01 2007
@@ -28,390 +28,395 @@
public abstract class AbstractWizard implements Wizard {
- private static final Log LOG = LogFactory.getLog(AbstractWizard.class);
+ private static final Log LOG = LogFactory.getLog(AbstractWizard.class);
- private static final String WIZARD_FINISH_OUTCOME = "wizard-finish";
+ private static final String WIZARD_FINISH_OUTCOME = "wizard-finish";
- private static final String WIZARD_CANCEL_OUTCOME = "wizard-cancel";
+ private static final String WIZARD_CANCEL_OUTCOME = "wizard-cancel";
- private String defaultOutcome;
+ private String defaultOutcome;
- private int index;
+ private int index;
- private int size;
+ private int size;
- private boolean sizeSet;
+ private boolean sizeSet;
- private boolean started;
+ private boolean started;
- private boolean preparedForFinishing;
+ private boolean preparedForFinishing;
- private boolean backNavImmediate = true; // default, if not set otherwise
+ private boolean backNavImmediate = true; // default, if not set otherwise
- boolean dynamicContent;
+ private boolean dynamicContent;
- private String staticContentSource = null;
+ private String staticContentSource = null;
- private int requestedIndex;
+ private int requestedIndex;
- private WizardBackwardNavigationStrategy backNavStrategy = WizardBackwardNavigationStrategy.NOT_ALLOWED;
+ private WizardBackwardNavigationStrategy backNavStrategy = WizardBackwardNavigationStrategy.NOT_ALLOWED;
- public boolean isStartable() {
- return true;
- }
-
- public final String initialize() {
- if (LOG.isDebugEnabled()) {
- LOG.debug("initialize");
- }
- if (!started) {
- reset();
-
- boolean success = doInitialization();
- if (success) {
- started = true;
- dynamicContent = true;
- index++;
-
- if (!sizeSet) {
- size++;
- }
- }
-
- makeContentDecision(index);
+ public boolean isStartable() {
+ return true;
+ }
- }
- return getDefaultOutcome();
+ public final String initialize() {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("initialize");
}
+ if (!started) {
+ reset();
- /**
- * <p>
- * Hook for the implementation of business logic, after invoking the action {@link AbstractWizard#initialize()}.
- * If the execution of the business logic completed successfully, the method has to return <i>true</i>.
- * Otherwise the method has to return <i>false</i>.
- * </p>
- *
- * @return true if the method completed sucessfully, false if not
- */
-
- public abstract boolean doInitialization();
-
- public final boolean isStartAvailable() {
- return (!started);
- }
-
- public boolean isStarted() {
- return started;
- }
-
- public final String next() {
- LOG.debug("next");
-
- boolean success = doNext();
- if (success) {
- index++;
-
- if (!sizeSet && (size < index)) {
- size++;
- }
-
- }
-
- makeContentDecision(index);
-
- return getDefaultOutcome();
- }
-
- /**
- * <p>
- * Hook for the implementation of business logic, after invoking the action {@link AbstractWizard#next()}.
- * If the execution of the business logic completed successfully, the method has to return <i>true</i>.
- * Otherwise the method has to return <i>false</i>.
- * </p>
- *
- * @return true if the method completed sucessfully, false if not
- */
- public abstract boolean doNext();
-
- /*
- * (non-Javadoc)
- * @see org.apache.myfaces.tobago.model.Wizard#isNextAvailable()
- */
- public final boolean isNextAvailable() {
- return (started && !preparedForFinishing);
- }
-
- public final String previous() {
- LOG.debug("previous");
-
- boolean success = doPrevious();
- if (success) {
-
- if (index > 0) {
- index--;
- }
- if (index == 0) {
- started = false;
- }
- if (preparedForFinishing) {
- preparedForFinishing = false;
- }
-
- switch (backNavStrategy) {
- case DELETE :
- if (!sizeSet) {
- size = index;
- }
- break;
- }
- }
-
- makeContentDecision(index);
-
- return getDefaultOutcome();
- }
-
- /**
- * <p>
- * Hook for the implementation of business logic, after invoking the action {@link AbstractWizard#previous()}.
- * If the execution of the business logic completed successfully, the method has to return <i>true</i>.
- * Otherwise the method has to return <i>false</i>.
- * </p>
- * <p>
- * <b>Note: </b>Even if the action which triggerd the execution of the business logic is <i>immediate</i>,
- * the same view will be showed again if the business logic returned <i>false</i>.
- * </p>
- *
- * @return true if the method completed sucessfully, false if not
- */
- public abstract boolean doPrevious();
-
- public final boolean isPreviousAvailable() {
- return getIndex() > 1 ? true : false;
- }
-
- public boolean isPreviousRendered() {
- return true;
- }
-
- public boolean isBackwardNavigationImmediate() {
- return backNavImmediate;
- }
-
- public void setBackwardNavigationImmediate(boolean immediate) {
- this.backNavImmediate = immediate;
- }
-
- public final void setPreparedForFinishing() {
- this.preparedForFinishing = true;
- }
-
- public final String finish() {
- if (LOG.isDebugEnabled()) {
- LOG.debug("finish");
- }
+ boolean success = doInitialization();
+ if (success) {
+ started = true;
+ dynamicContent = true;
+ index++;
- boolean success = doFinish();
- if (!success) {
- makeContentDecision(index);
- return getDefaultOutcome();
+ if (!sizeSet) {
+ size++;
}
+ }
- reset();
- return WIZARD_FINISH_OUTCOME;
- }
+ makeContentDecision(index);
- /**
- * <p>
- * Hook for the implementation of business logic, after invoking the action {@link AbstractWizard#finish()}.
- * If the execution of the business logic completed successfully, the method has to return <i>true</i>.
- * Otherwise the method has to return <i>false</i>.
- * </p>
- *
- * @return true if the method completed sucessfully, false if not
- */
- public abstract boolean doFinish();
-
- public final boolean isFinishAvailable() {
- return (started && preparedForFinishing);
- }
-
- public final String cancel() {
- if (LOG.isDebugEnabled()) {
- LOG.debug("cancel");
- }
- boolean success = doCancel();
- if (!success) {
- makeContentDecision(index);
- return getDefaultOutcome();
- }
- reset();
- return WIZARD_CANCEL_OUTCOME;
}
+ return getDefaultOutcome();
+ }
- public abstract boolean doCancel();
+ /**
+ * <p>
+ * Hook for the implementation of business logic, after invoking the action {@link AbstractWizard#initialize()}.
+ * If the execution of the business logic completed successfully, the method has to return <i>true</i>.
+ * Otherwise the method has to return <i>false</i>.
+ * </p>
+ *
+ * @return true if the method completed sucessfully, false if not
+ */
- public final void gotoClicked(ActionEvent actionEvent) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("gotoClicked");
- }
- UICommand command = (UICommand) actionEvent.getComponent();
- String id = command.getId();
- String stepIndex = StringUtils.difference("wizard-goto-", id);
- try {
- LOG.info("Goto step " + stepIndex);
- requestedIndex = Integer.valueOf(stepIndex);
- } catch (NumberFormatException lvException) {
- FacesContext.getCurrentInstance().addMessage("", new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "Step index unknown: " + stepIndex));
- }
- }
+ public abstract boolean doInitialization();
- public final String gotoStep() {
- LOG.debug("gotoStep: " + requestedIndex);
+ public final boolean isStartAvailable() {
+ return (!started);
+ }
- boolean success = doGotoStep(requestedIndex);
- if (success) {
- preparedForFinishing = false;
- index = requestedIndex;
-
- switch (backNavStrategy) {
- case DELETE :
- if (!isSizeSet()) {
- size = index;
- }
- break;
- }
- }
+ public boolean isStarted() {
+ return started;
+ }
- makeContentDecision(index);
- // reset requestIndex
- requestedIndex = 0;
- return getDefaultOutcome();
- }
-
- /**
- * <p>
- * Hook for the implementation of business logic, after invoking the action {@link AbstractWizard#gotoStep()}.
- * If the execution of the business logic completed successfully, the method has to return <i>true</i>.
- * Otherwise the method has to return <i>false</i>.
- * </p>
- * <p>
- * <b>Note: </b>Even if the action which triggerd the execution of the business logic is <i>immediate</i>,
- * the same view will be showed again if the business logic returned <i>false</i>.
- * </p>
- *
- * @param indexToShow The view index to show next
- *
- * @return true if the method completed sucessfully, false if not
- */
- public abstract boolean doGotoStep(int indexToShow);
-
- public final int getIndex() {
- return index;
- }
+ public final String next() {
+ LOG.debug("next");
- public final boolean isSizeSet() {
- return sizeSet;
- }
+ boolean success = doNext();
+ if (success) {
+ index++;
- public final void setSize(int size) {
- if (!sizeSet) {
- sizeSet = true;
- this.size = size;
- } else {
- LOG.error("Size for wizard is already set and can not be changed!");
- }
- }
+ if (!sizeSet && (size < index)) {
+ size++;
+ }
- public final int getSize() {
- return size;
}
- public final void resetSize(int size) {
- this.size = size;
- }
+ makeContentDecision(index);
- public final boolean isDynamicContent() {
- return dynamicContent;
- }
+ return getDefaultOutcome();
+ }
- public final void setDynamicContent() {
- this.dynamicContent = true;
- this.staticContentSource = null;
- }
+ /**
+ * <p>
+ * Hook for the implementation of business logic, after invoking the action {@link AbstractWizard#next()}.
+ * If the execution of the business logic completed successfully, the method has to return <i>true</i>.
+ * Otherwise the method has to return <i>false</i>.
+ * </p>
+ *
+ * @return true if the method completed sucessfully, false if not
+ */
+ public abstract boolean doNext();
- public final void setStaticContent(String staticContentSource) {
- this.dynamicContent = false;
- this.staticContentSource = staticContentSource;
- }
+ /*
+ * (non-Javadoc)
+ * @see org.apache.myfaces.tobago.model.Wizard#isNextAvailable()
+ */
+ public final boolean isNextAvailable() {
+ return (started && !preparedForFinishing);
+ }
- public final String getStaticContentSource() {
- return staticContentSource;
- }
+ public final String previous() {
+ LOG.debug("previous");
- public abstract void makeContentDecision(int indexToShow);
+ boolean success = doPrevious();
+ if (success) {
- /*
- * Helper method to reset all attributes
- */
- protected void reset() {
- dynamicContent = true;
- staticContentSource = null;
+ if (index > 0) {
+ index--;
+ }
+ if (index == 0) {
started = false;
+ }
+ if (preparedForFinishing) {
preparedForFinishing = false;
- requestedIndex = 0;
- index = 0;
- if (!sizeSet) {
- size = 0;
- }
- }
-
- public final String getDefaultOutcome() {
- return defaultOutcome;
- }
-
- public final void setDefaultOutcome(String defaultOutcome) {
- this.defaultOutcome = defaultOutcome;
- }
+ }
- /**
- * Return the set backward navigation strategy.
- *
- * @return The actual backward navigation strategy.
- */
- public final WizardBackwardNavigationStrategy getWizardBackwardNavigationStrategy() {
- return this.backNavStrategy;
- }
-
- /**
- * Return the set backward navigation strategy as a String. For possible parameter values see
- * {@link org.apache.myfaces.tobago.model.Wizard}.
- *
- * @return The actual backward navigation strategy as a String.
- */
- public final String getBackwardNavigationStrategy() {
- return this.backNavStrategy.getName();
- }
-
- /**
- * <p>
- * Set the strategy for backward navigation. This should be done only once, e.g. during initialization.
- * For possible parameter values see {@link org.apache.myfaces.tobago.model.Wizard}.
- * </p>
- * <p>
- * <b>Note: </b>If the parameter value is not known by the wizard the backward navigation strategy
- * {@link WizardBackwardNavigationStrategy#NOT_ALLOWED} will be applied.
- * </p>
- *
- * @param strategy The strategy to use for backward navigation
- */
- public final void setBackwardNavigationStrategy(String strategy) {
- try {
- this.backNavStrategy = WizardBackwardNavigationStrategy.getStrategy(strategy);
- } catch (IllegalArgumentException e) {
- this.backNavStrategy = WizardBackwardNavigationStrategy.NOT_ALLOWED;
- LOG.error("WizardBackwardNavigationStrategy is not correctly initialized! Setting strategy to " + backNavStrategy.getName(), e);
- }
+ switch (backNavStrategy) {
+ case DELETE:
+ if (!sizeSet) {
+ size = index;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ makeContentDecision(index);
+
+ return getDefaultOutcome();
+ }
+
+ /**
+ * <p>
+ * Hook for the implementation of business logic, after invoking the action {@link AbstractWizard#previous()}.
+ * If the execution of the business logic completed successfully, the method has to return <i>true</i>.
+ * Otherwise the method has to return <i>false</i>.
+ * </p>
+ * <p>
+ * <b>Note: </b>Even if the action which triggerd the execution of the business logic is <i>immediate</i>,
+ * the same view will be showed again if the business logic returned <i>false</i>.
+ * </p>
+ *
+ * @return true if the method completed sucessfully, false if not
+ */
+ public abstract boolean doPrevious();
+
+ public final boolean isPreviousAvailable() {
+ return getIndex() > 1 ? true : false;
+ }
+
+ public boolean isPreviousRendered() {
+ return true;
+ }
+
+ public boolean isBackwardNavigationImmediate() {
+ return backNavImmediate;
+ }
+
+ public void setBackwardNavigationImmediate(boolean immediate) {
+ this.backNavImmediate = immediate;
+ }
+
+ public final void setPreparedForFinishing() {
+ this.preparedForFinishing = true;
+ }
+
+ public final String finish() {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("finish");
+ }
+
+ boolean success = doFinish();
+ if (!success) {
+ makeContentDecision(index);
+ return getDefaultOutcome();
+ }
+
+ reset();
+ return WIZARD_FINISH_OUTCOME;
+ }
+
+ /**
+ * <p>
+ * Hook for the implementation of business logic, after invoking the action {@link AbstractWizard#finish()}.
+ * If the execution of the business logic completed successfully, the method has to return <i>true</i>.
+ * Otherwise the method has to return <i>false</i>.
+ * </p>
+ *
+ * @return true if the method completed sucessfully, false if not
+ */
+ public abstract boolean doFinish();
+
+ public final boolean isFinishAvailable() {
+ return (started && preparedForFinishing);
+ }
+
+ public final String cancel() {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("cancel");
+ }
+ boolean success = doCancel();
+ if (!success) {
+ makeContentDecision(index);
+ return getDefaultOutcome();
+ }
+ reset();
+ return WIZARD_CANCEL_OUTCOME;
+ }
+
+ public abstract boolean doCancel();
+
+ public final void gotoClicked(ActionEvent actionEvent) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("gotoClicked");
+ }
+ UICommand command = (UICommand) actionEvent.getComponent();
+ String id = command.getId();
+ String stepIndex = StringUtils.difference("wizard-goto-", id);
+ try {
+ LOG.info("Goto step " + stepIndex);
+ requestedIndex = Integer.valueOf(stepIndex);
+ } catch (NumberFormatException lvException) {
+ FacesContext.getCurrentInstance().addMessage("",
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "Step index unknown: " + stepIndex));
+ }
+ }
+
+ public final String gotoStep() {
+ LOG.debug("gotoStep: " + requestedIndex);
+
+ boolean success = doGotoStep(requestedIndex);
+ if (success) {
+ preparedForFinishing = false;
+ index = requestedIndex;
+
+ switch (backNavStrategy) {
+ case DELETE:
+ if (!isSizeSet()) {
+ size = index;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ makeContentDecision(index);
+ // reset requestIndex
+ requestedIndex = 0;
+ return getDefaultOutcome();
+ }
+
+ /**
+ * <p>
+ * Hook for the implementation of business logic, after invoking the action {@link AbstractWizard#gotoStep()}.
+ * If the execution of the business logic completed successfully, the method has to return <i>true</i>.
+ * Otherwise the method has to return <i>false</i>.
+ * </p>
+ * <p>
+ * <b>Note: </b>Even if the action which triggerd the execution of the business logic is <i>immediate</i>,
+ * the same view will be showed again if the business logic returned <i>false</i>.
+ * </p>
+ *
+ * @param indexToShow The view index to show next
+ * @return true if the method completed sucessfully, false if not
+ */
+ public abstract boolean doGotoStep(int indexToShow);
+
+ public final int getIndex() {
+ return index;
+ }
+
+ public final boolean isSizeSet() {
+ return sizeSet;
+ }
+
+ public final void setSize(int size) {
+ if (!sizeSet) {
+ sizeSet = true;
+ this.size = size;
+ } else {
+ LOG.error("Size for wizard is already set and can not be changed!");
+ }
+ }
+
+ public final int getSize() {
+ return size;
+ }
+
+ public final void resetSize(int size) {
+ this.size = size;
+ }
+
+ public final boolean isDynamicContent() {
+ return dynamicContent;
+ }
+
+ public final void setDynamicContent() {
+ this.dynamicContent = true;
+ this.staticContentSource = null;
+ }
+
+ public final void setStaticContent(String staticContentSource) {
+ this.dynamicContent = false;
+ this.staticContentSource = staticContentSource;
+ }
+
+ public final String getStaticContentSource() {
+ return staticContentSource;
+ }
+
+ public abstract void makeContentDecision(int indexToShow);
+
+ /*
+ * Helper method to reset all attributes
+ */
+ protected void reset() {
+ dynamicContent = true;
+ staticContentSource = null;
+ started = false;
+ preparedForFinishing = false;
+ requestedIndex = 0;
+ index = 0;
+ if (!sizeSet) {
+ size = 0;
+ }
+ }
+
+ public final String getDefaultOutcome() {
+ return defaultOutcome;
+ }
+
+ public final void setDefaultOutcome(String defaultOutcome) {
+ this.defaultOutcome = defaultOutcome;
+ }
+
+ /**
+ * Return the set backward navigation strategy.
+ *
+ * @return The actual backward navigation strategy.
+ */
+ public final WizardBackwardNavigationStrategy getWizardBackwardNavigationStrategy() {
+ return this.backNavStrategy;
+ }
+
+ /**
+ * Return the set backward navigation strategy as a String. For possible parameter values see
+ * {@link org.apache.myfaces.tobago.model.Wizard}.
+ *
+ * @return The actual backward navigation strategy as a String.
+ */
+ public final String getBackwardNavigationStrategy() {
+ return this.backNavStrategy.getName();
+ }
+
+ /**
+ * <p>
+ * Set the strategy for backward navigation. This should be done only once, e.g. during initialization.
+ * For possible parameter values see {@link org.apache.myfaces.tobago.model.Wizard}.
+ * </p>
+ * <p>
+ * <b>Note: </b>If the parameter value is not known by the wizard the backward navigation strategy
+ * {@link WizardBackwardNavigationStrategy#NOT_ALLOWED} will be applied.
+ * </p>
+ *
+ * @param strategy The strategy to use for backward navigation
+ */
+ public final void setBackwardNavigationStrategy(String strategy) {
+ try {
+ this.backNavStrategy = WizardBackwardNavigationStrategy.getStrategy(strategy);
+ } catch (IllegalArgumentException e) {
+ this.backNavStrategy = WizardBackwardNavigationStrategy.NOT_ALLOWED;
+ LOG.error("WizardBackwardNavigationStrategy is not correctly initialized! Setting strategy to "
+ + backNavStrategy.getName(), e);
}
+ }
}
Modified: myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/UIWizard.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/UIWizard.java?rev=598364&r1=598363&r2=598364&view=diff
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/UIWizard.java (original)
+++ myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/UIWizard.java Mon Nov 26 10:06:01 2007
@@ -1,13 +1,29 @@
package org.apache.myfaces.tobago.model;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
import org.apache.myfaces.tobago.component.UIPanel;
public interface UIWizard {
- /**
- *
- * @return the current UIPanel with the (dynamic) UIComponents as chlidren
- */
- UIPanel getCurrentComponent();
+ /**
+ * @return the current UIPanel with the (dynamic) UIComponents as chlidren
+ */
+ UIPanel getCurrentComponent();
}
Modified: myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/Wizard.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/Wizard.java?rev=598364&r1=598363&r2=598364&view=diff
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/Wizard.java (original)
+++ myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/Wizard.java Mon Nov 26 10:06:01 2007
@@ -21,105 +21,102 @@
public interface Wizard {
- /*
- * Constants
- */
+ /*
+ * Constants
+ */
- static final String BACKWARD_NAVIGATION_STRATEGY_DELETE = "delete";
+ String BACKWARD_NAVIGATION_STRATEGY_DELETE = "delete";
- static final String BACKWARD_NAVIGATION_STRATEGY_REPLACE = "replace";
+ String BACKWARD_NAVIGATION_STRATEGY_REPLACE = "replace";
- static final String BACKWARD_NAVIGATION_STRATEGY_NOTALLOWED = "notallowed";
+ String BACKWARD_NAVIGATION_STRATEGY_NOTALLOWED = "notallowed";
- /*
- * Methods
- */
+ /*
+ * Methods
+ */
- /**
- *
- * @return A boolean value stating if the content of the wizard is dynamic or a "static" content should be use
- */
- boolean isDynamicContent();
+ /**
+ * @return A boolean value stating if the content of the wizard is dynamic or a "static" content should be use
+ */
+ boolean isDynamicContent();
- /**
- *
- * @return The source-path or Url to the static content to be included
- */
- String getStaticContentSource();
+ /**
+ * @return The source-path or Url to the static content to be included
+ */
+ String getStaticContentSource();
- void setDynamicContent();
+ void setDynamicContent();
- void setStaticContent(String staticContentSource);
+ void setStaticContent(String staticContentSource);
- /**
- * Return the index of the actual wizard view.
- *
- * @return The index of the actual wizard view
- */
- int getIndex();
+ /**
+ * Return the index of the actual wizard view.
+ *
+ * @return The index of the actual wizard view
+ */
+ int getIndex();
- /**
- *
- * @return The size (number) of views in the wizard
- */
- int getSize();
+ /**
+ * @return The size (number) of views in the wizard
+ */
+ int getSize();
- /**
- * Sets the number (size) of views of the wizard.
- * The size should be set only once, e.g. during initialization.
- *
- * @param size The number of views of the wizard
- */
- void setSize(int size);
+ /**
+ * Sets the number (size) of views of the wizard.
+ * The size should be set only once, e.g. during initialization.
+ *
+ * @param size The number of views of the wizard
+ */
+ void setSize(int size);
- String initialize();
+ String initialize();
- // DynamicBean doInitialization();
+ // DynamicBean doInitialization();
- boolean isStarted();
+ boolean isStarted();
- String next();
+ String next();
- // void doNext();
+ // void doNext();
- boolean isNextAvailable();
+ boolean isNextAvailable();
- String previous();
+ String previous();
- // void doPrevious(DynamicBean currentBean);
+ // void doPrevious(DynamicBean currentBean);
- boolean isPreviousAvailable();
+ boolean isPreviousAvailable();
- boolean isPreviousRendered();
+ boolean isPreviousRendered();
- /**
- * Modificator, if backward navigation actions are immediate.
- * The modifactor should be set only once, e.g. during initialization.
- *
- * @return If backward navigation actions are immediate
- */
- boolean isBackwardNavigationImmediate();
+ /**
+ * Modificator, if backward navigation actions are immediate.
+ * The modifactor should be set only once, e.g. during initialization.
+ *
+ * @return If backward navigation actions are immediate
+ */
+ boolean isBackwardNavigationImmediate();
- void setPreparedForFinishing();
+ void setPreparedForFinishing();
- String finish();
+ String finish();
- // void doFinish();
+ // void doFinish();
- boolean isFinishAvailable();
+ boolean isFinishAvailable();
- String cancel();
+ String cancel();
- // void doCancel();
+ // void doCancel();
- void gotoClicked(ActionEvent actionEvent);
+ void gotoClicked(ActionEvent actionEvent);
- String gotoStep();
+ String gotoStep();
- void makeContentDecision(int indexToShow);
+ void makeContentDecision(int indexToShow);
- String getDefaultOutcome();
+ String getDefaultOutcome();
- // void setBackwardNavigationStrategy(String strategy);
+ // void setBackwardNavigationStrategy(String strategy);
}
Modified: myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/WizardBackwardNavigationStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/WizardBackwardNavigationStrategy.java?rev=598364&r1=598363&r2=598364&view=diff
==============================================================================
--- myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/WizardBackwardNavigationStrategy.java (original)
+++ myfaces/tobago/trunk/sandbox/src/main/java/org/apache/myfaces/tobago/model/WizardBackwardNavigationStrategy.java Mon Nov 26 10:06:01 2007
@@ -1,27 +1,45 @@
package org.apache.myfaces.tobago.model;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
public enum WizardBackwardNavigationStrategy {
- DELETE(Wizard.BACKWARD_NAVIGATION_STRATEGY_DELETE), REPLACE(Wizard.BACKWARD_NAVIGATION_STRATEGY_REPLACE), NOT_ALLOWED(
- Wizard.BACKWARD_NAVIGATION_STRATEGY_NOTALLOWED);
+ DELETE(Wizard.BACKWARD_NAVIGATION_STRATEGY_DELETE),
+ REPLACE(Wizard.BACKWARD_NAVIGATION_STRATEGY_REPLACE),
+ NOT_ALLOWED(Wizard.BACKWARD_NAVIGATION_STRATEGY_NOTALLOWED);
- private String name;
+ private String name;
- private WizardBackwardNavigationStrategy(String name) {
- this.name = name;
- }
+ private WizardBackwardNavigationStrategy(String name) {
+ this.name = name;
+ }
- public String getName() {
- return this.name;
- }
+ public String getName() {
+ return this.name;
+ }
- public static WizardBackwardNavigationStrategy getStrategy(String strategy) throws IllegalArgumentException {
- for (WizardBackwardNavigationStrategy ws : WizardBackwardNavigationStrategy.values()) {
- if (ws.name.equalsIgnoreCase(strategy)) {
- return ws;
- }
- }
- throw new IllegalArgumentException("WizardBackwardNavigationStrategy '" + strategy + "' unknown!");
+ public static WizardBackwardNavigationStrategy getStrategy(String strategy) throws IllegalArgumentException {
+ for (WizardBackwardNavigationStrategy ws : WizardBackwardNavigationStrategy.values()) {
+ if (ws.name.equalsIgnoreCase(strategy)) {
+ return ws;
+ }
}
+ throw new IllegalArgumentException("WizardBackwardNavigationStrategy '" + strategy + "' unknown!");
+ }
}