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

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


        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

            throw ScenarioBoundValueException.current(onMemberBinding, "(cannot add to collection)");
        }

        // safe since guaranteed by superclass
        final CellBinding arg0Binding = performContext.getPeer().getArg0Binding();
        final ScenarioCell arg0Cell = arg0Binding.getCurrentCell();
        final String toAddAlias = arg0Cell.getText();

        final ObjectAdapter toAddAdapter = performContext.getPeer().getAliasRegistry().getAliased(toAddAlias);
        if (toAddAdapter == null) {
            throw ScenarioBoundValueException.current(arg0Binding, "(unknown alias)");
        }
View Full Code Here

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

        final ObjectAdapter foundAdapter = findAdapter();
        if (foundAdapter == null) {
            throw ScenarioBoundValueException.current(titleBinding, "not found");
        }

        final ScenarioCell currentCell = aliasBinding.getCurrentCell();
        final String currentCellText = currentCell.getText();
        getAliasRegistry().aliasAs(currentCellText, foundAdapter);
        return currentCell;
    }
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

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.