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

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


        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


        }
        return "ok";
    }

    private String getTitle() {
        final ScenarioCell currentCell = getPeer().getTitleBinding().getCurrentCell();
        return currentCell != null ? currentCell.getText() : "(no title provided)";
    }
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

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

        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

        // 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);
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

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.