Package com.vaadin.ui

Examples of com.vaadin.ui.TabSheet$SelectedTabChangeListener


            }
        }
    }

    private TabSheet newTabSheet(String width) {
        TabSheet tabSheet = new TabSheet();
        tabSheet.setCaption("Width: " + (width == null ? "undefined" : width));
        tabSheet.setWidth(width);
        tabSheet.setData(width);

        // Add dummy components to fill the TabSheet.
        for (int i = 1; i <= 10; i++) {
            tabSheet.addComponent(new Button(i + ". tab"));
        }
        return tabSheet;
    }
View Full Code Here


    private int tabCounter = 1;

    @Override
    protected void setup() {
        final TabSheet tabs = new TabSheet();

        // Add some tabs
        tabs.addTab(new Label("Content 1"), "Tab 1", null);
        tabs.addTab(new Label("Content 2"), "Tab 2", null);
        tabs.addTab(new Label("Content 3"), "Tab 3", null);

        addComponent(tabs);

        Button addTab = new Button("Add tab at index 2",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        tabs.addTab(new Label("Content " + tabCounter),
                                "Added Tab " + tabCounter, null, 2);
                        tabCounter++;
                    }
                });
        addComponent(addTab);

        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);

        Button move = new Button("Move selected tab to index 2",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        tabs.setTabPosition(tabs.getTab(tabs.getSelectedTab()),
                                2);
                    }
                });
        addComponent(move);

        Button getIndex = new Button("Get selected tab index",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        getMainWindow().showNotification(
                                "Index: "
                                        + tabs.getTabPosition(tabs.getTab(tabs
                                                .getSelectedTab())));

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

    @Override
    public void setup() {
        setTheme("chameleon");
        final Label l = new Label("Select Sub Tab 2");
        final TabSheet t = new TabSheet();
        final TabSheet t2 = getTabSheet();
        t.addTab(t2, "Main Tab");
        addComponent(l);
        addComponent(t);
    }
View Full Code Here

        addComponent(l);
        addComponent(t);
    }

    private TabSheet getTabSheet() {
        final TabSheet t = new TabSheet();
        t.addTab(getDummyLayout1(), "Sub Tab 1");
        t.addTab(getDummyLayout2(), "Sub Tab 2");

        return t;
    }
View Full Code Here

                layout.setEnabled(!layout.isEnabled());
            }
        }));
        addComponent(layout);

        TabSheet sheet = new TabSheet();
        Label label1 = new Label("Label1");
        label1.setCaption("Label 1");
        sheet.addComponent(label1);

        Label label2 = new Label("Label2");
        label2.setCaption("Label 2");
        sheet.addComponent(label2);

        Label label3 = new Label("Label3");
        label3.setCaption("Label 3");
        sheet.addComponent(label3);

        layout.addComponent(sheet);
    }
View Full Code Here

public class TabSheetWithHasComponent extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        TabSheet ts = new TabSheet();
        ts.addComponent(createPopupView(createSmallTabSheet()));
        ts.addComponent(createTable());
        ts.addComponent(createPanel());
        ts.addComponent(new CustomComponent(new Panel(
                "Panel in custom component", new Button("In panel"))));

        addComponent(ts);
    }
View Full Code Here

        pv.setCaption("A popup view");
        return pv;
    }

    protected TabSheet createSmallTabSheet() {
        return new TabSheet(new Button("Tab1 inside popup"), new NativeButton(
                "Tab 2 inside popup"));
    }
View Full Code Here

        return 2995;
    }

    @Override
    protected void setup() {
        TabSheet tabSheet = new TabSheet();
        Label l = new Label("Label");
        l.setDescription("This is a label");

        Tab tab = tabSheet.addTab(l, "Tab", null);
        tab.setDescription("This is a tab");
        tab.setComponentError(new UserError("abc error"));

        Tab tab2 = tabSheet.addTab(new Label("Another label, d'oh"), "Tab 2",
                null);
        tab2.setDescription("This is another tab");

        addComponent(tabSheet);
    }
View Full Code Here

public class TabSheetWithTabIds extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        TabSheet tabSheet = new TabSheet();

        final Tab tab1 = tabSheet.addTab(new Label("Label 1"), "Tab 1", null);

        final Tab tab2 = tabSheet.addTab(new Label("Label 2"), "Tab 2", null);

        final Tab tab3 = tabSheet.addTab(new Label("Label 3"), "Tab 3", null);

        addComponent(tabSheet);

        Button b = new Button("Set ids", new Button.ClickListener() {
View Full Code Here

    private int counter = 0;

    @Override
    public void setup() {
        tabSheet = new TabSheet();
        addTab();
        addComponent(tabSheet);

        Button addTabBtn = new Button("Add new tab",
                new Button.ClickListener() {
View Full Code Here

TOP

Related Classes of com.vaadin.ui.TabSheet$SelectedTabChangeListener

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.