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

Examples of org.apache.isis.viewer.wicket.model.models.EntityModel


    public EntityPage(ObjectAdapter adapter, ConcurrencyException exIfAny) {
        this(new PageParameters(), newEntityModel(adapter, exIfAny));
    }

    private static EntityModel newEntityModel(ObjectAdapter adapter, ConcurrencyException exIfAny) {
        EntityModel model = new EntityModel(adapter);
        model.setException(exIfAny);
        return model;
    }
View Full Code Here


    @Override
    protected ApplicationAdvice appliesTo(final IModel<?> model) {
        if (!(model instanceof EntityModel)) {
            return ApplicationAdvice.DOES_NOT_APPLY;
        }
        final EntityModel entityModel = (EntityModel) model;
        final ObjectAdapter adapter = entityModel.getObject();
        if (adapter == null) {
            // is ok;
        }
        final ObjectSpecification specification = entityModel.getTypeOfSpecification();
        final boolean isObject = specification.isNotCollection();
        final boolean isValue = specification.containsFacet(ValueFacet.class);
        return appliesIf(isObject && !isValue);
    }
View Full Code Here

        super(ComponentType.ENTITY_COLLECTIONS, EntityCollectionsPanel.class);
    }

    @Override
    public Component createComponent(final String id, final IModel<?> model) {
        final EntityModel entityModel = (EntityModel) model;
        return new EntityCollectionsPanel(id, entityModel);
    }
View Full Code Here

        super(ComponentType.ENTITY_ICON_AND_TITLE, EntityIconAndTitlePanel.class);
    }

    @Override
    public Component createComponent(final String id, final IModel<?> model) {
        final EntityModel entityModel = (EntityModel) model;
        return new EntityIconAndTitlePanel(id, entityModel);
    }
View Full Code Here

        buildEntityPropertiesAndOrCollectionsGui();
        setOutputMarkupId(true); // so can repaint via ajax
    }

    private void buildEntityPropertiesAndOrCollectionsGui() {
        final EntityModel model = getModel();
        final ObjectAdapter adapter = model.getObject();
        if (adapter != null) {
            addCollections();
        } else {
            permanentlyHide(ID_ENTITY_COLLECTIONS);
        }
View Full Code Here

            permanentlyHide(ID_ENTITY_COLLECTIONS);
        }
    }

    private void addCollections() {
        final EntityModel entityModel = getModel();
        final ObjectAdapter adapter = entityModel.getObject();
        final ObjectSpecification noSpec = adapter.getSpecification();
        final List<ObjectAssociation> associations = visibleCollections(adapter, noSpec);

        final RepeatingView collectionRv = new RepeatingView(ID_COLLECTIONS);
        add(collectionRv);
View Full Code Here

        int maxTitleLength = abbreviateTo(getModel(), titleString);
        return abbreviated(titleString, maxTitleLength);
    }

    private String determineTitle() {
        EntityModel model = getModel();
        final ObjectAdapter adapter = model.getObject();
        return adapter != null ? adapter.titleString(getContextAdapterIfAny()) : "(no object)";
    }
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

        ObjectAdapter targetAdapter = null;
        try {
            targetAdapter = getActionModel().getTargetAdapter();
           
            getComponentFactoryRegistry().addOrReplaceComponent(this, ComponentType.PARAMETERS, getActionModel());
            getComponentFactoryRegistry().addOrReplaceComponent(this, ComponentType.ENTITY_ICON_AND_TITLE, new EntityModel(targetAdapter));

            final String actionName = getActionModel().getActionMemento().getAction().getName();
            addOrReplace(new Label(ID_ACTION_NAME, Model.of(actionName)));
           
        } catch (final ConcurrencyException ex) {
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

TOP

Related Classes of org.apache.isis.viewer.wicket.model.models.EntityModel

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.