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

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


                    }
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("pending is null");
                    }
                   
                    final ObjectAdapterMemento objectAdapterMemento = owner.getScalarModel().getObjectAdapterMemento();
                    owner.setPending(objectAdapterMemento);

                    return objectAdapterMemento;
                }
View Full Code Here


    private void buildGui() {
        final HomePageTuple homePageTuple = lookupHomePageAction();
        if(homePageTuple != null) {
            Components.permanentlyHide(this, ComponentType.WELCOME);
            final ObjectAdapterMemento serviceMemento = MementoFunctions.fromAdapter().apply(homePageTuple.serviceAdapter);
            ActionMemento homePageActionMemento = MementoFunctions.fromAction().apply(homePageTuple.action);
            Mode mode = homePageTuple.action.getParameterCount() > 0? Mode.PARAMETERS : Mode.RESULTS;
            final IModel<?> actionModel = ActionModel.create(serviceMemento, homePageActionMemento, mode, SingleResultsMode.INLINE);
            getComponentFactoryRegistry().addOrReplaceComponent(this, ComponentType.ACTION, actionModel);
        } else {
View Full Code Here

    private final static MemberOrderFacetComparator memberOrderFacetComparator = new MemberOrderFacetComparator(false);
   
    public static List<LinkAndLabel> entityActions(EntityModel entityModel, ObjectAssociation association) {
        final ObjectSpecification adapterSpec = entityModel.getTypeOfSpecification();
        final ObjectAdapter adapter = entityModel.load(ConcurrencyChecking.NO_CHECK);
        final ObjectAdapterMemento adapterMemento = entityModel.getObjectAdapterMemento();
       
        @SuppressWarnings("unchecked")
        final List<ObjectAction> userActions = adapterSpec.getObjectActions(ActionType.USER, Contributed.INCLUDED,
                Filters.and(ObjectActions.memberOrderOf(association), EntityActionUtil.dynamicallyVisibleFor(adapter)));
        Collections.sort(userActions, new Comparator<ObjectAction>() {
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);
                if (subMenuItemBuilder == null) {
                    // not visible
                    continue;
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

        return (Iterable<Object>) resultAdapter.getObject();
    }

   
    public void toggleSelectionOn(ObjectAdapter selectedAdapter) {
        ObjectAdapterMemento selectedAsMemento = ObjectAdapterMemento.createOrNull(selectedAdapter);
       
        // try to remove; if couldn't, then mustn't have been in there, in which case add.
        boolean removed = toggledMementosList.remove(selectedAsMemento);
        if(!removed) {
            toggledMementosList.add(selectedAsMemento);
View Full Code Here

            this.hasPending = false;
            this.pending = null;
        }

        private ObjectAdapter getPendingAdapter() {
            final ObjectAdapterMemento memento = getObject();
            return memento != null ? memento.getObjectAdapter(ConcurrencyChecking.NO_CHECK) : null;
        }
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

        final List<ObjectAdapterMemento> choicesMementos = getChoiceMementos(argsIfAvailable);
       
        final ChoiceProvider<ObjectAdapterMemento> provider = newChoiceProvider(choicesMementos);
        select2Field.setProvider(provider);
        getModel().clearPending();
        final ObjectAdapterMemento objectAdapterMemento = getModel().getObjectAdapterMemento();
        if(!choicesMementos.contains(objectAdapterMemento)) {
            final ObjectAdapterMemento newAdapterMemento =
                    !choicesMementos.isEmpty()
                    ? choicesMementos.get(0)
                    : null;
            select2Field.getModel().setObject(newAdapterMemento);
            getModel().setObject(
                    newAdapterMemento != null? newAdapterMemento.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);
            entityActions = EntityActionUtil.entityActions(parentEntityModel, scalarModel.getPropertyMemento().getProperty());
        } else {
            entityActions = null;
        }
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.