Package org.apache.isis.viewer.html.component

Examples of org.apache.isis.viewer.html.component.Table


        IsisContext.getPersistenceSession().resolveField(object, collection);

        context.addCollectionFieldCrumb(collection.getName());
        content.add(context.getComponentFactory().createHeading(collection.getName()));
        final Table table = TableUtil.createTable(context, id, object, collection);
        content.add(table);
        if (collection.isUsable(IsisContext.getAuthenticationSession(), object, where).isAllowed()) {
            content.add(context.getComponentFactory().createAddOption(id, collection.getId()));
        }
    }
View Full Code Here


        final List<ObjectAssociation> columnAssociations = elementType.getAssociations(Filters.and(WHEN_VISIBLE_IRRESPECTIVE_OF_WHERE, PROPERTIES));

        final int len = columnAssociations.size();

        final ComponentFactory factory = context.getComponentFactory();
        final Table table = factory.createTable(len, addSelector);
        table.setSummary(summary);

        for (final ObjectAssociation columnAssociation : columnAssociations) {
            table.addColumnHeader(columnAssociation.getName());
        }

        for (final ObjectAdapter rowAdapter : facet.iterable(collection)) {
            getPersistenceSession().resolveImmediately(rowAdapter);
            final String elementId = context.mapObject(rowAdapter);
            table.addRowHeader(factory.createObjectIcon(rowAdapter, elementId, "icon"));

            for (final ObjectAssociation columnAssociation : columnAssociations) {
                final ObjectAdapter columnAdapter = columnAssociation.get(rowAdapter);

                final ObjectSpecification columnSpec = columnAssociation.getSpecification();

                if (!columnAssociation.isVisible(getAuthenticationSession(), rowAdapter, where).isAllowed()) {
                    table.addEmptyCell();
                } else if (columnSpec.isParseable()) {
                    final MultiLineFacet multiline = columnSpec.getFacet(MultiLineFacet.class);
                    final boolean shouldTruncate = multiline != null && multiline.numberOfLines() > 1;
                    final String titleString = columnAdapter != null ? columnAdapter.titleString() : "";
                    table.addCell(titleString, shouldTruncate);
                } else if (columnAdapter == null) {
                    table.addEmptyCell();
                } else {
                    getPersistenceSession().resolveImmediately(columnAdapter);
                    final String objectId = context.mapObject(columnAdapter);
                    table.addCell(factory.createObjectIcon(columnAssociation, columnAdapter, objectId, "icon"));
                }
            }
            /*
             * if (addSelector) {
             * table.addCell(context.getFactory().createRemoveOption(id,
 
View Full Code Here

            iconName = elementSpecification.getShortIdentifier();
        }
        content.setIconName(iconName);

        if (elementSpecification.getAssociations(ObjectAssociationFilters.WHEN_VISIBLE_IRRESPECTIVE_OF_WHERE).size() != 0) {
            final Table table = TableUtil.createTable(context, false, collection, titleString, elementSpecification);
            content.add(table);
        } else {
            // TODO this should create a list component instead of a table
            final Table table = TableUtil.createTable(context, false, collection, titleString, elementSpecification);
            content.add(table);
        }

        context.addCollectionCrumb(idString);
View Full Code Here

            iconName = elementSpecification.getShortIdentifier();
        }
        content.setIconName(iconName);

        if (elementSpecification.getAssociations(ObjectAssociationFilters.STATICALLY_VISIBLE_ASSOCIATIONS).size() != 0) {
            final Table table = TableUtil.createTable(context, false, collection, titleString, elementSpecification);
            content.add(table);
        } else {
            // TODO this should create a list component instead of a table
            final Table table = TableUtil.createTable(context, false, collection, titleString, elementSpecification);
            content.add(table);
        }

        context.addCollectionCrumb(idString);
View Full Code Here

        IsisContext.getPersistenceSession().resolveField(object, collection);

        context.addCollectionFieldCrumb(collection.getName());
        content.add(context.getComponentFactory().createHeading(collection.getName()));
        final Table table = TableUtil.createTable(context, id, object, collection);
        content.add(table);
        if (collection.isUsable(IsisContext.getAuthenticationSession(), object).isAllowed()) {
            content.add(context.getComponentFactory().createAddOption(id, collection.getId()));
        }
    }
View Full Code Here

        final List<ObjectAssociation> columnAssociations = elementType.getAssociations(Filters.and(STATICALLY_VISIBLE_ASSOCIATIONS, PROPERTIES));

        final int len = columnAssociations.size();

        final ComponentFactory factory = context.getComponentFactory();
        final Table table = factory.createTable(len, addSelector);
        table.setSummary(summary);

        for (final ObjectAssociation columnAssociation : columnAssociations) {
            table.addColumnHeader(columnAssociation.getName());
        }

        for (final ObjectAdapter rowAdapter : facet.iterable(collection)) {
            getPersistenceSession().resolveImmediately(rowAdapter);
            final String elementId = context.mapObject(rowAdapter);
            table.addRowHeader(factory.createObjectIcon(rowAdapter, elementId, "icon"));

            for (final ObjectAssociation columnAssociation : columnAssociations) {
                final ObjectAdapter columnAdapter = columnAssociation.get(rowAdapter);

                final ObjectSpecification columnSpec = columnAssociation.getSpecification();
                if (!columnAssociation.isVisible(getAuthenticationSession(), rowAdapter).isAllowed()) {
                    table.addEmptyCell();
                } else if (columnSpec.isParseable()) {
                    final MultiLineFacet multiline = columnSpec.getFacet(MultiLineFacet.class);
                    final boolean shouldTruncate = multiline != null && multiline.numberOfLines() > 1;
                    final String titleString = columnAdapter != null ? columnAdapter.titleString() : "";
                    table.addCell(titleString, shouldTruncate);
                } else if (columnAdapter == null) {
                    table.addEmptyCell();
                } else {
                    getPersistenceSession().resolveImmediately(columnAdapter);
                    final String objectId = context.mapObject(columnAdapter);
                    table.addCell(factory.createObjectIcon(columnAssociation, columnAdapter, objectId, "icon"));
                }
            }
            /*
             * if (addSelector) {
             * table.addCell(context.getFactory().createRemoveOption(id,
 
View Full Code Here

        IsisContext.getPersistenceSession().resolveField(object, collection);

        context.addCollectionFieldCrumb(collection.getName());
        content.add(context.getComponentFactory().createHeading(collection.getName()));
        final Table table = TableUtil.createTable(context, id, object, collection);
        content.add(table);
        if (collection.isUsable(IsisContext.getAuthenticationSession(), object).isAllowed()) {
            content.add(context.getComponentFactory().createAddOption(id, collection.getId()));
        }
    }
View Full Code Here

            elementType.getAssociations(Filters.and(STATICALLY_VISIBLE_ASSOCIATIONS, PROPERTIES));

        final int len = columnAssociations.size();

        final ComponentFactory factory = context.getComponentFactory();
        final Table table = factory.createTable(len, addSelector);
        table.setSummary(summary);

        for (final ObjectAssociation columnAssociation : columnAssociations) {
            table.addColumnHeader(columnAssociation.getName());
        }

        for (final ObjectAdapter rowAdapter : facet.iterable(collection)) {
            getPersistenceSession().resolveImmediately(rowAdapter);
            final String elementId = context.mapObject(rowAdapter);
            table.addRowHeader(factory.createObjectIcon(rowAdapter, elementId, "icon"));

            for (final ObjectAssociation columnAssociation : columnAssociations) {
                final ObjectAdapter columnAdapter = columnAssociation.get(rowAdapter);

                final ObjectSpecification columnSpec = columnAssociation.getSpecification();
                if (!columnAssociation.isVisible(getAuthenticationSession(), rowAdapter).isAllowed()) {
                    table.addEmptyCell();
                } else if (columnSpec.isParseable()) {
                    final MultiLineFacet multiline = columnSpec.getFacet(MultiLineFacet.class);
                    final boolean shouldTruncate = multiline != null && multiline.numberOfLines() > 1;
                    final String titleString = columnAdapter != null ? columnAdapter.titleString() : "";
                    table.addCell(titleString, shouldTruncate);
                } else if (columnAdapter == null) {
                    table.addEmptyCell();
                } else {
                    getPersistenceSession().resolveImmediately(columnAdapter);
                    final String objectId = context.mapObject(columnAdapter);
                    table.addCell(factory.createObjectIcon(columnAssociation, columnAdapter, objectId, "icon"));
                }
            }
            /*
             * if (addSelector) { table.addCell(context.getFactory().createRemoveOption(id, elementId,
             * collectionField.getId())); }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.html.component.Table

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.