Examples of CellBinding


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

    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {

        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());
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 onMemberBinding = performContext.getPeer().getOnMemberBinding();

        final OneToManyAssociation otma = (OneToManyAssociation) nakedObjectMember;

        final CollectionAddToFacet addToFacet = nakedObjectMember.getFacet(CollectionAddToFacet.class);
        if (addToFacet == null) {
            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

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

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

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

        for (int colNum = 0; colNum < getProperties().size(); colNum++) {
            final SetUpObjectResult result = setUpProperty(adapter, colNum);

            if (!result.isHandled()) {
                final CellBinding cellBinding = getCellBindings().get(colNum);
                throw ScenarioBoundValueException.current(cellBinding, result.getErrorMessage());
            }
        }

        persistIfNecessary(adapter);
View Full Code Here

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

        }
    }

    @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);
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) {
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, "(disabled)");
        }

        return null;
    }
View Full Code Here

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

        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.representsPersistent()) {
View Full Code Here

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

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