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

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


        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


            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

        this.typicalLengthFacet = typicalLengthFacet;
    }

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

        }
    }

    private void process(ProcessParameterContext processParameterContext, MultiLine parameterAnnotation) {
        final MultiLine annotation = (MultiLine) parameterAnnotation;
        final MultiLineFacet facet = create(annotation, processParameterContext.getFacetHolder());

        // no-op if null
        FacetUtil.addFacet(facet);

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

        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

                field.setWidth(maxLength);
            } else {
                field.setWidth(typicalLengthFacet.value());
            }

            final MultiLineFacet multiLineFacet = param.getFacet(MultiLineFacet.class);
            field.setHeight(multiLineFacet.numberOfLines());
            field.setWrapped(!multiLineFacet.preventWrapping());

            final ObjectSpecification spec = param.getSpecification();
            if (spec.containsFacet(BooleanValueFacet.class)) {
                field.setType(InputField.CHECKBOX);
            } else if (spec.containsFacet(PasswordValueFacet.class)) {
View Full Code Here

                    getModel().setObjectAsString(object);
                }
            }
        });

        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

        return facet != null ? facet.value() : null;
    }


    public int getNumberOfLines(final ScalarModel scalarModel) {
        final MultiLineFacet multiLineFacet = scalarModel.getFacet(MultiLineFacet.class);
        int numberOfLines = 1;
       
        if (multiLineFacet != null) {
            numberOfLines = multiLineFacet.numberOfLines();
        }
       
        return numberOfLines;
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facets.propparam.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.