Example usage for com.vaadin.ui.themes ValoTheme TABLE_SMALL

List of usage examples for com.vaadin.ui.themes ValoTheme TABLE_SMALL

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme TABLE_SMALL.

Prototype

String TABLE_SMALL

To view the source code for com.vaadin.ui.themes ValoTheme TABLE_SMALL.

Click Source Link

Document

Small font size and reduced the white space inside the table cells.

Usage

From source file:com.etest.view.systemadministration.syllabus.SyllabusDataTable.java

public SyllabusDataTable() {
    setWidth("100%");
    setSelectable(true);/*from  ww w  .j  ava 2 s . com*/
    addStyleName(ValoTheme.TABLE_SMALL);
    addStyleName("wordwrap-table");
    setImmediate(true);

    addContainerProperty("subject", String.class, null);
    addContainerProperty("descriptive title", Label.class, null);
    addContainerProperty("topic no", Integer.class, null);
    addContainerProperty("topic", Label.class, null);
    addContainerProperty("time", Float.class, null);
    addContainerProperty("modify", VerticalLayout.class, null);

    setColumnAlignment("modify", Align.LEFT);
    setColumnAlignment("time", Align.CENTER);
    setColumnAlignment("topic no", Align.CENTER);

    setColumnWidth("modify", 80);
    setColumnWidth("descriptive title", 300);
    setColumnWidth("subject", 80);
    setColumnWidth("time", 50);
}

From source file:com.etest.view.testbank.CellCaseDataTable.java

public CellCaseDataTable() {
    setWidth("100%");
    setSelectable(false);/*from  w w w  .  j  a  v a 2 s  .  co m*/
    addStyleName(ValoTheme.TABLE_SMALL);
    setStyleName("wordwrap-table");
    setImmediate(true);

    addContainerProperty("id", Integer.class, null);
    addContainerProperty("case", Label.class, null);
    addContainerProperty("author", String.class, null);
    addContainerProperty("date created", Date.class, null);
    addContainerProperty("modify", VerticalLayout.class, null);

    setColumnWidth("case", 550);
    setColumnWidth("id", 50);
    setColumnWidth("date created", 150);
    setColumnWidth("modify", 100);
    setColumnAlignment("modify", Align.CENTER);

}

From source file:com.etest.view.testbank.cellitem.CellItemDataTable.java

public CellItemDataTable() {
    setWidth("100%");
    setSelectable(false);//from  w ww.j  a  v a2 s  .co m
    addStyleName(ValoTheme.TABLE_SMALL);
    setStyleName("wordwrap-table");
    setImmediate(true);

    addContainerProperty("id", Integer.class, null);
    addContainerProperty("stem", Label.class, null);
    addContainerProperty("modify", VerticalLayout.class, null);

    setColumnWidth("stem", 520);
    setColumnWidth("id", 50);
    setColumnAlignment("modify", Align.CENTER);
}

From source file:com.etest.view.testbank.cellitem.ItemKeyTable.java

public ItemKeyTable() {
    setWidth("100%");
    setSelectable(false);//from w  w  w . j  a v a 2s .  c o m
    addStyleName(ValoTheme.TABLE_SMALL);
    setStyleName("wordwrap-table");
    setImmediate(true);

    addContainerProperty("key", String.class, null);
    addContainerProperty("answer", String.class, null);
    addContainerProperty("modify", Button.class, null);

    setColumnWidth("modify", 100);
    setColumnAlignment("modify", Align.CENTER);
}

From source file:com.etest.view.tq.itemanalysis.ItemAnalysisDataTableProperties.java

public ItemAnalysisDataTableProperties() {
    setWidth("80%");
    setSelectable(false);//from  w  w  w  .  j a va2s  .co  m
    addStyleName(ValoTheme.TABLE_SMALL);
    setImmediate(true);

    addContainerProperty("Exam Title", String.class, null);
    addContainerProperty("Subject", String.class, null);
    addContainerProperty("date created", Date.class, null);
    addContainerProperty("Total Hours", Double.class, null);
    addContainerProperty("Total Items", Integer.class, null);
    addContainerProperty("remarks", VerticalLayout.class, null);

    setColumnAlignment("date created", Align.CENTER);
    setColumnAlignment("Total Hours", Align.CENTER);
    setColumnAlignment("Total Items", Align.CENTER);
    setColumnAlignment("remarks", Align.CENTER);

    setColumnWidth("remarks", 100);
}

From source file:com.etest.view.tq.TQListTableProperties.java

public TQListTableProperties() {
    setWidth("80%");
    setSelectable(false);//from   w ww  .j a v a  2 s  . c  om
    addStyleName(ValoTheme.TABLE_SMALL);
    setImmediate(true);

    addContainerProperty("Exam Title", String.class, null);
    addContainerProperty("Subject", String.class, null);
    addContainerProperty("date created", Date.class, null);
    addContainerProperty("Total Hours", Double.class, null);
    addContainerProperty("Total Items", Integer.class, null);
    addContainerProperty("remarks", VerticalLayout.class, null);

    setColumnAlignment("date created", Align.CENTER);
    setColumnAlignment("Total Hours", Align.CENTER);
    setColumnAlignment("Total Items", Align.CENTER);
    setColumnAlignment("remarks", Align.CENTER);

    setColumnWidth("remarks", 80);
}

From source file:com.hybridbpm.ui.component.chart.color.GaugeBandLayout.java

License:Apache License

public GaugeBandLayout(final BeanFieldGroup<DiagrammePreference> preferences) {
    super(preferences);

    setCaption("Gauge Band Colors");
    setSizeFull();/*  ww  w.j  a  va 2s  .  c o  m*/
    setSpacing(true);
    setMargin(false);

    addBandButton.setIcon(FontAwesome.PLUS);
    addBandButton.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    addBandButton.addStyleName(ValoTheme.BUTTON_SMALL);

    bandAdditionButtonFrame.setSpacing(true);
    bandAdditionButtonFrame.addComponent(addBandButton);
    bandAdditionButtonFrame.setComponentAlignment(addBandButton, Alignment.MIDDLE_RIGHT);

    addComponent(bandAdditionButtonFrame);

    addBandButton.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            addBand();
        }
    });

    colorTable.setHeight("100%");
    colorTable.setWidth("100%");
    colorTable.addStyleName(ValoTheme.TABLE_COMPACT);
    colorTable.addStyleName(ValoTheme.TABLE_SMALL);
    colorTable.addStyleName("color-table");

    colorTable.addContainerProperty(Translate.getMessage("colour"), ColorPicker.class, null);
    colorTable.addContainerProperty(Translate.getMessage("start"), TextField.class, null);
    colorTable.addContainerProperty(Translate.getMessage("end"), TextField.class, null);
    colorTable.addContainerProperty("remove", Button.class, null);

    // COLOR COLUMN
    colorTable.addGeneratedColumn(Translate.getMessage("colour"), new Table.ColumnGenerator() {
        @Override
        public Object generateCell(Table source, Object itemId, Object columnId) {
            final Property<String> colorProp = tableContainer.getItem(itemId).getItemProperty("color");

            int[] col = ColourUtil.decode(colorProp.getValue());
            ColorPicker picker = new ColorPicker();
            picker.addStyleName("diagramme");
            picker.setPosition(Page.getCurrent().getBrowserWindowWidth() / 2 - 246 / 2,
                    Page.getCurrent().getBrowserWindowHeight() / 2 - 507 / 2);
            picker.setColor(new com.vaadin.shared.ui.colorpicker.Color(col[0], col[1], col[2]));

            picker.addColorChangeListener(new ColorChangeListener() {
                @Override
                public void colorChanged(ColorChangeEvent event) {
                    colorProp.setValue(event.getColor().getCSS());
                    updateDiagramme();
                }
            });
            picker.setWidth("25px");

            return picker;
        }
    });

    // BAND START COLUMN
    colorTable.addGeneratedColumn(Translate.getMessage("start"), new Table.ColumnGenerator() {
        @Override
        public Object generateCell(Table source, Object itemId, Object columnId) {
            final Property<Double> startProp = tableContainer.getContainerProperty(itemId, "startValue");

            final ObjectProperty<Double> startValue = new ObjectProperty<Double>(0.0);
            TextField startField = new TextField(startValue);
            //startField.setWidth("60px");
            startField.setSizeFull();
            startField.setNullRepresentation("0");
            startField.addStyleName("tfwb");
            startField.setConvertedValue(startProp.getValue());
            startField.setImmediate(true);

            startValue.addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    startProp.setValue((Double) event.getProperty().getValue());
                    updateDiagramme();
                }
            });

            return startField;
        }
    });

    // BAND END COLUMN
    colorTable.addGeneratedColumn(Translate.getMessage("end"), new Table.ColumnGenerator() {
        @Override
        public Object generateCell(Table source, Object itemId, Object columnId) {
            final Property<Double> endProp = tableContainer.getContainerProperty(itemId, "endValue");

            final ObjectProperty<Double> endValue = new ObjectProperty<Double>(0.0);
            TextField endField = new TextField(endValue);
            //endField.setWidth("60px");
            endField.setSizeFull();
            endField.setNullRepresentation("0");
            endField.addStyleName("tfwb");
            endField.setConvertedValue(endProp.getValue());
            endField.setImmediate(true);

            endValue.addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
                    endProp.setValue((Double) valueChangeEvent.getProperty().getValue());
                    updateDiagramme();
                }
            });

            return endField;
        }
    });

    // DELETE BAND COLUMN
    colorTable.addGeneratedColumn("remove", new Table.ColumnGenerator() {

        @Override
        public Object generateCell(Table source, final Object itemId, Object columnId) {

            Button delete = new Button(FontAwesome.TIMES);
            delete.addClickListener(new Button.ClickListener() {
                @Override
                public void buttonClick(Button.ClickEvent event) {
                    removeBand(itemId);
                }
            });
            delete.setWidth("43px");

            return delete;
        }
    });

    colorTable.setColumnWidth(Translate.getMessage("colour"), 33);
    colorTable.setColumnWidth("remove", 48);
    colorTable.setColumnExpandRatio(Translate.getMessage("start"), 0.5f);
    colorTable.setColumnExpandRatio(Translate.getMessage("end"), 0.5f);

    colorTable.setSortEnabled(false);
    colorTable.setPageLength(0);
    colorTable.setEditable(true);
    colorTable.setImmediate(true);

    addComponent(colorTable);
    setExpandRatio(colorTable, 1f);
    setComponentAlignment(colorTable, Alignment.TOP_LEFT);
}

From source file:com.hybridbpm.ui.UsersMenu.java

License:Apache License

public UsersMenu() {
    textSearch.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    textSearch.setWidth(100, Unit.PERCENTAGE);
    textSearch.setNullRepresentation("");
    textSearch.setWidth(100, Unit.PERCENTAGE);
    textSearch.setInputPrompt("type to search users");
    textSearch.addTextChangeListener(new FieldEvents.TextChangeListener() {

        @Override/*from ww w  .  j a v  a 2s.co  m*/
        public void textChange(FieldEvents.TextChangeEvent event) {
            search(event.getText());
        }
    });

    table.addStyleName(ValoTheme.TABLE_BORDERLESS);
    table.addStyleName(ValoTheme.TABLE_NO_HEADER);
    table.addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
    table.addStyleName(ValoTheme.TABLE_SMALL);
    table.addStyleName(ValoTheme.TABLE_COMPACT);
    table.addStyleName(ValoTheme.TABLE_NO_STRIPES);
    table.addContainerProperty("user", User.class, null, "Username", null, Table.Align.LEFT);
    table.addContainerProperty("tasks", Label.class, null, "Tasks", null, Table.Align.LEFT);
    table.setColumnExpandRatio("user", 1f);
    table.setVisibleColumns("user", "tasks");
    table.setSizeFull();
    table.setColumnExpandRatio("user", 1f);
    table.setSelectable(false);
    table.addGeneratedColumn("user", new UserColumnGenerator());

    addComponents(textSearch, table);
    setExpandRatio(table, 1f);
    setHeight(100, Unit.PERCENTAGE);
    setWidth(300, Unit.PIXELS);
    addStyleName("users-list");
    setVisible(false);
}

From source file:com.mechanicshop.components.MaintenanceLayout.java

private void customizeTable() {
    table.setSizeFull();/*from  w w w.  j  a va 2  s. c om*/
    table.setSortEnabled(true);
    table.setStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
    table.addStyleName(ValoTheme.TABLE_SMALL);
    table.setEditable(true);
    table.setImmediate(true);

    table.addGeneratedColumn(" ", new Table.ColumnGenerator() {

        @Override
        public Object generateCell(final Table source, final Object itemId, Object columnId) {
            Button icon = new Button();
            icon.setStyleName(ValoTheme.BUTTON_ICON_ONLY);
            icon.addStyleName(ValoTheme.BUTTON_TINY);
            icon.addStyleName(ValoTheme.BUTTON_BORDERLESS);
            icon.setVisible(true);
            icon.setImmediate(true);
            icon.setDescription("Details");
            icon.setIcon(FontAwesome.PENCIL);
            icon.addClickListener(new ClickListener() {

                @Override
                public void buttonClick(ClickEvent event) {
                    Item item = source.getItem(itemId);
                    showDataEntryWindow(item);
                }
            });
            return icon;
        }
    });

}

From source file:com.mechanicshop.components.TableLayout.java

private void customizeTable() {
    table.setSizeFull();/*from w  ww.  ja  v  a2 s  .  c om*/
    table.setSortEnabled(true);
    table.setStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
    table.addStyleName(ValoTheme.TABLE_SMALL);
    table.setEditable(true);
    table.setImmediate(true);
    table.setSizeFull();
    table.addGeneratedColumn("", new Table.ColumnGenerator() {

        @Override
        public Object generateCell(Table source, final Object itemId, Object columnId) {
            boolean selected = false;

            final CheckBox cb = new CheckBox("", selected);

            cb.addValueChangeListener(new Property.ValueChangeListener() {

                public void valueChange(ValueChangeEvent event) {
                    if (selectedItemIds.contains(itemId)) {
                        selectedItemIds.remove(itemId);
                    } else {
                        if (cb.getValue() != false) {
                            selectedItemIds.add(itemId);
                        }
                    }
                }
            });
            return cb;
        }
    });

    table.addGeneratedColumn(" ", new Table.ColumnGenerator() {

        @Override
        public Object generateCell(final Table source, final Object itemId, Object columnId) {
            Button icon = new Button();
            icon.setStyleName(ValoTheme.BUTTON_ICON_ONLY);
            icon.addStyleName(ValoTheme.BUTTON_TINY);
            icon.addStyleName(ValoTheme.BUTTON_BORDERLESS);
            icon.setVisible(true);
            icon.setImmediate(true);
            icon.setDescription("Details");
            icon.setIcon(FontAwesome.PENCIL);
            icon.addClickListener(new ClickListener() {

                @Override
                public void buttonClick(ClickEvent event) {
                    Item item = source.getItem(itemId);
                    dataEntryLayout.fillDataEntry(item, titleLabel.getValue());
                    getUI().addWindow(dataEntryLayout);

                }
            });
            return icon;
        }
    });

}