Package com.vaadin.ui

Examples of com.vaadin.ui.Table$GeneratedRow


        final Label sizeLabel = new Label();
        final ExpandingContainer container = new ExpandingContainer(sizeLabel);
        container.logDetails(false);

        Table table = new Table(null, container) {
            @Override
            public void changeVariables(Object source,
                    Map<String, Object> variables) {
                if (variables.containsKey("firstvisible")) {
                    int index = (Integer) variables.get("firstvisible");
                    container.checkExpand(index);
                }
                if (variables.containsKey("reqfirstrow")
                        || variables.containsKey("reqrows")) {
                    try {
                        int index = ((Integer) variables
                                .get("lastToBeRendered")).intValue();
                        container.checkExpand(index);
                    } catch (Exception e) {
                        // do nothing
                    }
                }
                super.changeVariables(source, variables);
            }
        };
        table.setId(TABLE);
        table.setCacheRate(0);
        table.setSizeFull();
        table.setVisibleColumns(ExpandingContainer.PROPERTY_IDS
                .toArray(new String[ExpandingContainer.PROPERTY_IDS.size()]));

        table.setCurrentPageFirstItemIndex(120);

        rootLayout.addComponent(table);
        rootLayout.setExpandRatio(table, 1);

        rootLayout.addComponent(sizeLabel);
View Full Code Here


    private Log log = new Log(5);

    @Override
    protected void setup() {
        final Table table = new Table();
        table.setId("table");
        table.setContainerDataSource(createContainer());
        table.setWidth("400px");
        table.setHeight("400px");
        table.setImmediate(true);
        table.setFooterVisible(true);
        table.setColumnReorderingAllowed(true);

        table.setColumnFooter(COLUMN1_PROPERTY_ID, "fuu");
        // table.setColumnFooter(COLUMN2_PROPERTY_ID, "bar");
        table.setColumnFooter(COLUMN3_PROPERTY_ID, "fuubar");

        final TextField columnField = new TextField(
                "ProperyId of clicked column");
        columnField.setId("ClickedColumn");

        // Add a footer click listener
        table.addListener(new Table.FooterClickListener() {
            @Override
            public void footerClick(FooterClickEvent event) {
                columnField.setValue(String.valueOf(event.getPropertyId()));
                log.log("Clicked on footer: " + event.getPropertyId());
            }
        });

        CheckBox immediateCheckbox = new CheckBox("Immediate");
        immediateCheckbox.setImmediate(true);
        immediateCheckbox.setValue(table.isImmediate());
        immediateCheckbox.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                table.setImmediate((Boolean) event.getProperty().getValue());
            }
        });

        CheckBox columnReorderingCheckbox = new CheckBox(
                "Column reordering allowed");
        columnReorderingCheckbox.setImmediate(true);
        columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
        columnReorderingCheckbox
                .addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        table.setColumnReorderingAllowed((Boolean) event
                                .getProperty().getValue());
                    }
                });

        addComponent(immediateCheckbox);
View Full Code Here

        VerticalLayout content = new VerticalLayout();

        content.addComponent(new Label("Content."));
        content.setWidth("500px");

        Table table = new Table();

        table.setPageLength(10);

        table.setWidth("100%");

        table.addContainerProperty("Lähettäjä", String.class, "");
        table.addContainerProperty("Viestin tyyppi", String.class, "");

        for (int i = 0; i < 15; i++) {

            table.addItem(new Object[] { i + " Joku Ihminen", "Testiviesti" },

            new Object());

        }
View Full Code Here

public class DisabledTableKeyboardNavigation extends TestBase {

    @Override
    protected void setup() {
        final Table table = new Table("Multiselectable table");

        table.setContainerDataSource(createContainer());
        table.setImmediate(true);
        table.setSelectable(true);
        table.setMultiSelect(true);
        table.setWidth("400px");
        table.setHeight("200px");

        table.setEnabled(false);

        addComponent(table);

    }
View Full Code Here

     * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
     * VaadinRequest)
     */
    @Override
    protected void setup(VaadinRequest request) {
        Table table = new Table("Table");
        table.addContainerProperty("testColumn", String.class, null);
        table.setPageLength(0); // disable paging
        addComponent(table);
    }
View Full Code Here

@SuppressWarnings("serial")
public class CtrlShiftMultiselect extends TestBase {

    @Override
    protected void setup() {
        final Table table = new Table("Multiselectable table");

        table.setContainerDataSource(createContainer());
        table.setImmediate(true);

        table.setSelectable(true);
        table.setMultiSelect(true);
        table.setDragMode(TableDragMode.MULTIROW);

        table.setWidth("400px");
        table.setHeight("400px");

        addComponent(table);
    }
View Full Code Here

public class TableTooManyColumns extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        Table table = new Table();

        table.setColumnCollapsingAllowed(true);

        for (int i = 0; i < 91; i++) {
            table.addGeneratedColumn("COLUMN " + i, new ColumnGenerator() {

                @Override
                public Object generateCell(Table source, Object itemId,
                        Object columnId) {
                    return columnId;
View Full Code Here

        return 4206;
    }

    @Override
    public void init() {
        Table table = new Table();
        table.setPageLength(50);

        final Button up = new Button("up");
        up.addListener(new Button.ClickListener() {

            @Override
View Full Code Here

    @Override
    protected void setup() {
        log.setId("eventlog");

        Table t = new Table();

        t.setSelectable(true);
        t.setNullSelectionAllowed(true);
        t.setImmediate(true);
        t.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                log.log("Selected value: " + event.getProperty().getValue());
            }
        });

        t.addContainerProperty("string", String.class, null);
        t.addContainerProperty("button", Component.class, null);

        for (int i = 0; i < 10; i++) {
            t.addItem(i);
            t.getContainerProperty(i, "string").setValue(String.valueOf(i));
            t.getContainerProperty(i, "button")
                    .setValue(new Button("Click me"));
        }

        addComponent(log);
        addComponent(t);
View Full Code Here

    protected void downloadAndUpdate() {
        getMainWindow().open(
                new ExternalResource("/statictestfiles/dummy.zip", "_new"));

        // Any component sending an UIDL request when rendered will likely do
        Table table = new Table();
        table.addContainerProperty("A", String.class, "");
        for (int i = 0; i < 100; i++) {
            table.addItem(new Object[] { Integer.toString(i) },
                    Integer.valueOf(i));
        }
        addComponent(table);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Table$GeneratedRow

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.