Package org.apache.isis.core.metamodel.facets.all.named

Examples of org.apache.isis.core.metamodel.facets.all.named.NamedFacet


        final ProposedHolder proposedHolder = (ProposedHolder) context;
        final boolean required = isRequiredButNull(proposedHolder.getProposed());
        if (!required) {
            return null;
        }
        final NamedFacet namedFacet = getFacetHolder().getFacet(NamedFacet.class);
        final String name = namedFacet != null? namedFacet.value(): null;
        return name != null? "'" + name + "' is mandatory":"Mandatory";
    }
View Full Code Here


        public static String nameFor(final ObjectAction objAction) {
            final String actionName = objAction.getName();
            if (actionName != null) {
                return actionName;
            }
            final NamedFacet namedFacet = objAction.getFacet(NamedFacet.class);
            if (namedFacet != null) {
                return namedFacet.value();
            }
            return "(no name)";
        }
View Full Code Here

        if(describedAsFacet != null && !describedAsFacet.isNoop() && !Strings.isNullOrEmpty(describedAsFacet.value())) {
            DescribedAsFacetRepr describedAsFacetRepr = new DescribedAsFacetRepr();
            describedAsFacetRepr.value = describedAsFacet.value();
            actionRepr.describedAs = describedAsFacetRepr;
        }
        NamedFacet namedFacet = action.getFacet(NamedFacet.class);
        if(namedFacet != null && !namedFacet.isNoop()) {
            NamedFacetRepr namedFacetRepr = new NamedFacetRepr();
            namedFacetRepr.value = namedFacet.value();
            actionRepr.named = namedFacetRepr;
        }
       
        return actionRepr;
    }
View Full Code Here

        if(describedAsFacet != null && !describedAsFacet.isNoop() && !Strings.isNullOrEmpty(describedAsFacet.value())) {
            DescribedAsFacetRepr describedAsFacetRepr = new DescribedAsFacetRepr();
            describedAsFacetRepr.value = describedAsFacet.value();
            memberRepr.describedAs = describedAsFacetRepr;
        }
        NamedFacet namedFacet = assoc.getFacet(NamedFacet.class);
        if(namedFacet != null && !namedFacet.isNoop()) {
            NamedFacetRepr namedFacetRepr = new NamedFacetRepr();
            namedFacetRepr.value = namedFacet.value();
            memberRepr.named = namedFacetRepr;
        }
        DisabledFacet disabledFacet = assoc.getFacet(DisabledFacet.class);
        if(disabledFacet != null && !disabledFacet.isNoop()) {
            DisabledFacetRepr disabledFacetRepr = new DisabledFacetRepr();
View Full Code Here

            updateFromFacetValues();   
        }
    }

    private void addNamedFacetAndPluralFacetIfRequired() {
        NamedFacet namedFacet = getFacet(NamedFacet.class);
        if (namedFacet == null) {
            namedFacet = new NamedFacetInferred(StringExtensions.asNaturalName2(getShortIdentifier()), this);
            addFacet(namedFacet);
        }

        PluralFacet pluralFacet = getFacet(PluralFacet.class);
        if (pluralFacet == null) {
            pluralFacet = new PluralFacetInferred(StringExtensions.asPluralName(namedFacet.value()), this);
            addFacet(pluralFacet);
        }
    }
View Full Code Here

        return parentAction.getIdentifier();
    }

    @Override
    public String getId() {
        final NamedFacet facet = getFacet(NamedFacet.class);
        if (facet != null && facet.value() != null) {
            return StringExtensions.asCamelLowerFirst(facet.value());
        }
        final String name = getSpecification().getSingularName();
        final List<ObjectActionParameter> parameters = this.getAction().getParameters(new Filter<ObjectActionParameter>() {

            @Override
View Full Code Here

        return StringExtensions.asCamelLowerFirst(name + (indexOf + 1));
    }

    @Override
    public String getName() {
        final NamedFacet facet = getFacet(NamedFacet.class);
        if (facet != null && facet.value() != null) {
            return facet.value();
        }
        final String name = getSpecification().getSingularName();
        final List<ObjectActionParameter> parameters = getAction().getParameters(new Filter<ObjectActionParameter>() {

            @Override
View Full Code Here

        super(FeatureType.MEMBERS);
    }

    @Override
    public void process(final ProcessMethodContext processMethodContext) {
        NamedFacet namedFacet = createFromMetadataPropertiesIfPossible(processMethodContext);
        if(namedFacet == null) {
            namedFacet = createFromAnnotationIfPossible(processMethodContext);
        }
        // no-op if null
        FacetUtil.addFacet(namedFacet);
View Full Code Here

        FacetUtil.addFacet(namedFacet);
    }

    @Override
    public void process(ProcessContributeeMemberContext processMemberContext) {
        NamedFacet namedFacet = createFromMetadataPropertiesIfPossible(processMemberContext);
        // no-op if null
        FacetUtil.addFacet(namedFacet);
    }
View Full Code Here

     *
     * @see #getId()
     */
    @Override
    public String getName() {
        final NamedFacet facet = getFacet(NamedFacet.class);
        final String name = facet.value();
        return name != null ? name : defaultName;
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facets.all.named.NamedFacet

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.