Examples of EntityModel


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

    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

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

    }

    @Override
    protected void onBeforeRenderWhenDisabled(final String disableReason) {
        super.onBeforeRenderWhenDisabled(disableReason);
        final EntityModel entityLinkModel = (EntityModel) entityLink.getModel();
        entityLinkModel.toViewMode();
       
        setTitleAttribute(disableReason);

        entityLink.syncVisibilityAndUsability();
    }
View Full Code Here

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

        addOrReplace(component);
    }


    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

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

    public ActionPromptHeaderPanel(String id, final ActionModel model) {
        super(id, model);

        ObjectAdapter targetAdapter = model.getTargetAdapter();

        getComponentFactoryRegistry().addOrReplaceComponent(this, ComponentType.ENTITY_ICON_AND_TITLE, new EntityModel(targetAdapter));

        add(new Label(ID_ACTION_NAME, new AbstractReadOnlyModel<String>() {
            @Override
            public String getObject() {
                return model.getActionMemento().getAction().getName();
View Full Code Here

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

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

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

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

    /**
     * Called reflectively, in support of
     * {@link BookmarkablePageLink bookmarkable} links.
     */
    public EntityPage(final PageParameters pageParameters) {
        this(pageParameters, new EntityModel(pageParameters));
    }
View Full Code Here

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

    }

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

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

           
    @Override
    public void populateItem(final Item<ICellPopulator<ObjectAdapter>> cellItem, final String componentId, final IModel<ObjectAdapter> rowModel) {
        final MarkupContainer row = cellItem.getParent().getParent();
        row.setOutputMarkupId(true);
        final EntityModel entityModel = (EntityModel) rowModel;
        String concurrencyExceptionIfAny = entityModel.getAndClearConcurrencyExceptionIfAny();
        if(concurrencyExceptionIfAny != null) {
            row.add(new CssClassAppender("reloaded-after-concurrency-exception"));
        }
       
        final ContainedToggleboxPanel toggle = new ContainedToggleboxPanel(componentId) {
            private static final long serialVersionUID = 1L;
            @Override
            public void onSubmit(AjaxRequestTarget target) {
                final EntityModel entityModel = (EntityModel) rowModel;
                ObjectAdapter selectedAdapter = null;
                try {
                    selectedAdapter = entityModel.load(ConcurrencyChecking.CHECK);
                    handler.onSelected(this, selectedAdapter, target);
                } catch(ConcurrencyException ex) {

                    // should work second time, because the previous attempt will have updated the OAM's OIDs version.
                    selectedAdapter = entityModel.load(ConcurrencyChecking.CHECK);
                    handler.onConcurrencyException(this, selectedAdapter, ex, target);
                   
                    entityModel.setException(ex);
                }
            }
        };
        rowToggles.add(toggle);
        toggle.setOutputMarkupId(true);
View Full Code Here

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

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

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

        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 ComponentFactory componentFactory =
//                        getComponentFactoryRegistry().findComponentFactory(ComponentType.ENTITY_ICON_TITLE_AND_COPYLINK, entityModelForLink);
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.