Package org.apache.isis.core.progmodel.facets.value.booleans

Examples of org.apache.isis.core.progmodel.facets.value.booleans.BooleanValueFacet


    public Size getRequiredSize(final Size availableSpace) {
        return new Size(ViewConstants.HPADDING + size + ViewConstants.HPADDING, ViewConstants.VPADDING + size + ViewConstants.VPADDING);
    }

    private boolean isSet() {
        final BooleanValueFacet booleanValueFacet = getContent().getSpecification().getFacet(BooleanValueFacet.class);
        return booleanValueFacet.isSet(getContent().getAdapter());
    }
View Full Code Here


        return booleanValueFacet.isSet(getContent().getAdapter());
    }

    @Override
    protected void save() {
        final BooleanValueFacet booleanValueFacet = getContent().getSpecification().getFacet(BooleanValueFacet.class);
        final ObjectAdapter adapter = getContent().getAdapter();
        if (adapter == null) {
            ((TextParseableContent) getContent()).parseTextEntry("true");
        } else {
            booleanValueFacet.toggle(adapter);
        }

        // return parsed != null ? PersistorUtil.createAdapter(parsed) : null;

        markDamaged();
View Full Code Here

    }


    @Override
    public Component createParseableField(final ObjectAssociation field, final ObjectAdapter value, final boolean isEditable) {
        final BooleanValueFacet facet = field.getSpecification().getFacet(BooleanValueFacet.class);
        if (facet != null) {
            return createCheckboxBlock(isEditable, facet.isSet(value));
        } else {
            final String titleString = value != null ? value.titleString() : "";

            final MultiLineFacet multiLineFacet = field.getSpecification().getFacet(MultiLineFacet.class);
            final boolean isWrapped = multiLineFacet != null && !multiLineFacet.preventWrapping();
View Full Code Here

    }

    @Override
    public Component createParseableField(final ObjectAssociation field, final ObjectAdapter value, final boolean isEditable) {
        final BooleanValueFacet facet = field.getSpecification().getFacet(BooleanValueFacet.class);
        if (facet != null) {
            return createCheckboxBlock(isEditable, facet.isSet(value));
        } else {
            final String titleString = value != null ? value.titleString() : "";

            final MultiLineFacet multiLineFacet = field.getSpecification().getFacet(MultiLineFacet.class);
            final boolean isWrapped = multiLineFacet != null && !multiLineFacet.preventWrapping();
View Full Code Here

            }

            // TODO figure out a better way to determine if boolean or a
            // password
            final ObjectSpecification spec = field.getSpecification();
            final BooleanValueFacet facet = spec.getFacet(BooleanValueFacet.class);
            if (facet != null) {
                final boolean flag = facet.isSet(fieldReference);
                final String valueSegment = flag ? " checked=\"checked\"" : "";
                final String disabled = " disabled=\"disabled\"";
                request.appendHtml("<input type=\"checkbox\"" + valueSegment + disabled + " />");
            } else {
                request.appendAsHtmlEncoded(value);
View Full Code Here

    public Size getRequiredSize(final Size availableSpace) {
        return new Size(HPADDING + size + HPADDING, VPADDING + size + VPADDING);
    }

    private boolean isSet() {
        final BooleanValueFacet booleanValueFacet = getContent().getSpecification().getFacet(BooleanValueFacet.class);
        return booleanValueFacet.isSet(getContent().getAdapter());
    }
View Full Code Here

        return booleanValueFacet.isSet(getContent().getAdapter());
    }

    @Override
    protected void save() {
        final BooleanValueFacet booleanValueFacet = getContent().getSpecification().getFacet(BooleanValueFacet.class);
        final ObjectAdapter adapter = getContent().getAdapter();
        if (adapter == null) {
            ((TextParseableContent) getContent()).parseTextEntry("true");
        } else {
            booleanValueFacet.toggle(adapter);
        }

        // return parsed != null ? PersistorUtil.createAdapter(parsed) : null;

        markDamaged();
View Full Code Here

    }

    @Override
    public Component createParseableField(final ObjectAssociation field, final ObjectAdapter value,
        final boolean isEditable) {
        final BooleanValueFacet facet = field.getSpecification().getFacet(BooleanValueFacet.class);
        if (facet != null) {
            return createCheckboxBlock(isEditable, facet.isSet(value));
        } else {
            final String titleString = value != null ? value.titleString() : "";

            final MultiLineFacet multiLineFacet = field.getSpecification().getFacet(MultiLineFacet.class);
            final boolean isWrapped = multiLineFacet != null && !multiLineFacet.preventWrapping();
View Full Code Here

                value = value.substring(0, truncateTo) + "...";
            }

            // TODO figure out a better way to determine if boolean or a password
            final ObjectSpecification spec = field.getSpecification();
            final BooleanValueFacet facet = spec.getFacet(BooleanValueFacet.class);
            if (facet != null) {
                final boolean flag = facet.isSet(fieldReference);
                final String valueSegment = flag ? " checked=\"checked\"" : "";
                final String disabled = " disabled=\"disabled\"";
                request.appendHtml("<input type=\"checkbox\"" + valueSegment + disabled + " />");
            } else {
                request.appendAsHtmlEncoded(value);
View Full Code Here

TOP

Related Classes of org.apache.isis.core.progmodel.facets.value.booleans.BooleanValueFacet

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.