Package org.apache.isis.core.metamodel.facets.multiline

Examples of org.apache.isis.core.metamodel.facets.multiline.MultiLineFacet


            HiddenFacetRepr hiddenFacetRepr = new HiddenFacetRepr();
            hiddenFacetRepr.when = whenAlwaysToNull(hiddenFacet.when());
            hiddenFacetRepr.where = whereAnywhereToNull(hiddenFacet.where());
            memberRepr.hidden = hiddenFacetRepr;
        }
        MultiLineFacet multiLineFacet = assoc.getFacet(MultiLineFacet.class);
        if(multiLineFacet != null && !multiLineFacet.isNoop()) {
            MultiLineFacetRepr multiLineFacetRepr = new MultiLineFacetRepr();
            multiLineFacetRepr.numberOfLines = multiLineFacet.numberOfLines();
            memberRepr.multiLine = multiLineFacetRepr;
        }
        PagedFacet pagedFacet = assoc.getFacet(PagedFacet.class);
        if(pagedFacet != null && !pagedFacet.isNoop()) {
            PagedFacetRepr pagedFacetRepr = new PagedFacetRepr();
View Full Code Here


        super(index, action, peer);
    }

    @Override
    public int getNoLines() {
        final MultiLineFacet facet = getFacet(MultiLineFacet.class);
        return facet.numberOfLines();
    }
View Full Code Here

        return facet.numberOfLines();
    }

    @Override
    public boolean canWrap() {
        final MultiLineFacet facet = getFacet(MultiLineFacet.class);
        return !facet.preventWrapping();
    }
View Full Code Here

        this.typicalLengthFacet = typicalLengthFacet;
    }

    @Override
    public int value() {
        final MultiLineFacet facet = getFacetHolder().getFacet(MultiLineFacet.class);
        return facet.numberOfLines() * typicalLengthFacet.value();
    }
View Full Code Here

        super(FeatureType.PROPERTIES_ONLY);
    }

    @Override
    public void process(final ProcessMethodContext processMethodContext) {
        MultiLineFacet facet = createFromMetadataPropertiesIfPossible(processMethodContext);
        if(facet == null) {
            facet = createFromAnnotationIfPossible(processMethodContext);
        }
       
        // no-op if null
View Full Code Here

        this.typicalLengthFacet = typicalLengthFacet;
    }

    @Override
    public int value() {
        final MultiLineFacet facet = getFacetHolder().getFacet(MultiLineFacet.class);
        return facet.numberOfLines() * typicalLengthFacet.value();
    }
View Full Code Here

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

            if (isWrapped) {
                return createInlineBlock("value", "<pre>" + titleString + "</pre>", null);
            } else {
                return createInlineBlock("value", titleString, null);
View Full Code Here

                readOnly[i] = true;
            } else {
                readOnly[i] = false;
                optional[i] = !fld.isMandatory();
                if (fieldSpecifications[i].isParseable()) {
                    final MultiLineFacet multilineFacet = fld.getFacet(MultiLineFacet.class);
                    noLines[i] = multilineFacet.numberOfLines();
                    wraps[i] = !multilineFacet.preventWrapping();

                    final MaxLengthFacet maxLengthFacet = fld.getFacet(MaxLengthFacet.class);
                    maxLength[i] = maxLengthFacet.value();

                    final TypicalLengthFacet typicalLengthFacet = fld.getFacet(TypicalLengthFacet.class);
View Full Code Here

                final ObjectSpecification columnSpec = columnAssociation.getSpecification();

                if (!columnAssociation.isVisible(getAuthenticationSession(), rowAdapter, where).isAllowed()) {
                    table.addEmptyCell();
                } else if (columnSpec.isParseable()) {
                    final MultiLineFacet multiline = columnSpec.getFacet(MultiLineFacet.class);
                    final boolean shouldTruncate = multiline != null && multiline.numberOfLines() > 1;
                    final String titleString = columnAdapter != null ? columnAdapter.titleString() : "";
                    table.addCell(titleString, shouldTruncate);
                } else if (columnAdapter == null) {
                    table.addEmptyCell();
                } else {
View Full Code Here

                }
            }
        });
       

        final MultiLineFacet multiLineFacet = getModel().getFacet(MultiLineFacet.class);
        setAttribute(textField, "rows", multiLineFacet.numberOfLines());
       
       
        final Integer maxLength = getValueOf(getModel(), MaxLengthFacet.class);
        if(maxLength != null) {
            // in conjunction with javascript in jquery.isis.wicket.viewer.js
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facets.multiline.MultiLineFacet

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.