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

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


        }
        requestRepaintPanel(target);
    }

    private boolean isAnythingEditable() {
        final EntityModel entityModel = (EntityModel) getModel();
        final ObjectAdapter adapter = entityModel.getObject();

        return !enabledAssociations(adapter, adapter.getSpecification()).isEmpty();
    }
View Full Code Here


    }

    @Override
    protected void onBeforeRenderWhenDisabled(final String disableReason) {
        super.onBeforeRenderWhenDisabled(disableReason);
        final EntityModel entityLinkModel = (EntityModel) entityLink.getModel();
        entityLinkModel.toViewMode();
        entityLink.add(new AttributeModifier("title", Model.of(disableReason)));
        syncWithInput();
    }
View Full Code Here

        final ObjectAdapter adapter = getModel().getPendingElseCurrentAdapter();

        // syncLinkWithInput
        if (adapter != null) {
            if(getComponentForRegular() != null) {
                final EntityModel entityModelForLink = new EntityModel(adapter);
               
                entityModelForLink.setContextAdapterIfAny(getModel().getContextAdapterIfAny());
                entityModelForLink.setRenderingHint(getModel().getRenderingHint());
               
                final ComponentFactory componentFactory =
                        getComponentFactoryRegistry().findComponentFactory(ComponentType.ENTITY_ICON_AND_TITLE, entityModelForLink);
                final Component component = componentFactory.createComponent(entityModelForLink);
               
View Full Code Here

    }

    private void buildMessageForModel(StringBuilder buf, IModel<?> model) {
        buf.append(model.getClass().getSimpleName()).append(" ");
        if(model instanceof EntityModel) {
            EntityModel entityModel = (EntityModel) model;
            ObjectAdapter objectAdapter = entityModel.getObject();
            if(objectAdapter != null) {
                buf.append("objectAdapter oid: " + objectAdapter.getOid());
            } else {
                buf.append("objectAdapter is NULL");
            }
View Full Code Here

            AbstractLink link = new AbstractLink(ID_SUBSCRIBING_LINK) {
                private static final long serialVersionUID = 1L;
            };
            return link;
        } else {
            final EntityModel entityModel = (EntityModel) uiHintContainer;
            final PageParameters pageParameters = entityModel.getPageParameters();
            final Class<? extends Page> pageClass = getPageClassRegistry().getPageClass(PageType.ENTITY);
            return Links.newBookmarkablePageLink(ID_SUBSCRIBING_LINK, pageParameters, pageClass);
        }
    }
View Full Code Here

    @Override
    public ApplicationAdvice appliesTo(final IModel<?> model) {
        if (!(model instanceof EntityModel)) {
            return ApplicationAdvice.DOES_NOT_APPLY;
        }
        final EntityModel entityModel = (EntityModel) model;
        final ObjectSpecification specification = entityModel.getTypeOfSpecification();
        return appliesIf(specification != null && !specification.containsFacet(ValueFacet.class));
    }
View Full Code Here

        return appliesIf(specification != null && !specification.containsFacet(ValueFacet.class));
    }

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

    private void syncWithInput() {
        final ObjectAdapter adapter = getPendingElseCurrentAdapter();

        if (adapter != null) {
            final EntityModel entityModelForLink = new EntityModel(adapter);
            entityModelForLink.setContextAdapterIfAny(getEntityModel().getContextAdapterIfAny());
            entityModelForLink.setRenderingHint(getEntityModel().getRenderingHint());
           
            final ComponentFactory componentFactory = getComponentFactoryRegistry().findComponentFactory(ComponentType.ENTITY_ICON_AND_TITLE, entityModelForLink);
            final Component component = componentFactory.createComponent(entityModelForLink);
            addOrReplace(component);
           
View Full Code Here

        final List<ObjectAdapter> adapterList = model.getObject();
        final RepeatingView entityInstances = new RepeatingView(ID_ENTITY_INSTANCE);
        add(entityInstances);
        for (final ObjectAdapter adapter : adapterList) {
            final String childId = entityInstances.newChildId();
            final EntityModel entityModel = new EntityModel(adapter);
            final EntityHeaderPanel entitySummaryPanel = new EntityHeaderPanel(childId, entityModel);
            entityInstances.add(entitySummaryPanel);
        }
    }
View Full Code Here

    /**
     * Called reflectively, in support of
     * {@link BookmarkablePageLink bookmarkable} links.
     */
    public EntityPage(final PageParameters pageParameters) {
        this(pageParameters, new EntityModel(pageParameters));
    }
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.