Examples of when()


Examples of org.apache.isis.core.metamodel.facets.hide.HiddenFacet.when()

            memberRepr.disabled = disabledFacetRepr;
        }
        HiddenFacet hiddenFacet = assoc.getFacet(HiddenFacet.class);
        if(hiddenFacet != null && !hiddenFacet.isNoop()) {
            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()) {
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.hide.HiddenFacet.when()

    // /////////////////////////////////////////////////////////////

    @Override
    public boolean isAlwaysHidden() {
        final HiddenFacet hiddenFacet = getFacet(HiddenFacet.class);
        return hiddenFacet != null && hiddenFacet.when() == When.ALWAYS && hiddenFacet.where() == Where.ANYWHERE;
    }

    /**
     * Loops over all {@link HidingInteractionAdvisor} {@link Facet}s and
     * returns <tt>true</tt> only if none hide the member.
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.hide.HiddenFacet.when()

        contributeeActionsToAppendTo.addAll(contributeeActions);
    }
   
    private boolean isAlwaysHidden(final FacetHolder holder) {
        final HiddenFacet hiddenFacet = holder.getFacet(HiddenFacet.class);
        return hiddenFacet != null && hiddenFacet.when() == When.ALWAYS && hiddenFacet.where() == Where.ANYWHERE;
    }

   

    /**
 
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet.when()

            DisabledFacetRepr disabledFacetRepr = new DisabledFacetRepr();
            if(disabledFacet instanceof DisabledFacetImpl) {
                DisabledFacetImpl disabledFacetImpl = (DisabledFacetImpl) disabledFacet;
                disabledFacetRepr.reason = Strings.emptyToNull(disabledFacetImpl.getReason());
            }
            disabledFacetRepr.when = whenAlwaysToNull(disabledFacet.when());
            disabledFacetRepr.where = whereAnywhereToNull(disabledFacet.where());
            memberRepr.disabled = disabledFacetRepr;
        }
        HiddenFacet hiddenFacet = assoc.getFacet(HiddenFacet.class);
        if(hiddenFacet != null && !hiddenFacet.isNoop()) {
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAbstract.when()

        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof DisabledFacetAbstract);
        final DisabledFacetAbstract disabledFacetAbstract = (DisabledFacetAbstract) facet;
        assertEquals(When.ALWAYS, disabledFacetAbstract.when());

        assertTrue(methodRemover.getRemovedMethodMethodCalls().contains(protectMethod));
    }

    public void testDoesNotInstallDisabledFacetUsingProtectWhenNotAndRemovesMethod() {
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAlwaysEverywhere.when()

        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof DisabledFacetAlwaysEverywhere);
        final DisabledFacetAlwaysEverywhere disabledFacetAlways = (DisabledFacetAlwaysEverywhere) facet;
        assertEquals(When.ALWAYS, disabledFacetAlways.when());

        assertTrue(methodRemover.getRemovedMethodMethodCalls().contains(protectMethod));
    }

    public void testDoesNotInstallDisabledFacetUsingProtectWhenNotAndRemovesMethod() {
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.members.hidden.HiddenFacetAbstract.when()

        final Facet facet = facetedMethod.getFacet(HiddenFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof HiddenFacetAbstract);
        final HiddenFacetAbstract hiddenFacetAbstract = (HiddenFacetAbstract) facet;
        assertEquals(When.ALWAYS, hiddenFacetAbstract.when());

        assertTrue(methodRemover.getRemovedMethodMethodCalls().contains(alwaysHideMethod));
    }

    public void testInstallsHiddenFacetUsingAlwaysHideWhenNotAndRemovesMethod() {
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet.when()

    protected boolean valid(final Request request, final ObjectAdapter adapter) {
        final ObjectSpecification specification = adapter.getSpecification();
        final AuthenticationSession session = IsisContext.getAuthenticationSession();
        final List<ObjectAssociation> visibleFields = specification.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.dynamicallyVisible(session, adapter, where));
        final ImmutableFacet facet = specification.getFacet(ImmutableFacet.class);
        final boolean isImmutable = facet != null && facet.when() == When.ALWAYS;
        final boolean isImmutableOncePersisted = facet != null && facet.when() == When.ONCE_PERSISTED && adapter.representsPersistent();
        return visibleFields.size() > 0 && !isImmutable && !isImmutableOncePersisted;
    }

    @Override
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.immutable.immutableannot.ImmutableFacetAnnotation.when()

        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof ImmutableFacetAnnotation);
        final ImmutableFacetAnnotation immutableFacetAnnotation = (ImmutableFacetAnnotation) facet;
        assertEquals(When.ALWAYS, immutableFacetAnnotation.when());

        assertNoMethodsRemoved();
    }

    public void testImmutableAnnotationAlwaysPickedUpOnClass() {
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.object.immutable.immutablemarkerifc.ImmutableFacetMarkerInterface.when()

        final Facet facet = facetedMethod.getFacet(ImmutableFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof ImmutableFacetMarkerInterface);
        final ImmutableFacetMarkerInterface immutableFacetMarkerInterface = (ImmutableFacetMarkerInterface) facet;
        assertEquals(When.ALWAYS, immutableFacetMarkerInterface.when());

        assertNoMethodsRemoved();
    }

    public void testImmutableOncePersisted() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.