Package org.apache.isis.core.metamodel.facets.object.title

Examples of org.apache.isis.core.metamodel.facets.object.title.TitleFacet


            return false;
        }
        FacetUtil.addFacet(maskFacet);

        final ObjectSpecification type = getSpecificationLookup().loadSpecification(cls);
        final TitleFacet underlyingTitleFacet = type.getFacet(TitleFacet.class);
        if (underlyingTitleFacet != null) {
            final TitleFacet titleFacet = new TitleFacetBasedOnMask(maskFacet, underlyingTitleFacet);
            FacetUtil.addFacet(titleFacet);
        }
        return true;
    }
View Full Code Here


        if (regexFacet == null) {
            return;
        }
        FacetUtil.addFacet(regexFacet);

        final TitleFacet titleFacet = createTitleFacet(regexFacet);
        FacetUtil.addFacet(titleFacet);
    }
View Full Code Here

            return false;
        }
        FacetUtil.addFacet(maskFacet);

        final ObjectSpecification type = getSpecificationLookup().loadSpecification(cls);
        final TitleFacet underlyingTitleFacet = type.getFacet(TitleFacet.class);
        if (underlyingTitleFacet != null) {
            final TitleFacet titleFacet = new TitleFacetBasedOnMask(maskFacet, underlyingTitleFacet);
            FacetUtil.addFacet(titleFacet);
        }
        return true;
    }
View Full Code Here

     *            the specification of the type of the property or parameter (for fallback).
     */
    protected String titleString(final ObjectAdapter propertyOrParamValue, final FacetHolder propertyOrParam,
        final FacetHolder propertyOrParamTypeSpecification) {

        final TitleFacet titleFacet = propertyOrParam.getFacet(TitleFacet.class);
        if (titleFacet != null) {
            return titleFacet.title(propertyOrParamValue, null);
        } else {
            return propertyOrParamValue.titleString();
        }
    }
View Full Code Here

        ValueFacet valueFacet = getMemberSpecFacet(ValueFacet.class);
        if(valueFacet != null) {
            EncodableFacet encodableFacet = getMemberSpecFacet(EncodableFacet.class);
            return encodableFacet.toEncodedString(valueAdapter);
        }
        TitleFacet titleFacet = getMemberSpecFacet(TitleFacet.class);
        String title = titleFacet.title(valueAdapter, getLocalization());
        return LinkRepBuilder.newBuilder(repContext, "value", urlForObject()).withTitle(title).build();
    }
View Full Code Here

        boolean eagerlyRender = renderFacet != null && renderFacet.value() == Type.EAGERLY && rendererContext.canEagerlyRender(valueAdapter);

        if(valueAdapter == null) {
            representation.mapPut("value", NullNode.getInstance());
        } else {
            final TitleFacet titleFacet = spec.getFacet(TitleFacet.class);
            final String title = titleFacet.title(valueAdapter, rendererContext.getLocalization());
           
            final LinkBuilder valueLinkBuilder = DomainObjectReprRenderer.newLinkToBuilder(rendererContext, Rel.VALUE, valueAdapter).withTitle(title);
            if(eagerlyRender) {
                final DomainObjectReprRenderer renderer = new DomainObjectReprRenderer(rendererContext, getLinkFollowSpecs(), JsonRepresentation.newMap());
                renderer.with(valueAdapter);
View Full Code Here

    public static Object valueOrRef(final RendererContext resourceContext, final ObjectAdapter objectAdapter, final ObjectSpecification objectSpec) {
        if(objectAdapter.isValue()) {
            String format = null; // TODO
            return JsonValueEncoder.asObject(objectAdapter, format);
        }
        final TitleFacet titleFacet = objectSpec.getFacet(TitleFacet.class);
        final String title = titleFacet.title(objectAdapter, resourceContext.getLocalization());
        return DomainObjectReprRenderer.newLinkToBuilder(resourceContext, Rel.VALUE, objectAdapter).withTitle(title).build();
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facets.object.title.TitleFacet

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.