incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1098945 [4/25] - in /incubator/isis/trunk/viewer: bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/ bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/components/ bdd/common/src/main/java/org/apache/isis/viewer/bdd/common...
Date Tue, 03 May 2011 07:18:38 GMT
Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformAbstractTypeParams.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformAbstractTypeParams.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformAbstractTypeParams.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformAbstractTypeParams.java Tue May  3 07:18:19 2011
@@ -16,183 +16,172 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform;
-
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
-import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
-import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.ScenarioCell;
-
-public abstract class PerformAbstractTypeParams extends PerformAbstract {
-
-	protected static enum Type {
-		PROPERTY(true) {
-			@Override
-			String ensureMemberIsOfType(final ObjectMember m) {
-				return m instanceof OneToOneAssociation ? null
-						: "(not a property)";
-			}
-		},
-		COLLECTION(true) {
-			@Override
-			String ensureMemberIsOfType(final ObjectMember m) {
-				return m instanceof OneToManyAssociation ? null
-						: "(not a collection)";
-			}
-		},
-		ACTION(true) {
-			@Override
-			String ensureMemberIsOfType(final ObjectMember m) {
-				return m instanceof ObjectAction ? null
-						: "(not an action)";
-			}
-		},
-		OBJECT(false) {
-			@Override
-			String ensureMemberIsOfType(final ObjectMember m) {
-				return m != null ? "(not required)" : null;
-			}
-		};
-//		public void ensureMemberIsOfType(
-//				final NakedObjectMember nakedObjectMember,
-//				final StoryCell onMemberCell) throws StoryFailureException {
-//			final String msg = ensureMemberIsOfType(nakedObjectMember);
-//			if (msg != null) {
-//				throw new StoryFailureException(onMemberCell, msg);
-//			}
-//		}
-
-		abstract String ensureMemberIsOfType(ObjectMember m);
-
-		private final boolean representsMember;
-
-		private Type(final boolean representsMember) {
-			this.representsMember = representsMember;
-		}
-
-		public boolean representsMember() {
-			return representsMember;
-		}
-	}
-
-	protected static enum NumParameters {
-		ZERO, ONE, UNLIMITED;
-	}
-
-	private final Type type;
-	private final NumParameters numParameters;
-
-	public PerformAbstractTypeParams(final String key, final Type type,
-			final NumParameters numParameters, final Perform.Mode mode) {
-		super(key, mode);
-		this.type = type;
-		this.numParameters = numParameters;
-	}
-
-	@Override
-    public boolean requiresMember() {
-		return type.representsMember();
-	}
-
-	/**
-	 * Can be overridden, but provides basic checking that member is of correct
-	 * type and, if taking {@link NumParameters#ZERO zero} or
-	 * {@link NumParameters#ONE one} parameter, that the correct number of
-	 * actual arguments match.
-	 */
-	@Override
-    public void perform(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-
-		CellBinding onMemberBinding = performContext.getPeer()
-				.getOnMemberBinding();
-		final ScenarioCell onMemberCell = onMemberBinding.getCurrentCell();
-
-		final String reason = type.ensureMemberIsOfType(performContext
-				.getObjectMember());
-		if (reason != null) {
-			throw ScenarioBoundValueException.current(onMemberBinding, 
-					reason);
-		}
-
-		if (type.representsMember()) {
-
-			if (getMode() == Perform.Mode.TEST) {
-		        
-		        performContext.ensureAvailableForDeploymentType(onMemberBinding, onMemberCell);
-
-				performContext.ensureVisible(onMemberBinding, onMemberCell);
-				performContext.ensureUsable(onMemberBinding, onMemberCell);
-			}
-
-			// validate we have correct number of parameters if zero or one.
-			final int numArgs = performContext.getArgumentCells().size();
-
-			// don't do these two checks, because there could be additional
-			// cells due to previous or subsequent rows in the table 
-			// (with the author keeping this 'tidy')
-
-			// if (numParameters == NumParameters.ZERO && length > 0) {
-			// ... "(no arguments required)"
-			// }
-			// if (numParameters == NumParameters.ONE && length > 1) {
-			// ... "(need just 1 argument)"
-			// }
-
-			// okay to do this check, though
-			if (numParameters == NumParameters.ONE && numArgs < 1) {
-				throw ScenarioBoundValueException.current(onMemberBinding, 
-						"(need one argument)");
-			}
-		}
-
-		doHandle(performContext);
-	}
-
-	/**
-	 * Hook method that does nothing; should be overridden if
-	 * {@link #perform(PerformContextForFitNesse) handle(...)} method has not
-	 * been.
-	 */
-	protected void doHandle(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-		// does nothing
-	}
-
-//	/**
-//	 * Convenience; delegates to
-//	 * {@link Type#ensureMemberIsOfType(NakedObjectMember)} and downcasts.
-//	 */
-//	protected OneToOneAssociation ensureMemberIsProperty(
-//			final NakedObjectMember nakedObjectMember,
-//			final StoryCell usingMemberCell) throws StoryFailureException {
-//		type.ensureMemberIsOfType(nakedObjectMember, usingMemberCell);
-//		return (OneToOneAssociation) nakedObjectMember;
-//	}
-//
-//	/**
-//	 * Convenience; delegates to
-//	 * {@link Type#ensureMemberIsOfType(NakedObjectMember)} and downcasts.
-//	 */
-//	protected OneToManyAssociation ensureMemberIsCollection(
-//			final NakedObjectMember nakedObjectMember,
-//			final StoryCell usingMemberCell) throws StoryFailureException {
-//		type.ensureMemberIsOfType(nakedObjectMember, usingMemberCell);
-//		return (OneToManyAssociation) nakedObjectMember;
-//	}
-//
-//	/**
-//	 * Convenience; delegates to
-//	 * {@link Type#ensureMemberIsOfType(NakedObjectMember)} and downcasts.
-//	 */
-//	protected NakedObjectAction ensureMemberIsAction(
-//			final NakedObjectMember nakedObjectMember,
-//			final StoryCell usingMemberCell) throws StoryFailureException {
-//		type.ensureMemberIsOfType(nakedObjectMember, usingMemberCell);
-//		return (NakedObjectAction) nakedObjectMember;
-//	}
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform;
+
+import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
+import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
+import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
+import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.ScenarioCell;
+
+public abstract class PerformAbstractTypeParams extends PerformAbstract {
+
+    protected static enum Type {
+        PROPERTY(true) {
+            @Override
+            String ensureMemberIsOfType(final ObjectMember m) {
+                return m instanceof OneToOneAssociation ? null : "(not a property)";
+            }
+        },
+        COLLECTION(true) {
+            @Override
+            String ensureMemberIsOfType(final ObjectMember m) {
+                return m instanceof OneToManyAssociation ? null : "(not a collection)";
+            }
+        },
+        ACTION(true) {
+            @Override
+            String ensureMemberIsOfType(final ObjectMember m) {
+                return m instanceof ObjectAction ? null : "(not an action)";
+            }
+        },
+        OBJECT(false) {
+            @Override
+            String ensureMemberIsOfType(final ObjectMember m) {
+                return m != null ? "(not required)" : null;
+            }
+        };
+        // public void ensureMemberIsOfType(
+        // final NakedObjectMember nakedObjectMember,
+        // final StoryCell onMemberCell) throws StoryFailureException {
+        // final String msg = ensureMemberIsOfType(nakedObjectMember);
+        // if (msg != null) {
+        // throw new StoryFailureException(onMemberCell, msg);
+        // }
+        // }
+
+        abstract String ensureMemberIsOfType(ObjectMember m);
+
+        private final boolean representsMember;
+
+        private Type(final boolean representsMember) {
+            this.representsMember = representsMember;
+        }
+
+        public boolean representsMember() {
+            return representsMember;
+        }
+    }
+
+    protected static enum NumParameters {
+        ZERO, ONE, UNLIMITED;
+    }
+
+    private final Type type;
+    private final NumParameters numParameters;
+
+    public PerformAbstractTypeParams(final String key, final Type type, final NumParameters numParameters,
+        final Perform.Mode mode) {
+        super(key, mode);
+        this.type = type;
+        this.numParameters = numParameters;
+    }
+
+    @Override
+    public boolean requiresMember() {
+        return type.representsMember();
+    }
+
+    /**
+     * Can be overridden, but provides basic checking that member is of correct type and, if taking
+     * {@link NumParameters#ZERO zero} or {@link NumParameters#ONE one} parameter, that the correct number of actual
+     * arguments match.
+     */
+    @Override
+    public void perform(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        final CellBinding onMemberBinding = performContext.getPeer().getOnMemberBinding();
+        final ScenarioCell onMemberCell = onMemberBinding.getCurrentCell();
+
+        final String reason = type.ensureMemberIsOfType(performContext.getObjectMember());
+        if (reason != null) {
+            throw ScenarioBoundValueException.current(onMemberBinding, reason);
+        }
+
+        if (type.representsMember()) {
+
+            if (getMode() == Perform.Mode.TEST) {
+
+                performContext.ensureAvailableForDeploymentType(onMemberBinding, onMemberCell);
+
+                performContext.ensureVisible(onMemberBinding, onMemberCell);
+                performContext.ensureUsable(onMemberBinding, onMemberCell);
+            }
+
+            // validate we have correct number of parameters if zero or one.
+            final int numArgs = performContext.getArgumentCells().size();
+
+            // don't do these two checks, because there could be additional
+            // cells due to previous or subsequent rows in the table
+            // (with the author keeping this 'tidy')
+
+            // if (numParameters == NumParameters.ZERO && length > 0) {
+            // ... "(no arguments required)"
+            // }
+            // if (numParameters == NumParameters.ONE && length > 1) {
+            // ... "(need just 1 argument)"
+            // }
+
+            // okay to do this check, though
+            if (numParameters == NumParameters.ONE && numArgs < 1) {
+                throw ScenarioBoundValueException.current(onMemberBinding, "(need one argument)");
+            }
+        }
+
+        doHandle(performContext);
+    }
+
+    /**
+     * Hook method that does nothing; should be overridden if {@link #perform(PerformContextForFitNesse) handle(...)}
+     * method has not been.
+     */
+    protected void doHandle(final PerformContext performContext) throws ScenarioBoundValueException {
+        // does nothing
+    }
+
+    // /**
+    // * Convenience; delegates to
+    // * {@link Type#ensureMemberIsOfType(NakedObjectMember)} and downcasts.
+    // */
+    // protected OneToOneAssociation ensureMemberIsProperty(
+    // final NakedObjectMember nakedObjectMember,
+    // final StoryCell usingMemberCell) throws StoryFailureException {
+    // type.ensureMemberIsOfType(nakedObjectMember, usingMemberCell);
+    // return (OneToOneAssociation) nakedObjectMember;
+    // }
+    //
+    // /**
+    // * Convenience; delegates to
+    // * {@link Type#ensureMemberIsOfType(NakedObjectMember)} and downcasts.
+    // */
+    // protected OneToManyAssociation ensureMemberIsCollection(
+    // final NakedObjectMember nakedObjectMember,
+    // final StoryCell usingMemberCell) throws StoryFailureException {
+    // type.ensureMemberIsOfType(nakedObjectMember, usingMemberCell);
+    // return (OneToManyAssociation) nakedObjectMember;
+    // }
+    //
+    // /**
+    // * Convenience; delegates to
+    // * {@link Type#ensureMemberIsOfType(NakedObjectMember)} and downcasts.
+    // */
+    // protected NakedObjectAction ensureMemberIsAction(
+    // final NakedObjectMember nakedObjectMember,
+    // final StoryCell usingMemberCell) throws StoryFailureException {
+    // type.ensureMemberIsOfType(nakedObjectMember, usingMemberCell);
+    // return (NakedObjectAction) nakedObjectMember;
+    // }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformContext.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformContext.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformContext.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformContext.java Tue May  3 07:18:19 2011
@@ -34,94 +34,87 @@ import org.apache.isis.viewer.bdd.common
 import org.apache.isis.viewer.bdd.common.parsers.DateParser;
 
 /**
- * Represents the context for a single {@link Perform} command; in effect, a row
- * of a table.
+ * Represents the context for a single {@link Perform} command; in effect, a row of a table.
  */
 public class PerformContext {
 
-	private final UsingIsisViewerPeer peer;
+    private final UsingIsisViewerPeer peer;
 
-	private final ObjectAdapter onAdapter;
-	private final ObjectMember objectMember;
-	private final List<ScenarioCell> argumentCells;
-
-	public PerformContext(final UsingIsisViewerPeer peer,
-			final ObjectAdapter onAdapter,
-			final ObjectMember objectMember,
-			final List<ScenarioCell> argumentCells) {
-		this.onAdapter = onAdapter;
-		this.objectMember = objectMember;
-		this.peer = peer;
-		this.argumentCells = argumentCells;
-	}
-
-	public UsingIsisViewerPeer getPeer() {
-		return peer;
-	}
-
-	public ObjectAdapter getOnAdapter() {
-		return onAdapter;
-	}
-
-	public ObjectMember getObjectMember() {
-		return objectMember;
-	}
-
-	public List<ScenarioCell> getArgumentCells() {
-		return argumentCells;
-	}
-
-	public Consent visibleMemberConsent() {
-		return getObjectMember().isVisible(getAuthenticationSession(),
-				getOnAdapter());
-	}
-
-	public Consent usableMemberConsent() {
-		return getObjectMember().isUsable(getAuthenticationSession(),
-				getOnAdapter());
-	}
-
-	public Consent validObjectConsent() {
-		final ObjectAdapter onAdapter = getOnAdapter();
-		return onAdapter.getSpecification().isValid(onAdapter);
-	}
-
-	public void ensureVisible(CellBinding onMemberBinding, final ScenarioCell onMemberCell)
-	throws ScenarioBoundValueException {
-		final Consent visible = objectMember.isVisible(getAuthenticationSession(),
-				getOnAdapter());
-		if (visible.isVetoed()) {
-			throw ScenarioBoundValueException.current(onMemberBinding, "(not visible)");
-		}
-	}
-	
-	public void ensureUsable(CellBinding onMemberBinding, final ScenarioCell onMemberCell)
-			throws ScenarioBoundValueException {
-		final Consent usable = objectMember.isUsable(getAuthenticationSession(),
-				getOnAdapter());
-		if (usable.isVetoed()) {
-			throw ScenarioBoundValueException.current(onMemberBinding, "(not usable)");
-		}
-	}
-	
-    public void ensureAvailableForDeploymentType(CellBinding onMemberBinding, ScenarioCell onMemberCell) throws ScenarioBoundValueException {
-        DeploymentType deploymentType = this.peer.getDeploymentType();
-        
-        boolean isExploration = objectMember.getFacet(ExplorationFacet.class) != null;
-        if(isExploration && !deploymentType.isExploring() ) {
+    private final ObjectAdapter onAdapter;
+    private final ObjectMember objectMember;
+    private final List<ScenarioCell> argumentCells;
+
+    public PerformContext(final UsingIsisViewerPeer peer, final ObjectAdapter onAdapter,
+        final ObjectMember objectMember, final List<ScenarioCell> argumentCells) {
+        this.onAdapter = onAdapter;
+        this.objectMember = objectMember;
+        this.peer = peer;
+        this.argumentCells = argumentCells;
+    }
+
+    public UsingIsisViewerPeer getPeer() {
+        return peer;
+    }
+
+    public ObjectAdapter getOnAdapter() {
+        return onAdapter;
+    }
+
+    public ObjectMember getObjectMember() {
+        return objectMember;
+    }
+
+    public List<ScenarioCell> getArgumentCells() {
+        return argumentCells;
+    }
+
+    public Consent visibleMemberConsent() {
+        return getObjectMember().isVisible(getAuthenticationSession(), getOnAdapter());
+    }
+
+    public Consent usableMemberConsent() {
+        return getObjectMember().isUsable(getAuthenticationSession(), getOnAdapter());
+    }
+
+    public Consent validObjectConsent() {
+        final ObjectAdapter onAdapter = getOnAdapter();
+        return onAdapter.getSpecification().isValid(onAdapter);
+    }
+
+    public void ensureVisible(final CellBinding onMemberBinding, final ScenarioCell onMemberCell)
+        throws ScenarioBoundValueException {
+        final Consent visible = objectMember.isVisible(getAuthenticationSession(), getOnAdapter());
+        if (visible.isVetoed()) {
+            throw ScenarioBoundValueException.current(onMemberBinding, "(not visible)");
+        }
+    }
+
+    public void ensureUsable(final CellBinding onMemberBinding, final ScenarioCell onMemberCell)
+        throws ScenarioBoundValueException {
+        final Consent usable = objectMember.isUsable(getAuthenticationSession(), getOnAdapter());
+        if (usable.isVetoed()) {
+            throw ScenarioBoundValueException.current(onMemberBinding, "(not usable)");
+        }
+    }
+
+    public void ensureAvailableForDeploymentType(final CellBinding onMemberBinding, final ScenarioCell onMemberCell)
+        throws ScenarioBoundValueException {
+        final DeploymentType deploymentType = this.peer.getDeploymentType();
+
+        final boolean isExploration = objectMember.getFacet(ExplorationFacet.class) != null;
+        if (isExploration && !deploymentType.isExploring()) {
             throw ScenarioBoundValueException.current(onMemberBinding, "(not running in exploration mode)");
         }
-        
-        boolean isPrototype = objectMember.getFacet(PrototypeFacet.class) != null;
-        if(isPrototype && !deploymentType.isPrototyping()) {
+
+        final boolean isPrototype = objectMember.getFacet(PrototypeFacet.class) != null;
+        if (isPrototype && !deploymentType.isPrototyping()) {
             throw ScenarioBoundValueException.current(onMemberBinding, "(not running in prototype mode)");
         }
     }
 
-
-	protected AuthenticationSession getAuthenticationSession() {
-		return getPeer().getAuthenticationSession();
-	}
+    protected AuthenticationSession getAuthenticationSession() {
+        return getPeer().getAuthenticationSession();
+    }
 
     public DateParser getDateParser() {
         return peer.getDateParser();

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformOwner.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformOwner.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformOwner.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/PerformOwner.java Tue May  3 07:18:19 2011
@@ -16,9 +16,8 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform;
-
-
-public interface PerformOwner {
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform;
+
+public interface PerformOwner {
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/RemoveFromCollection.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/RemoveFromCollection.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/RemoveFromCollection.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/RemoveFromCollection.java Tue May  3 07:18:19 2011
@@ -16,82 +16,72 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform;
-
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.consent.InteractionInvocationMethod;
-import org.apache.isis.core.metamodel.facets.collections.modify.CollectionRemoveFromFacet;
-import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
-import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.ScenarioCell;
-
-public class RemoveFromCollection extends PerformAbstractTypeParams {
-
-	private ObjectAdapter result;
-
-	public RemoveFromCollection(final Perform.Mode mode) {
-		super("remove from collection", Type.COLLECTION, NumParameters.ONE,
-				mode);
-	}
-
-	@Override
-	public void doHandle(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-
-		final ObjectAdapter onAdapter = performContext.getOnAdapter();
-		final ObjectMember nakedObjectMember = performContext
-				.getObjectMember();
-		final CellBinding onMemberBinding = performContext.getPeer()
-				.getOnMemberBinding();
-		@SuppressWarnings("unused")
-		final ScenarioCell onMemberCell = onMemberBinding.getCurrentCell();
-
-		final List<ScenarioCell> argumentCells = performContext.getArgumentCells();
-
-		final OneToManyAssociation otma = (OneToManyAssociation) nakedObjectMember;
-
-		// safe since guaranteed by superclass
-		CellBinding arg0Binding = performContext.getPeer().getArg0Binding();
-		final ScenarioCell arg0Cell = argumentCells.get(0);
-		final String toRemove = arg0Cell.getText();
-
-		final CollectionRemoveFromFacet removeFromFacet = nakedObjectMember
-				.getFacet(CollectionRemoveFromFacet.class);
-		if (removeFromFacet == null) {
-			throw ScenarioBoundValueException.current(onMemberBinding,
-					"(cannot remove from collection)");
-		}
-
-		final ObjectAdapter toRemoveAdapter = performContext.getPeer()
-				.getAliasRegistry().getAliased(toRemove);
-		if (toRemoveAdapter == null) {
-			throw ScenarioBoundValueException.current(arg0Binding, "(unknown alias)");
-		}
-
-		// validate argument
-		otma
-				.createValidateAddInteractionContext(getSession(),
-						InteractionInvocationMethod.BY_USER, onAdapter,
-						toRemoveAdapter);
-		final Consent validToRemove = otma.isValidToRemove(onAdapter,
-				toRemoveAdapter);
-		if (validToRemove.isVetoed()) {
-			throw ScenarioBoundValueException.current(onMemberBinding, validToRemove
-					.getReason());
-		}
-
-		// remove
-		removeFromFacet.remove(onAdapter, toRemoveAdapter);
-
-	}
-
-	public ObjectAdapter getResult() {
-		return result;
-	}
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform;
+
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.core.metamodel.consent.InteractionInvocationMethod;
+import org.apache.isis.core.metamodel.facets.collections.modify.CollectionRemoveFromFacet;
+import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
+import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.ScenarioCell;
+
+public class RemoveFromCollection extends PerformAbstractTypeParams {
+
+    private ObjectAdapter result;
+
+    public RemoveFromCollection(final Perform.Mode mode) {
+        super("remove from collection", Type.COLLECTION, NumParameters.ONE, mode);
+    }
+
+    @Override
+    public void doHandle(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        final ObjectAdapter onAdapter = performContext.getOnAdapter();
+        final ObjectMember nakedObjectMember = performContext.getObjectMember();
+        final CellBinding onMemberBinding = performContext.getPeer().getOnMemberBinding();
+        @SuppressWarnings("unused")
+        final ScenarioCell onMemberCell = onMemberBinding.getCurrentCell();
+
+        final List<ScenarioCell> argumentCells = performContext.getArgumentCells();
+
+        final OneToManyAssociation otma = (OneToManyAssociation) nakedObjectMember;
+
+        // safe since guaranteed by superclass
+        final CellBinding arg0Binding = performContext.getPeer().getArg0Binding();
+        final ScenarioCell arg0Cell = argumentCells.get(0);
+        final String toRemove = arg0Cell.getText();
+
+        final CollectionRemoveFromFacet removeFromFacet = nakedObjectMember.getFacet(CollectionRemoveFromFacet.class);
+        if (removeFromFacet == null) {
+            throw ScenarioBoundValueException.current(onMemberBinding, "(cannot remove from collection)");
+        }
+
+        final ObjectAdapter toRemoveAdapter = performContext.getPeer().getAliasRegistry().getAliased(toRemove);
+        if (toRemoveAdapter == null) {
+            throw ScenarioBoundValueException.current(arg0Binding, "(unknown alias)");
+        }
+
+        // validate argument
+        otma.createValidateAddInteractionContext(getSession(), InteractionInvocationMethod.BY_USER, onAdapter,
+            toRemoveAdapter);
+        final Consent validToRemove = otma.isValidToRemove(onAdapter, toRemoveAdapter);
+        if (validToRemove.isVetoed()) {
+            throw ScenarioBoundValueException.current(onMemberBinding, validToRemove.getReason());
+        }
+
+        // remove
+        removeFromFacet.remove(onAdapter, toRemoveAdapter);
+
+    }
+
+    @Override
+    public ObjectAdapter getResult() {
+        return result;
+    }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/SaveObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/SaveObject.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/SaveObject.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/SaveObject.java Tue May  3 07:18:19 2011
@@ -16,56 +16,56 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-
-public class SaveObject extends PerformAbstractTypeParams {
-
-    private ObjectAdapter result;
-
-    public SaveObject(final Perform.Mode mode) {
-        super("save", Type.OBJECT, NumParameters.ZERO, mode);
-    }
-
-    @Override
-    public void doHandle(final PerformContext performContext) throws ScenarioBoundValueException {
-
-        final ObjectAdapter onAdapter = performContext.getOnAdapter();
-
-        final Consent valid = onAdapter.getSpecification().isValid(onAdapter);
-
-        CellBinding performBinding = performContext.getPeer().getPerformBinding();
-        if (valid.isVetoed()) {
-            throw ScenarioBoundValueException.current(performBinding, valid.getReason());
-        }
-
-        if (onAdapter.isPersistent()) {
-            throw ScenarioBoundValueException.current(performBinding, "(already persistent)");
-        }
-
-        // persist
-
-        // xactn mgmt now performed by PersistenceSession#makePersistent
-        // getOwner().getTransactionManager().startTransaction();
-        getPersistenceSession().makePersistent(onAdapter);
-        // getOwner().getTransactionManager().endTransaction();
-
-        // all OK.
-    }
-
-    protected PersistenceSession getPersistenceSession() {
-        return IsisContext.getPersistenceSession();
-    }
-
-    @Override
-    public ObjectAdapter getResult() {
-        return result;
-    }
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+
+public class SaveObject extends PerformAbstractTypeParams {
+
+    private ObjectAdapter result;
+
+    public SaveObject(final Perform.Mode mode) {
+        super("save", Type.OBJECT, NumParameters.ZERO, mode);
+    }
+
+    @Override
+    public void doHandle(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        final ObjectAdapter onAdapter = performContext.getOnAdapter();
+
+        final Consent valid = onAdapter.getSpecification().isValid(onAdapter);
+
+        final CellBinding performBinding = performContext.getPeer().getPerformBinding();
+        if (valid.isVetoed()) {
+            throw ScenarioBoundValueException.current(performBinding, valid.getReason());
+        }
+
+        if (onAdapter.isPersistent()) {
+            throw ScenarioBoundValueException.current(performBinding, "(already persistent)");
+        }
+
+        // persist
+
+        // xactn mgmt now performed by PersistenceSession#makePersistent
+        // getOwner().getTransactionManager().startTransaction();
+        getPersistenceSession().makePersistent(onAdapter);
+        // getOwner().getTransactionManager().endTransaction();
+
+        // all OK.
+    }
+
+    protected PersistenceSession getPersistenceSession() {
+        return IsisContext.getPersistenceSession();
+    }
+
+    @Override
+    public ObjectAdapter getResult() {
+        return result;
+    }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/SetProperty.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/SetProperty.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/SetProperty.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/SetProperty.java Tue May  3 07:18:19 2011
@@ -16,71 +16,65 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform;
-
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.facets.properties.modify.PropertySetterFacet;
-import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
-import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.ScenarioCell;
-
-public class SetProperty extends PerformAbstractTypeParams {
-
-	private ObjectAdapter result;
-
-	public SetProperty(final Perform.Mode mode) {
-		super("set property", Type.PROPERTY, NumParameters.ONE, mode);
-	}
-
-	@Override
-	public void doHandle(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-
-		final ObjectAdapter onAdapter = performContext.getOnAdapter();
-		final ObjectMember nakedObjectMember = performContext
-				.getObjectMember();
-		final List<ScenarioCell> argumentCells = performContext.getArgumentCells();
-
-		final OneToOneAssociation otoa = (OneToOneAssociation) nakedObjectMember;
-
-		// set
-		final PropertySetterFacet setterFacet = otoa
-				.getFacet(PropertySetterFacet.class);
-		if (setterFacet == null) {
-			CellBinding onMemberBinding = performContext.getPeer()
-					.getOnMemberBinding();
-			throw ScenarioBoundValueException.current(onMemberBinding, 
-					"(cannot set)");
-		}
-
-		// safe to obtain since guaranteed by superclass
-		CellBinding arg0Binding = performContext.getPeer().getArg0Binding();
-		final ScenarioCell arg0Cell = argumentCells.get(0);
-
-		// obtain existing as 'context' (used if this is a parsed @Value)
-		final ObjectAdapter contextAdapter = otoa.get(onAdapter);
-
-		// validate parameter
-		final ObjectAdapter toSetAdapter = performContext.getPeer().getAdapter(
-				contextAdapter, otoa.getSpecification(), arg0Binding, arg0Cell);
-		final Consent validConsent = otoa.isAssociationValid(onAdapter,
-				toSetAdapter);
-		if (validConsent.isVetoed()) {
-			throw ScenarioBoundValueException.current(arg0Binding, validConsent
-					.getReason());
-		}
-
-		setterFacet.setProperty(onAdapter, toSetAdapter);
-
-	}
-
-	public ObjectAdapter getResult() {
-		return result;
-	}
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform;
+
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.core.metamodel.facets.properties.modify.PropertySetterFacet;
+import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
+import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.ScenarioCell;
+
+public class SetProperty extends PerformAbstractTypeParams {
+
+    private ObjectAdapter result;
+
+    public SetProperty(final Perform.Mode mode) {
+        super("set property", Type.PROPERTY, NumParameters.ONE, mode);
+    }
+
+    @Override
+    public void doHandle(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        final ObjectAdapter onAdapter = performContext.getOnAdapter();
+        final ObjectMember nakedObjectMember = performContext.getObjectMember();
+        final List<ScenarioCell> argumentCells = performContext.getArgumentCells();
+
+        final OneToOneAssociation otoa = (OneToOneAssociation) nakedObjectMember;
+
+        // set
+        final PropertySetterFacet setterFacet = otoa.getFacet(PropertySetterFacet.class);
+        if (setterFacet == null) {
+            final CellBinding onMemberBinding = performContext.getPeer().getOnMemberBinding();
+            throw ScenarioBoundValueException.current(onMemberBinding, "(cannot set)");
+        }
+
+        // safe to obtain since guaranteed by superclass
+        final CellBinding arg0Binding = performContext.getPeer().getArg0Binding();
+        final ScenarioCell arg0Cell = argumentCells.get(0);
+
+        // obtain existing as 'context' (used if this is a parsed @Value)
+        final ObjectAdapter contextAdapter = otoa.get(onAdapter);
+
+        // validate parameter
+        final ObjectAdapter toSetAdapter =
+            performContext.getPeer().getAdapter(contextAdapter, otoa.getSpecification(), arg0Binding, arg0Cell);
+        final Consent validConsent = otoa.isAssociationValid(onAdapter, toSetAdapter);
+        if (validConsent.isVetoed()) {
+            throw ScenarioBoundValueException.current(arg0Binding, validConsent.getReason());
+        }
+
+        setterFacet.setProperty(onAdapter, toSetAdapter);
+
+    }
+
+    @Override
+    public ObjectAdapter getResult() {
+        return result;
+    }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsContainment.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsContainment.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsContainment.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsContainment.java Tue May  3 07:18:19 2011
@@ -16,42 +16,38 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-
-
-/**
- * Parameterizes {@link ThatSubcommand}s.
- */
-public enum AssertsContainment {
-
-    CONTAINS("contains", true, "(does not contain)"),
-    DOES_NOT_CONTAIN(
-            "does not contain", false, "(contains)");
-
-    private final String key;
-    private final boolean contains;
-    private final String errorMsgIfNotSatisfied;
-
-    private AssertsContainment(String key, boolean contains, String errorMsgIfNotSatisfied) {
-        this.key = key;
-        this.contains = contains;
-        this.errorMsgIfNotSatisfied = errorMsgIfNotSatisfied;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public boolean doesContain() {
-        return contains;
-    }
-
-    public boolean isSatisfiedBy(final boolean contains) {
-        return this.contains == contains;
-    }
-
-    public String getErrorMsgIfNotSatisfied() {
-        return errorMsgIfNotSatisfied;
-    }
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+/**
+ * Parameterizes {@link ThatSubcommand}s.
+ */
+public enum AssertsContainment {
+
+    CONTAINS("contains", true, "(does not contain)"), DOES_NOT_CONTAIN("does not contain", false, "(contains)");
+
+    private final String key;
+    private final boolean contains;
+    private final String errorMsgIfNotSatisfied;
+
+    private AssertsContainment(final String key, final boolean contains, final String errorMsgIfNotSatisfied) {
+        this.key = key;
+        this.contains = contains;
+        this.errorMsgIfNotSatisfied = errorMsgIfNotSatisfied;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public boolean doesContain() {
+        return contains;
+    }
+
+    public boolean isSatisfiedBy(final boolean contains) {
+        return this.contains == contains;
+    }
+
+    public String getErrorMsgIfNotSatisfied() {
+        return errorMsgIfNotSatisfied;
+    }
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsEmpty.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsEmpty.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsEmpty.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsEmpty.java Tue May  3 07:18:19 2011
@@ -16,42 +16,38 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-
-
-/**
- * Parameterizes {@link ThatSubcommand}s.
- */
-public enum AssertsEmpty {
-
-    EMPTY("is empty", true, "(not empty)"), 
-    NOT_EMPTY("is not empty", false,
-            "(empty)");
-
-    private final String key;
-    private final boolean empty;
-    private final String errorMsgIfNotSatisfied;
-
-    AssertsEmpty(String key, boolean empty, String errorMsgIfNotSatisfied) {
-        this.key = key;
-        this.empty = empty;
-        this.errorMsgIfNotSatisfied = errorMsgIfNotSatisfied;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public boolean isEmpty() {
-        return empty;
-    }
-
-    public boolean isSatisfiedBy(final boolean empty) {
-        return this.empty == empty;
-    }
-
-    public String getErrorMsgIfNotSatisfied() {
-        return errorMsgIfNotSatisfied;
-    }
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+/**
+ * Parameterizes {@link ThatSubcommand}s.
+ */
+public enum AssertsEmpty {
+
+    EMPTY("is empty", true, "(not empty)"), NOT_EMPTY("is not empty", false, "(empty)");
+
+    private final String key;
+    private final boolean empty;
+    private final String errorMsgIfNotSatisfied;
+
+    AssertsEmpty(final String key, final boolean empty, final String errorMsgIfNotSatisfied) {
+        this.key = key;
+        this.empty = empty;
+        this.errorMsgIfNotSatisfied = errorMsgIfNotSatisfied;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public boolean isEmpty() {
+        return empty;
+    }
+
+    public boolean isSatisfiedBy(final boolean empty) {
+        return this.empty == empty;
+    }
+
+    public String getErrorMsgIfNotSatisfied() {
+        return errorMsgIfNotSatisfied;
+    }
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsValidity.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsValidity.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsValidity.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/AssertsValidity.java Tue May  3 07:18:19 2011
@@ -16,57 +16,56 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-
-/**
- * Parameterizes {@link ThatSubcommand}s.
- * 
- * @author Dan Haywood
- */
-public enum AssertsValidity {
-
-    VALID(true, "is valid for", "is valid", "valid"), INVALID(false,
-            "is not valid for", "is not valid", "not valid", "invalid");
-
-    private final String[] keys;
-    private final boolean valid;
-
-    AssertsValidity(boolean valid, String... keys) {
-        this.keys = keys;
-        this.valid = valid;
-    }
-
-    public String[] getKeys() {
-        return keys;
-    }
-
-    public boolean isValid() {
-        return valid;
-    }
-
-    public boolean satisfiedBy(final Consent validityConsent) {
-        return validityConsent.isAllowed() && isValid()
-                || validityConsent.isVetoed() && !isValid();
-    }
-
-    /**
-     * The reason to use if the assertion is not valid.
-     */
-    public String getReason(final Consent validityConsent) {
-        return isValid() ? validityConsent.getReason() : "(valid)";
-    }
-
-    /**
-     * The binding whose current cell should be coloured if the assertion fails.
-     */
-    public CellBinding colorBinding(final CellBinding arg0Binding, final CellBinding thatBinding) {
-        if (arg0Binding == null) {
-            return thatBinding;
-        }
-        return isValid() ? arg0Binding : thatBinding;
-    }
-
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+
+/**
+ * Parameterizes {@link ThatSubcommand}s.
+ * 
+ * @author Dan Haywood
+ */
+public enum AssertsValidity {
+
+    VALID(true, "is valid for", "is valid", "valid"), INVALID(false, "is not valid for", "is not valid", "not valid",
+                                                              "invalid");
+
+    private final String[] keys;
+    private final boolean valid;
+
+    AssertsValidity(final boolean valid, final String... keys) {
+        this.keys = keys;
+        this.valid = valid;
+    }
+
+    public String[] getKeys() {
+        return keys;
+    }
+
+    public boolean isValid() {
+        return valid;
+    }
+
+    public boolean satisfiedBy(final Consent validityConsent) {
+        return validityConsent.isAllowed() && isValid() || validityConsent.isVetoed() && !isValid();
+    }
+
+    /**
+     * The reason to use if the assertion is not valid.
+     */
+    public String getReason(final Consent validityConsent) {
+        return isValid() ? validityConsent.getReason() : "(valid)";
+    }
+
+    /**
+     * The binding whose current cell should be coloured if the assertion fails.
+     */
+    public CellBinding colorBinding(final CellBinding arg0Binding, final CellBinding thatBinding) {
+        if (arg0Binding == null) {
+            return thatBinding;
+        }
+        return isValid() ? arg0Binding : thatBinding;
+    }
+
 }
\ No newline at end of file

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Disabled.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Disabled.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Disabled.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Disabled.java Tue May  3 07:18:19 2011
@@ -16,30 +16,29 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
-
-public class Disabled extends ThatSubcommandAbstract {
-
-	public Disabled() {
-		super("is disabled", "is not usable", "is not enabled");
-	}
-
-	public ObjectAdapter that(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-
-		if (performContext.usableMemberConsent().isAllowed()) {
-			CellBinding onMemberBinding = performContext.getPeer()
-					.getOnMemberBinding();
-			throw ScenarioBoundValueException.current(onMemberBinding, "(usable)");
-		}
-
-		return null;
-
-	}
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
+
+public class Disabled extends ThatSubcommandAbstract {
+
+    public Disabled() {
+        super("is disabled", "is not usable", "is not enabled");
+    }
+
+    @Override
+    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        if (performContext.usableMemberConsent().isAllowed()) {
+            final CellBinding onMemberBinding = performContext.getPeer().getOnMemberBinding();
+            throw ScenarioBoundValueException.current(onMemberBinding, "(usable)");
+        }
+
+        return null;
+
+    }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Hidden.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Hidden.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Hidden.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Hidden.java Tue May  3 07:18:19 2011
@@ -16,29 +16,28 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
-
-public class Hidden extends ThatSubcommandAbstract {
-
-	public Hidden() {
-		super("is hidden", "is not visible");
-	}
-
-	public ObjectAdapter that(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-
-		if (performContext.visibleMemberConsent().isAllowed()) {
-			CellBinding onMemberBinding = performContext.getPeer()
-					.getOnMemberBinding();
-			throw ScenarioBoundValueException.current(onMemberBinding, "(visible)");
-		}
-
-		return null;
-	}
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
+
+public class Hidden extends ThatSubcommandAbstract {
+
+    public Hidden() {
+        super("is hidden", "is not visible");
+    }
+
+    @Override
+    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        if (performContext.visibleMemberConsent().isAllowed()) {
+            final CellBinding onMemberBinding = performContext.getPeer().getOnMemberBinding();
+            throw ScenarioBoundValueException.current(onMemberBinding, "(visible)");
+        }
+
+        return null;
+    }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/PerformCheckThatAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/PerformCheckThatAbstract.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/PerformCheckThatAbstract.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/PerformCheckThatAbstract.java Tue May  3 07:18:19 2011
@@ -16,69 +16,66 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.IsisViewerConstants;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.ScenarioCell;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.Perform;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformAbstract;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
-
-public abstract class PerformCheckThatAbstract extends PerformAbstract {
-
-	protected static enum OnMemberColumn {
-		REQUIRED, NOT_REQUIRED
-	}
-
-	private final Map<String, ThatSubcommand> subcommandByKey = new HashMap<String, ThatSubcommand>();
-	private ObjectAdapter result;
-	private final boolean requiresMember;
-
-	public PerformCheckThatAbstract(final String key,
-			final OnMemberColumn onMemberColumn, final Perform.Mode mode,
-			final ThatSubcommand... thatSubcommands) {
-		super(key, mode);
-		requiresMember = onMemberColumn == OnMemberColumn.REQUIRED;
-		for (final ThatSubcommand thatSubcommand : thatSubcommands) {
-			for (final String subKey : thatSubcommand.getSubkeys()) {
-				subcommandByKey.put(subKey, thatSubcommand);
-			}
-		}
-	}
-
-	@Override
-    public void perform(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-		CellBinding thatItBinding = performContext.getPeer().getThatItBinding();
-		if (!thatItBinding.isFound()) {
-			CellBinding performBinding = performContext.getPeer()
-					.getPerformBinding();
-			throw ScenarioBoundValueException.current(performBinding, 
-					"(require " + IsisViewerConstants.THAT_IT_NAME + "' column)");
-		}
-		ScenarioCell thatItCell = thatItBinding.getCurrentCell();
-		final String thatIt = thatItCell.getText();
-		final ThatSubcommand thatSubcommand = subcommandByKey.get(thatIt);
-		if (thatSubcommand == null) {
-			throw ScenarioBoundValueException.current(thatItBinding, 
-					"(unknown '" + IsisViewerConstants.THAT_IT_NAME + "' verb)");
-		}
-		result = thatSubcommand.that(performContext);
-	}
-
-	@Override
-    public ObjectAdapter getResult() {
-		return result;
-	}
-
-	@Override
-    public boolean requiresMember() {
-		return requiresMember;
-	}
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.IsisViewerConstants;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.ScenarioCell;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.Perform;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformAbstract;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
+
+public abstract class PerformCheckThatAbstract extends PerformAbstract {
+
+    protected static enum OnMemberColumn {
+        REQUIRED, NOT_REQUIRED
+    }
+
+    private final Map<String, ThatSubcommand> subcommandByKey = new HashMap<String, ThatSubcommand>();
+    private ObjectAdapter result;
+    private final boolean requiresMember;
+
+    public PerformCheckThatAbstract(final String key, final OnMemberColumn onMemberColumn, final Perform.Mode mode,
+        final ThatSubcommand... thatSubcommands) {
+        super(key, mode);
+        requiresMember = onMemberColumn == OnMemberColumn.REQUIRED;
+        for (final ThatSubcommand thatSubcommand : thatSubcommands) {
+            for (final String subKey : thatSubcommand.getSubkeys()) {
+                subcommandByKey.put(subKey, thatSubcommand);
+            }
+        }
+    }
+
+    @Override
+    public void perform(final PerformContext performContext) throws ScenarioBoundValueException {
+        final CellBinding thatItBinding = performContext.getPeer().getThatItBinding();
+        if (!thatItBinding.isFound()) {
+            final CellBinding performBinding = performContext.getPeer().getPerformBinding();
+            throw ScenarioBoundValueException.current(performBinding, "(require " + IsisViewerConstants.THAT_IT_NAME
+                + "' column)");
+        }
+        final ScenarioCell thatItCell = thatItBinding.getCurrentCell();
+        final String thatIt = thatItCell.getText();
+        final ThatSubcommand thatSubcommand = subcommandByKey.get(thatIt);
+        if (thatSubcommand == null) {
+            throw ScenarioBoundValueException.current(thatItBinding, "(unknown '" + IsisViewerConstants.THAT_IT_NAME
+                + "' verb)");
+        }
+        result = thatSubcommand.that(performContext);
+    }
+
+    @Override
+    public ObjectAdapter getResult() {
+        return result;
+    }
+
+    @Override
+    public boolean requiresMember() {
+        return requiresMember;
+    }
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ProposedArgumentValidityAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ProposedArgumentValidityAbstract.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ProposedArgumentValidityAbstract.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ProposedArgumentValidityAbstract.java Tue May  3 07:18:19 2011
@@ -16,61 +16,52 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-import org.apache.isis.core.commons.lang.StringUtils;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.ScenarioCell;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
-
-public abstract class ProposedArgumentValidityAbstract extends
-		ThatValidityAbstract {
-
-	public ProposedArgumentValidityAbstract(final AssertsValidity assertion) {
-		super(assertion);
-	}
-
-	public ObjectAdapter that(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-
-		final ObjectMember nakedObjectMember = performContext
-				.getObjectMember();
-		final CellBinding thatBinding = performContext.getPeer()
-				.getThatItBinding();
-		final CellBinding arg0Binding = performContext.getPeer()
-				.getArg0Binding();
-
-		// check we have an argument to validate (if one is required)
-		if (!arg0Binding.isFound()) {
-			throw ScenarioBoundValueException.current(thatBinding,
-					"(requires argument)");
-		}
-
-		final ScenarioCell arg0Cell = arg0Binding.getCurrentCell();
-		final String toValidate = arg0Cell.getText();
-		if (StringUtils.isNullOrEmpty(toValidate)) {
-			throw ScenarioBoundValueException.current(arg0Binding, "(required)");
-		}
-
-		final ObjectAdapter toValidateAdapter = performContext.getPeer()
-				.getAdapter(null, nakedObjectMember.getSpecification(),
-						arg0Binding, arg0Cell);
-		final Consent validityConsent = determineConsent(performContext,
-				toValidateAdapter);
-		if (!getAssertion().satisfiedBy(validityConsent)) {
-			throw ScenarioBoundValueException.current(getAssertion().colorBinding(
-					arg0Binding, thatBinding), getAssertion().getReason(
-					validityConsent));
-		}
-
-		return toValidateAdapter;
-	}
-
-	protected abstract Consent determineConsent(
-			final PerformContext performContext, ObjectAdapter toValidateAdapter);
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+import org.apache.isis.core.commons.lang.StringUtils;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.ScenarioCell;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
+
+public abstract class ProposedArgumentValidityAbstract extends ThatValidityAbstract {
+
+    public ProposedArgumentValidityAbstract(final AssertsValidity assertion) {
+        super(assertion);
+    }
+
+    @Override
+    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        final ObjectMember nakedObjectMember = performContext.getObjectMember();
+        final CellBinding thatBinding = performContext.getPeer().getThatItBinding();
+        final CellBinding arg0Binding = performContext.getPeer().getArg0Binding();
+
+        // check we have an argument to validate (if one is required)
+        if (!arg0Binding.isFound()) {
+            throw ScenarioBoundValueException.current(thatBinding, "(requires argument)");
+        }
+
+        final ScenarioCell arg0Cell = arg0Binding.getCurrentCell();
+        final String toValidate = arg0Cell.getText();
+        if (StringUtils.isNullOrEmpty(toValidate)) {
+            throw ScenarioBoundValueException.current(arg0Binding, "(required)");
+        }
+
+        final ObjectAdapter toValidateAdapter =
+            performContext.getPeer().getAdapter(null, nakedObjectMember.getSpecification(), arg0Binding, arg0Cell);
+        final Consent validityConsent = determineConsent(performContext, toValidateAdapter);
+        if (!getAssertion().satisfiedBy(validityConsent)) {
+            throw ScenarioBoundValueException.current(getAssertion().colorBinding(arg0Binding, thatBinding),
+                getAssertion().getReason(validityConsent));
+        }
+
+        return toValidateAdapter;
+    }
+
+    protected abstract Consent determineConsent(final PerformContext performContext, ObjectAdapter toValidateAdapter);
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatSubcommand.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatSubcommand.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatSubcommand.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatSubcommand.java Tue May  3 07:18:19 2011
@@ -16,21 +16,21 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformOwner;
-
-public interface ThatSubcommand {
-
-	ObjectAdapter that(PerformContext performContext) throws ScenarioBoundValueException;
-
-    List<String> getSubkeys();
-
-    void setOwner(PerformOwner owner);
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformOwner;
+
+public interface ThatSubcommand {
+
+    ObjectAdapter that(PerformContext performContext) throws ScenarioBoundValueException;
+
+    List<String> getSubkeys();
+
+    void setOwner(PerformOwner owner);
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatSubcommandAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatSubcommandAbstract.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatSubcommandAbstract.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatSubcommandAbstract.java Tue May  3 07:18:19 2011
@@ -16,36 +16,38 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformOwner;
-
-public abstract class ThatSubcommandAbstract implements ThatSubcommand {
-
-    private final List<String> subkeys;
-    private PerformOwner owner;
-
-    public ThatSubcommandAbstract(final String... subkeys) {
-        this.subkeys = Collections.unmodifiableList(Arrays.asList(subkeys));
-    }
-
-    public List<String> getSubkeys() {
-        return subkeys;
-    }
-
-    protected PerformOwner getOwner() {
-        return owner;
-    }
-
-    /**
-     * Injected.
-     */
-    public void setOwner(final PerformOwner owner) {
-        this.owner = owner;
-    }
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformOwner;
+
+public abstract class ThatSubcommandAbstract implements ThatSubcommand {
+
+    private final List<String> subkeys;
+    private PerformOwner owner;
+
+    public ThatSubcommandAbstract(final String... subkeys) {
+        this.subkeys = Collections.unmodifiableList(Arrays.asList(subkeys));
+    }
+
+    @Override
+    public List<String> getSubkeys() {
+        return subkeys;
+    }
+
+    protected PerformOwner getOwner() {
+        return owner;
+    }
+
+    /**
+     * Injected.
+     */
+    @Override
+    public void setOwner(final PerformOwner owner) {
+        this.owner = owner;
+    }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatValidityAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatValidityAbstract.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatValidityAbstract.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/ThatValidityAbstract.java Tue May  3 07:18:19 2011
@@ -16,20 +16,19 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-
-public abstract class ThatValidityAbstract extends ThatSubcommandAbstract {
-
-    private final AssertsValidity assertion;
-
-    public ThatValidityAbstract(final AssertsValidity assertion) {
-        super(assertion.getKeys());
-        this.assertion = assertion;
-    }
-
-    public AssertsValidity getAssertion() {
-        return assertion;
-    }
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+public abstract class ThatValidityAbstract extends ThatSubcommandAbstract {
+
+    private final AssertsValidity assertion;
+
+    public ThatValidityAbstract(final AssertsValidity assertion) {
+        super(assertion.getKeys());
+        this.assertion = assertion;
+    }
+
+    public AssertsValidity getAssertion() {
+        return assertion;
+    }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Usable.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Usable.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Usable.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Usable.java Tue May  3 07:18:19 2011
@@ -16,29 +16,28 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
-
-public class Usable extends ThatSubcommandAbstract {
-
-	public Usable() {
-		super("is usable", "is enabled", "is not disabled");
-	}
-
-	public ObjectAdapter that(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-
-		if (!performContext.usableMemberConsent().isAllowed()) {
-			CellBinding onMemberBinding = performContext.getPeer()
-					.getOnMemberBinding();
-			throw ScenarioBoundValueException.current(onMemberBinding, "(disabled)");
-		}
-
-		return null;
-	}
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
+
+public class Usable extends ThatSubcommandAbstract {
+
+    public Usable() {
+        super("is usable", "is enabled", "is not disabled");
+    }
+
+    @Override
+    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        if (!performContext.usableMemberConsent().isAllowed()) {
+            final CellBinding onMemberBinding = performContext.getPeer().getOnMemberBinding();
+            throw ScenarioBoundValueException.current(onMemberBinding, "(disabled)");
+        }
+
+        return null;
+    }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Visible.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Visible.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Visible.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/Visible.java Tue May  3 07:18:19 2011
@@ -16,29 +16,28 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
-
-public class Visible extends ThatSubcommandAbstract {
-
-	public Visible() {
-		super("is visible", "is not hidden");
-	}
-
-	public ObjectAdapter that(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-
-		if (performContext.visibleMemberConsent().isVetoed()) {
-			CellBinding onMemberBinding = performContext.getPeer()
-					.getOnMemberBinding();
-			throw ScenarioBoundValueException.current(onMemberBinding, "(hidden)");
-		}
-
-		return null;
-	}
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
+
+public class Visible extends ThatSubcommandAbstract {
+
+    public Visible() {
+        super("is visible", "is not hidden");
+    }
+
+    @Override
+    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        if (performContext.visibleMemberConsent().isVetoed()) {
+            final CellBinding onMemberBinding = performContext.getPeer().getOnMemberBinding();
+            throw ScenarioBoundValueException.current(onMemberBinding, "(hidden)");
+        }
+
+        return null;
+    }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/action/ArgumentSetNotValid.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/action/ArgumentSetNotValid.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/action/ArgumentSetNotValid.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/action/ArgumentSetNotValid.java Tue May  3 07:18:19 2011
@@ -16,62 +16,56 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat.action;
-
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.ScenarioCell;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat.ThatSubcommandAbstract;
-
-public class ArgumentSetNotValid extends ThatSubcommandAbstract {
-
-	public ArgumentSetNotValid() {
-		super("is not valid for", "is invalid", "invalid");
-	}
-
-	// TODO: a lot of duplication with InvokeAction; simplify somehow?
-	public ObjectAdapter that(final PerformContext performContext)
-			throws ScenarioBoundValueException {
-
-		final ObjectAdapter onAdapter = performContext.getOnAdapter();
-		final ObjectMember nakedObjectMember = performContext
-				.getObjectMember();
-		final CellBinding onMemberBinding = performContext.getPeer()
-				.getOnMemberBinding();
-		final List<ScenarioCell> argumentCells = performContext.getArgumentCells();
-
-		final ObjectAction nakedObjectAction = (ObjectAction) nakedObjectMember;
-		final int parameterCount = nakedObjectAction.getParameterCount();
-		final boolean isContributedOneArgAction = nakedObjectAction
-				.isContributed()
-				&& parameterCount == 1;
-
-		if (isContributedOneArgAction) {
-			return null;
-		}
-
-		// lookup arguments
-		final ObjectAdapter[] proposedArguments = performContext.getPeer()
-				.getAdapters(onAdapter, nakedObjectAction, onMemberBinding, argumentCells);
-
-		// validate arguments
-		final Consent argSetValid = nakedObjectAction
-				.isProposedArgumentSetValid(onAdapter, proposedArguments);
-		if (argSetValid.isAllowed()) {
-			CellBinding thatItBinding = performContext.getPeer()
-					.getThatItBinding();
-			throw ScenarioBoundValueException.current(thatItBinding, "(valid)");
-		}
-
-		// execute
-		return null;
-	}
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat.action;
+
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
+import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.ScenarioCell;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat.ThatSubcommandAbstract;
+
+public class ArgumentSetNotValid extends ThatSubcommandAbstract {
+
+    public ArgumentSetNotValid() {
+        super("is not valid for", "is invalid", "invalid");
+    }
+
+    // TODO: a lot of duplication with InvokeAction; simplify somehow?
+    @Override
+    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        final ObjectAdapter onAdapter = performContext.getOnAdapter();
+        final ObjectMember nakedObjectMember = performContext.getObjectMember();
+        final CellBinding onMemberBinding = performContext.getPeer().getOnMemberBinding();
+        final List<ScenarioCell> argumentCells = performContext.getArgumentCells();
+
+        final ObjectAction nakedObjectAction = (ObjectAction) nakedObjectMember;
+        final int parameterCount = nakedObjectAction.getParameterCount();
+        final boolean isContributedOneArgAction = nakedObjectAction.isContributed() && parameterCount == 1;
+
+        if (isContributedOneArgAction) {
+            return null;
+        }
+
+        // lookup arguments
+        final ObjectAdapter[] proposedArguments =
+            performContext.getPeer().getAdapters(onAdapter, nakedObjectAction, onMemberBinding, argumentCells);
+
+        // validate arguments
+        final Consent argSetValid = nakedObjectAction.isProposedArgumentSetValid(onAdapter, proposedArguments);
+        if (argSetValid.isAllowed()) {
+            final CellBinding thatItBinding = performContext.getPeer().getThatItBinding();
+            throw ScenarioBoundValueException.current(thatItBinding, "(valid)");
+        }
+
+        // execute
+        return null;
+    }
+
+}

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/action/ArgumentSetValid.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/action/ArgumentSetValid.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/action/ArgumentSetValid.java (original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/perform/checkthat/action/ArgumentSetValid.java Tue May  3 07:18:19 2011
@@ -16,59 +16,55 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat.action;
-
-import java.util.List;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
-import org.apache.isis.viewer.bdd.common.CellBinding;
-import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
-import org.apache.isis.viewer.bdd.common.ScenarioCell;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
-import org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat.ThatSubcommandAbstract;
-
-public class ArgumentSetValid extends ThatSubcommandAbstract {
-
-    public ArgumentSetValid() {
-        super("is valid for", "is valid", "valid");
-    }
-
-    // TODO: a lot of duplication with InvokeAction; simplify somehow?
-    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {
-
-        final ObjectAdapter onAdapter = performContext.getOnAdapter();
-        final ObjectMember nakedObjectMember = performContext
-                .getObjectMember();
-        final CellBinding onMemberBinding = performContext
-        .getPeer().getOnMemberBinding();
-        final List<ScenarioCell> argumentCells = performContext.getArgumentCells();
-
-        final ObjectAction nakedObjectAction = (ObjectAction) nakedObjectMember;
-        final int parameterCount = nakedObjectAction.getParameterCount();
-        final boolean isContributedOneArgAction = nakedObjectAction
-                .isContributed()
-                && parameterCount == 1;
-
-        if (isContributedOneArgAction) {
-            return null;
-        }
-
-        // lookup arguments
-        final ObjectAdapter[] proposedArguments = performContext.getPeer().getAdapters(
-        		onAdapter, nakedObjectAction, onMemberBinding, argumentCells);
-
-        // validate arguments
-        final Consent argSetValid = nakedObjectAction
-                .isProposedArgumentSetValid(onAdapter, proposedArguments);
-        if (argSetValid.isVetoed()) {
-        	throw ScenarioBoundValueException.current(onMemberBinding, argSetValid.getReason());
-        }
-
-        // execute
-        return null;
-    }
-
-}
+package org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat.action;
+
+import java.util.List;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
+import org.apache.isis.core.metamodel.spec.feature.ObjectMember;
+import org.apache.isis.viewer.bdd.common.CellBinding;
+import org.apache.isis.viewer.bdd.common.ScenarioBoundValueException;
+import org.apache.isis.viewer.bdd.common.ScenarioCell;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.PerformContext;
+import org.apache.isis.viewer.bdd.common.fixtures.perform.checkthat.ThatSubcommandAbstract;
+
+public class ArgumentSetValid extends ThatSubcommandAbstract {
+
+    public ArgumentSetValid() {
+        super("is valid for", "is valid", "valid");
+    }
+
+    // TODO: a lot of duplication with InvokeAction; simplify somehow?
+    @Override
+    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {
+
+        final ObjectAdapter onAdapter = performContext.getOnAdapter();
+        final ObjectMember nakedObjectMember = performContext.getObjectMember();
+        final CellBinding onMemberBinding = performContext.getPeer().getOnMemberBinding();
+        final List<ScenarioCell> argumentCells = performContext.getArgumentCells();
+
+        final ObjectAction nakedObjectAction = (ObjectAction) nakedObjectMember;
+        final int parameterCount = nakedObjectAction.getParameterCount();
+        final boolean isContributedOneArgAction = nakedObjectAction.isContributed() && parameterCount == 1;
+
+        if (isContributedOneArgAction) {
+            return null;
+        }
+
+        // lookup arguments
+        final ObjectAdapter[] proposedArguments =
+            performContext.getPeer().getAdapters(onAdapter, nakedObjectAction, onMemberBinding, argumentCells);
+
+        // validate arguments
+        final Consent argSetValid = nakedObjectAction.isProposedArgumentSetValid(onAdapter, proposedArguments);
+        if (argSetValid.isVetoed()) {
+            throw ScenarioBoundValueException.current(onMemberBinding, argSetValid.getReason());
+        }
+
+        // execute
+        return null;
+    }
+
+}



Mime
View raw message