Package com.vaadin.ui.TabSheet

Examples of com.vaadin.ui.TabSheet.Tab


    protected void setup() {
        Accordion acc = new Accordion();
        addComponent(acc);

        for (int tabIndex = 0; tabIndex < 5; tabIndex++) {
            Tab tab = acc.addTab(new Label("Tab " + tabIndex));
            tab.setCaption("Tab " + tabIndex);
            tab.setStyleName("tab" + tabIndex);
        }
    }
View Full Code Here


        final TabSheet t = new TabSheet();

        for (int i = 1; i < 4; i++) {
            VerticalLayout v = new VerticalLayout();
            v.addComponent(new Label("Content " + i));
            Tab tab = t.addTab(v, "Tab " + i);
            tab.setClosable(true);
        }
        addComponent(t);
    }
View Full Code Here

        addTab();
        addTab().setComponentError(new UserError("Error!"));
        addTab().setDescription("This is a tab");

        Tab t = addTab();
        t.setComponentError(new UserError("Error!"));
        t.setDescription("This tab has both an error and a description");

        setContent(tabSheet);
        getTooltipConfiguration().setOpenDelay(0);
        getTooltipConfiguration().setQuickOpenDelay(0);
        getTooltipConfiguration().setCloseTimeout(1000);
View Full Code Here

    @Override
    public void setup() {
        setTheme("tests-tickets");

        TabSheet tabsheet = new TabSheet();
        final Tab tab1 = tabsheet.addTab(new Label(), "Tab 1");
        final Tab tab2 = tabsheet.addTab(new Label(), "Tab 2");

        tab1.setStyleName(STYLE_NAME);

        addComponent(new Button("Update style names",
                new Button.ClickListener() {
                    int counter = 0;

                    @Override
                    public void buttonClick(ClickEvent event) {
                        if (tab1.getStyleName() == null) {
                            tab1.setStyleName(STYLE_NAME);
                        } else {
                            tab1.setStyleName(null);
                        }

                        tab2.setStyleName(STYLE_NAME + "_" + (counter++));
                    }
                }));

        addComponent(tabsheet);
    }
View Full Code Here

            for (int c = 0; c < tab; c++) {
                tabCaption += tabCaption;
            }
            tabCaption += " " + tab;

            Tab t = ts.addTab(new Label("Content " + tab), tabCaption);
            t.setClosable(true);

            if (tab % 2 == 0) {
                t.setIcon(new ExternalResource(
                        "/VAADIN/themes/tests-tickets/icons/fi.gif"));
            }
        }

        ts.addStyleName(Reindeer.TABSHEET_MINIMAL);
View Full Code Here

                    public void buttonClick(ClickEvent event) {
                        Iterator<Component> iter = tabs.getComponentIterator();
                        iter.next();

                        Component content2 = iter.next();
                        Tab tab = tabs.getTab(content2);

                        // Replace content
                        tabs.replaceComponent(tab.getComponent(), new Label(
                                "Replacement 2"));

                    }
                });
        addComponent(replace2);
View Full Code Here

        tabs.add(content);
        Label label = new Label("Tab " + index);
        label.setId(labelID(index));
        content.addComponent(label);
        content.addComponent(new TextField());
        Tab tab = ts.addTab(content, "Tab " + index, null);
        if (index == 2) {
            tab.setClosable(true);
        }
        if (index == 4) {
            tab.setEnabled(false);
        }
        index++;
        return tab;
    }
View Full Code Here

    }

    private void closeCurrentTabWithTab() {
        Component c = tabsheet.getSelectedTab();
        if (c != null) {
            Tab t = tabsheet.getTab(c);
            tabsheet.removeTab(t);
        }
    }
View Full Code Here

        tabs.add(content);

        TextField field = new TextField("Tab " + index + " label");
        content.addComponent(field);

        Tab tab = ts.addTab(content, "Tab " + index, null);

        if (index == 2) {
            tab.setClosable(true);
            tab.setDescription("Tab 2 Tooltip");
        }

        if (index == 4) {
            tab.setEnabled(false);
        }

        if (index == 5) {
            tab.setDefaultFocusComponent(field);
        }

        index++;
        return tab;
    }
View Full Code Here

        Button setCaption = new Button("Invert tab caption at index 2",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        Tab tab = tabs.getTab(2);
                        tab.setCaption(new StringBuffer(tab.getCaption())
                                .reverse().toString());
                    }
                });
        addComponent(setCaption);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.TabSheet.Tab

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.