Package com.vaadin.ui.Table

Examples of com.vaadin.ui.Table.ColumnGenerator


                return field;
             
      }
    });

        table.addGeneratedColumn("translation", new ColumnGenerator() {
            @Override
            public Object generateCell(Table source, Object itemId, Object columnId) {
                ProcessQueue queue = (ProcessQueue) itemId;
                String translation = getMessage(queue.getDescription());
                return translation != null ? translation : "";
View Full Code Here


        table.setSelectable(true);

        bic = new BeanItemContainer<TaskTableItem>(TaskTableItem.class);
        fillTaskList(bic);
        table.setContainerDataSource(bic);
        table.addGeneratedColumn("definitionName", new ColumnGenerator() {
            @Override
            public Component generateCell(Table source, Object itemId, Object columnId) {
                TaskTableItem tti = bic.getItem(itemId).getBean();
                String definitionName = getMessage(tti.getDefinitionName());
                return new Label(definitionName, Label.CONTENT_XHTML);
            }
        });
        table.addGeneratedColumn("state", new ColumnGenerator() {
            @Override
            public Component generateCell(Table source, Object itemId, Object columnId) {
                TaskTableItem tti = bic.getItem(itemId).getBean();
                String state = getMessage(tti.getState());
                return new Label(state, Label.CONTENT_XHTML);
View Full Code Here

        detailsView.addComponent(VaadinUtility.hr());
        addComponent(detailsView);

        Table taskTable = attachTitledTable(detailsView, "log.details", taskDetailsContainer, new Object[] {"title", "component"},
                new HashMap<String, ColumnGenerator>() {{
                    put("component", new ColumnGenerator() {
                        @Override
                        public Object generateCell(Table source, Object itemId, Object columnId) {
                            Item item = logContainer.getItemDirectly(log);
                            Property property = item.getItemProperty(itemId);
                            if (property != null && property.getValue() != null) {
                                String value = (String) property.getValue();
                                if (Strings.hasText(value) && ("log.substitutedBy".equals(itemId) || "log.author".equals(itemId))) {
                                    return VaadinUtility.labelWithIcon(getImage("/img/user_standard.png"), value, null, getMessagePrefixed(itemId.toString()));
                                }
                                return VaadinUtility.boldLabel(value);
                            }
                            return null;
                        }
                    });
                }});
        // being stupid is its own reward
        taskTable.setHeight(22 * (taskDetailsPropertyNames.length - 2) + 50, Sizeable.UNITS_PIXELS);

        Collection<Button> taskButtons = createTaskButtons(log);
        HorizontalLayout buttons = VaadinUtility.horizontalLayout(Alignment.MIDDLE_LEFT, taskButtons.toArray(new Component[taskButtons.size()]));
        detailsView.addComponent(buttons);

        Table processTable = attachTitledTable(detailsView, "pi.details", processDetailsContainer, new Object[] {"title", "component"},
                new HashMap<String, ColumnGenerator>() {{
                    put("component", new ColumnGenerator() {
                        private DateFormat dateFormat = VaadinUtility.simpleDateFormat();

                        @Override
                        public Object generateCell(Table source, Object itemId, Object columnId) {
                            ProcessInstance pi = log.getProcessInstance();
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Table.ColumnGenerator

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.