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

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


        addTableHeader();
        addTableRows();
    }

    private void addTableHeader() {
        final EntityCollectionModel model = getModel();
        final ObjectSpecification typeOfSpec = model.getTypeOfSpecification();
        final RepeatingView propertyNames = new RepeatingView("propertyName");
        add(propertyNames);

        final List<? extends ObjectAssociation> propertyList =
            typeOfSpec.getAssociations(ObjectAssociationFilters.PROPERTIES);
View Full Code Here


            propertyNames.add(new Label(property.getId(), property.getName()));
        }
    }

    private void addTableRows() {
        final EntityCollectionModel model = getModel();
        final List<ObjectAdapter> adapterList = model.getObject();
        final RepeatingView entityInstances = new RepeatingView("entityInstance");
        add(entityInstances);
        for (final ObjectAdapter adapter : adapterList) {
            final String childId = entityInstances.newChildId();
            entityInstances.add(new CollectionContentsInstanceAsTableRow(childId, new EntityModel(adapter)));
View Full Code Here

        return ApplicationAdvice.APPLIES;
    }

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

    @Override
    public ApplicationAdvice appliesTo(final IModel<?> model) {
        if(!(model instanceof EntityCollectionModel)) {
            return ApplicationAdvice.DOES_NOT_APPLY;
        }
        final EntityCollectionModel entityCollectionModel = (EntityCollectionModel) model;
       
        // TOFIX: because of Javascript issues, currently only works for standalone views.
        if(!entityCollectionModel.isStandalone()) {
            return ApplicationAdvice.DOES_NOT_APPLY;
        }

        final ObjectSpecification elementSpec = entityCollectionModel.getTypeOfSpecification();
        List<ObjectAssociation> associations = elementSpec.getAssociations(OF_TYPE_DATE);
        return appliesIf(!associations.isEmpty());
    }
View Full Code Here

        return appliesIf(!associations.isEmpty());
    }

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

        buildGui();
    }

    private void buildGui() {

        final EntityCollectionModel model = getModel();
       
        final ObjectSpecification elementSpec = model.getTypeOfSpecification();

        final FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK);
        feedback.setOutputMarkupId(true);
        addOrReplace(feedback);
View Full Code Here

        return ApplicationAdvice.APPLIES;
    }

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

    private static final String ID_COLLECTION = "collection";
    private static final String ID_FEEDBACK = "feedback";

    private static EntityCollectionModel createEntityCollectionModel(EntityModel entityModel, OneToManyAssociation otma) {
        EntityCollectionModel collectionModel = EntityCollectionModel.createParented(entityModel, otma);
        List<LinkAndLabel> entityActions = EntityActionUtil.entityActions(entityModel, otma);

        collectionModel.addEntityActions(entityActions);
        return collectionModel;
    }
View Full Code Here

    public ApplicationAdvice appliesTo(final IModel<?> model) {
        if (!(model instanceof EntityCollectionModel)) {
            return ApplicationAdvice.DOES_NOT_APPLY;
        }

        final EntityCollectionModel entityCollectionModel = (EntityCollectionModel) model;
        final ObjectSpecification typeOfSpec = entityCollectionModel.getTypeOfSpecification();
        if (typeOfSpec.getFacet(IconFacet.class) == null) {
            return ApplicationAdvice.DOES_NOT_APPLY;
        }
        return ApplicationAdvice.APPLIES;
    }
View Full Code Here

        return ApplicationAdvice.APPLIES;
    }

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

TOP

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

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.