Examples of CellBinding


Examples of org.apache.isis.viewer.bdd.common.CellBinding

        final OneToOneAssociation otoa = (OneToOneAssociation) nakedObjectMember;

        // set
        final PropertyClearFacet clearFacet = otoa.getFacet(PropertyClearFacet.class);
        final CellBinding thatItBinding = performContext.getPeer().getThatItBinding();
        if (clearFacet == null) {
            throw ScenarioBoundValueException.current(thatItBinding, "(cannot clear)");
        }

        // validate setting to null
View Full Code Here

Examples of org.apache.isis.viewer.bdd.common.CellBinding

        final OneToOneAssociation otoa = (OneToOneAssociation) performContext.getObjectMember();

        final Consent validityConsent = otoa.isAssociationValid(onAdapter, null);

        if (!getAssertion().satisfiedBy(validityConsent)) {
            final CellBinding thatBinding = performContext.getPeer().getThatItBinding();
            throw ScenarioBoundValueException.current(thatBinding, getAssertion().getReason(validityConsent));
        }

        // can only return null.
        return null;
View Full Code Here

Examples of org.apache.isis.viewer.bdd.common.CellBinding

        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);
View Full Code Here

Examples of org.apache.isis.viewer.bdd.common.CellBinding

    @Override
    public void doHandle(final PerformContext performContext) throws ScenarioBoundValueException {

        final ObjectAdapter onAdapter = performContext.getOnAdapter();
        final ObjectMember nakedObjectMember = performContext.getObjectMember();
        final CellBinding arg0Binding = performContext.getPeer().getArg0Binding();
        final ScenarioCell arg0Cell = arg0Binding.getCurrentCell();
        int requestedParamNum = -1;
        try {
            requestedParamNum = Integer.valueOf(arg0Cell.getText());
        } catch (final NumberFormatException ex) {
            throw ScenarioBoundValueException.current(arg0Binding, ex.getMessage());
View Full Code Here

Examples of org.apache.isis.viewer.bdd.common.CellBinding

    @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;
View Full Code Here

Examples of org.apache.isis.viewer.bdd.common.CellBinding

    @Override
    protected void doThat(final PerformContext performContext, final Iterable<ObjectAdapter> collection) throws ScenarioBoundValueException {

        final ObjectMember nakedObjectMember = performContext.getObjectMember();
        final CellBinding thatBinding = performContext.getPeer().getThatItBinding();
        final CellBinding arg0Binding = performContext.getPeer().getArg0Binding();

        if (!arg0Binding.isFound()) {
            throw ScenarioBoundValueException.current(thatBinding, "(requires argument)");
        }

        final ScenarioCell arg0Cell = arg0Binding.getCurrentCell();

        final ObjectAdapter containedAdapter = performContext.getPeer().getAdapter(null, nakedObjectMember.getSpecification(), arg0Binding, arg0Cell);

        boolean contains = false;
        for (final ObjectAdapter eachAdapter : collection) {
View Full Code Here

Examples of org.apache.isis.viewer.bdd.common.CellBinding

     * 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);
        }
View Full Code Here

Examples of org.apache.isis.viewer.bdd.common.CellBinding

    @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;
View Full Code Here

Examples of org.apache.isis.viewer.bdd.common.CellBinding

        final ObjectAdapter eachObject : collection) {
            empty = false;
        }

        if (!assertion.isSatisfiedBy(empty)) {
            final CellBinding thatItBinding = performContext.getPeer().getThatItBinding();
            throw ScenarioBoundValueException.current(thatItBinding, assertion.getErrorMsgIfNotSatisfied());
        }
    }
View Full Code Here

Examples of org.apache.isis.viewer.bdd.common.CellBinding

    @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;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.