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

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


        super(ComponentType.ENTITY_SUMMARY, EntityHeaderPanel.class);
    }

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


        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

        super(ComponentType.ENTITY, NAME, EntityCombinedPanel.class);
    }

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

        super(id, entityModel);
        buildGui();
    }

    private void buildGui() {
        final EntityModel model = getModel();
        final CssClassFacet facet = model.getObject().getSpecification().getFacet(CssClassFacet.class);
        if(facet != null) {
            this.add(new CssClassAppender(facet.value()));
        }

        addOrReplace(ComponentType.ENTITY_SUMMARY, model);
View Full Code Here

        super(ComponentType.ENTITY_PROPERTIES, EntityPropertiesPanel.class);
    }

    @Override
    public Component createComponent(final String id, final IModel<?> model) {
        final EntityModel entityModel = (EntityModel) model;
        return new EntityPropertiesPanel(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) {
            form = new EntityPropertiesForm(ID_ENTITY_PROPERTIES, model, this);
            addOrReplace(form);
        } else {
            permanentlyHide(ID_ENTITY_PROPERTIES);
View Full Code Here

    }

    private Component createComponent(final String id, final IModel<ObjectAdapter> rowModel) {

        final ObjectAdapter adapter = rowModel.getObject();
        final EntityModel model = new EntityModel(adapter);
        final OneToOneAssociation property = (OneToOneAssociation) adapter.getSpecification().getAssociation(propertyExpression);
        final PropertyMemento pm = new PropertyMemento(property);
        final ScalarModel scalarModel = model.getPropertyModel(pm);

        scalarModel.setRenderingHint(RenderingHint.PROPERTY_COLUMN);
        scalarModel.toViewMode();

        final ComponentFactory componentFactory = findComponentFactory(ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
View Full Code Here

           
    @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

        cellItem.add(component);
    }

    private Component createComponent(final String id, final IModel<ObjectAdapter> rowModel) {
        final ObjectAdapter adapter = rowModel.getObject();
        final EntityModel model = new EntityModel(adapter);
        model.setRenderingHint(parentAdapterMementoIfAny != null? RenderingHint.PARENTED_TITLE_COLUMN: RenderingHint.STANDALONE_TITLE_COLUMN);
        model.setContextAdapterIfAny(parentAdapterMementoIfAny);
        // will use EntityLinkSimplePanelFactory as model is an EntityModel
        final ComponentFactory componentFactory = findComponentFactory(ComponentType.ENTITY_LINK, model);
        return componentFactory.createComponent(id, model);
    }
View Full Code Here

                private static final long serialVersionUID = 1L;
   
                @Override
                protected void onUpdate(AjaxRequestTarget target) {
                    final String oidStr = breadcrumbChoice.getInput();
                    final EntityModel selectedModel = breadcrumbModel.lookup(oidStr);
                    if(selectedModel == null) {
                        final MessageBroker messageBroker = IsisContext.getAuthenticationSession().getMessageBroker();
                        messageBroker.addWarning("Cannot find object");
                        String feedbackMsg = JGrowlUtil.asJGrowlCalls(messageBroker);
                        target.appendJavaScript(feedbackMsg);
                        breadcrumbModel.remove(oidStr);
                        return;
                    }
                    setResponsePage(EntityPage.class, selectedModel.getPageParameters());
                }
            });
       
        final Settings settings = breadcrumbChoice.getSettings();
        settings.setMinimumInputLength(0);
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.