Package org.apache.isis.viewer.wicket.model.mementos

Examples of org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento


                return memberOrderFacetComparator.compare(m1, m2);
            }});
       
        final ActionLinkFactory linkFactory = new EntityActionLinkFactory(entityModel);
   
        final ObjectAdapterMemento adapterMemento = entityModel.getObjectAdapterMemento();
        return Lists.transform(associatedActions, new Function<ObjectAction, LinkAndLabel>(){
   
            @Override
            public LinkAndLabel apply(ObjectAction objectAction) {
                return linkFactory.newLink(adapterMemento, objectAction, LinksSelectorPanelAbstract.ID_ADDITIONAL_LINK, actionPromptModalWindowProvider);
View Full Code Here


                final ObjectAdapter serviceAdapter = logicalServiceAction.serviceAdapter;
                final ObjectSpecification serviceSpec = serviceAdapter.getSpecification();
                if (serviceSpec.isHidden()) {
                    continue;
                }
                final ObjectAdapterMemento serviceAdapterMemento = logicalServiceAction.serviceAdapterMemento;
                final ObjectAction objectAction = logicalServiceAction.objectAction;
                final Builder subMenuItemBuilder = serviceMenuItem.newSubMenuItem(serviceAdapterMemento, objectAction, cssMenuLinkFactory, actionPromptModalWindowProvider);
                if (subMenuItemBuilder == null) {
                    // not visible
                    continue;
View Full Code Here

        return image;
    }

    public ObjectAdapter getContextAdapterIfAny() {
        EntityModel model = getModel();
        ObjectAdapterMemento contextAdapterMementoIfAny = model.getContextAdapterIfAny();
        return contextAdapterMementoIfAny != null? contextAdapterMementoIfAny.getObjectAdapter(ConcurrencyChecking.NO_CHECK): null;
    }
View Full Code Here

    }
   
    protected void addAdditionalLinksTo(final FormComponentLabel labelIfRegular) {
        final List<LinkAndLabel> entityActions;
        if(scalarModel.getKind() == ScalarModel.Kind.PROPERTY) {
            final ObjectAdapterMemento parentMemento = scalarModel.getParentObjectAdapterMemento();
            final EntityModel parentEntityModel = new EntityModel(parentMemento);
            final ActionPromptProvider provider = ActionPromptProvider.Util.getFrom(this);
            entityActions = EntityActionUtil.entityActions(parentEntityModel, scalarModel.getPropertyMemento().getProperty(), provider);
        } else {
            entityActions = null;
View Full Code Here


    private void buildEntityActionsGui() {
        final EntityModel model = getModel();
        final ObjectAdapter adapter = model.getObject();
        final ObjectAdapterMemento adapterMemento = model.getObjectAdapterMemento();
        if (adapter != null) {
            final List<ObjectAction> topLevelActions = getTopLevelActions(adapter);

            if(!topLevelActions.isEmpty()) {
                final CssMenuBuilder cssMenuBuilder = new CssMenuBuilder(adapterMemento, getServiceAdapters(), topLevelActions, linkFactory);
View Full Code Here

    @Override
    public String convertToString(final Object object, final Locale locale) {
        if (object == null) {
            return null;
        }
        final ObjectAdapterMemento memento = (ObjectAdapterMemento) object;
        final Oid oid = memento.getObjectAdapter(ConcurrencyChecking.NO_CHECK).getOid();
        if (oid == null) {
            // values don't have an Oid...
            // REVIEW: is this right?
            return memento.toString();
        }
        return oid.enString(getOidMarshaller());
    }
View Full Code Here

    private void addMenuItemsIfVisible(final List<CssMenuItem> menuItems, final ObjectAdapter serviceAdapter) {
        final ObjectSpecification serviceSpec = serviceAdapter.getSpecification();
        if (serviceSpec.isHidden()) {
            return;
        }
        final ObjectAdapterMemento serviceAdapterMemento = ObjectAdapterMemento.createOrNull(serviceAdapter);
        final String serviceName = serviceSpec.getFacet(NamedFacet.class).value();
        final CssMenuItem serviceMenuItem = CssMenuItem.newMenuItem(serviceName).build();

        addActionSubMenuItems(serviceAdapterMemento, serviceMenuItem);
        if (serviceMenuItem.hasSubMenuItems()) {
View Full Code Here

    }

    private void buildEntityActionsGui() {
        final EntityModel model = getModel();
        final ObjectAdapter adapter = model.getObject();
        final ObjectAdapterMemento adapterMemento = model.getObjectAdapterMemento();
        if (adapter != null) {
            final List<ObjectAction> userActions = adapter.getSpecification().getObjectActions(ActionType.USER, Contributed.INCLUDED);

            final CssMenuBuilder cssMenuBuilder = new CssMenuBuilder(adapterMemento, getServiceAdapters(), userActions, linkFactory);
            // TODO: i18n
View Full Code Here

        // skip if annotated to not be contributed
        if (contributedAction.getFacet(NotContributedFacet.class) != null) {
            return;
        }

        final ObjectAdapterMemento serviceAdapterMemento = determineAdapterFor(contributedAction);

        final Builder subMenuItemBuilder = parent.newSubMenuItem(serviceAdapterMemento, contributedAction, cssMenuLinkFactory);
        if (subMenuItemBuilder != null) {
            // could be null if invisible
            subMenuItemBuilder.build();
View Full Code Here

    @Override
    public String convertToString(final Object object, final Locale locale) {
        if (object == null) {
            return null;
        }
        final ObjectAdapterMemento memento = (ObjectAdapterMemento) object;
        final Oid oid = memento.getObjectAdapter().getOid();
        if (oid == null) {
            // values don't have an Oid, but we don't support 'em
            return memento.toString();

            // throw new IllegalStateException(
            // "cannot convert memento to OBJECT_OID; memento's adapter is a value so has no OBJECT_OID");
        }
        return getOidStringifier().enString(oid);
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento

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.