Package org.apache.isis.viewer.bdd.common

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


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


    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());
        }

        final ObjectAction noa = (ObjectAction) nakedObjectMember;
View Full Code Here

     */
    @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

        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

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

        final ScenarioCell arg0Cell = arg0Binding.getCurrentCell();

        final String expectedSizeStr = arg0Cell.getText();
        final int expectedSize;
        try {
            expectedSize = Integer.parseInt(expectedSizeStr);
        } catch (final NumberFormatException ex) {
            throw ScenarioBoundValueException.current(arg0Binding, "(not an integer)");
View Full Code Here

    // validate API
    // //////////////////////////////////////////////////////////////////

    public ObjectAdapter validateOnObject() throws ScenarioBoundValueException {

        final ScenarioCell onObjectCell = onObjectBinding.getCurrentCell();
        String onObject = onObjectCell.getText();
        if (onObject == null) {
            if (previousOnObject == null) {
                throw ScenarioBoundValueException.current(onObjectBinding, "(required)");
            }
            onObject = previousOnObject;
View Full Code Here

    public String validateAliasAs() throws ScenarioBoundValueException {
        if (getAliasResultAsBinding() == null) {
            return null;
        }
        final ScenarioCell aliasCell = aliasResultAsBinding.getCurrentCell();
        if (aliasCell == null) {
            return null;
        }

        final String aliasAs = aliasCell.getText();
        if (getAliasRegistry().getAliased(aliasAs) != null) {
            throw ScenarioBoundValueException.current(aliasResultAsBinding, "(already used)");
        }
        return aliasAs;
    }
View Full Code Here

        return aliasAs;
    }

    public ObjectMember validateOnMember(final ObjectAdapter onAdapter) throws ScenarioBoundValueException {

        final ScenarioCell onMemberCell = onMemberBinding.getCurrentCell();
        final String onMember = onMemberCell.getText();

        if (StringUtils.isNullOrEmpty(onMember)) {
            throw ScenarioBoundValueException.current(onMemberBinding, "(required)");
        }
View Full Code Here

            throw ScenarioBoundValueException.current(onMemberBinding, "(action requires " + parameterCount + " arguments)");
        }
        final ObjectAdapter[] adapters = new ObjectAdapter[parameterCount];

        for (int i = 0; i < parameterCount; i++) {
            final ScenarioCell paramCell = argumentCells.get(i);
            final ObjectActionParameter parameter = parameters.get(i);
            adapters[i] = getAdapter(null, parameter.getSpecification(), onMemberBinding, paramCell);
        }
        return adapters;
    }
View Full Code Here

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

        // if we have an expected result
        final CellBinding arg0Binding = performContext.getPeer().getArg0Binding();
        final ScenarioCell arg0Cell = arg0Binding.getCurrentCell();
        final String expected = arg0Cell.getText();

        // get
        final ObjectAdapter resultAdapter = otoa.get(performContext.getOnAdapter());

        // see if matches null
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.bdd.common.ScenarioCell

Copyright © 2018 www.massapicom. 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.