Package com.vaadin.ui

Examples of com.vaadin.ui.TabSheet$TabsheetServerRpcImpl


            c.setIcon(icon);
            gl.addComponent(c);
        }

        // TabSheet, caption + tab icons
        TabSheet tabs = new TabSheet();
        tabs.setCaption("TabSheet");
        tabs.setIcon(icon);
        tabs.addStyleName("myTabs");
        tabs.addTab(new Label("Content 1"), "Tab 1", icon);
        tabs.addTab(new Label("Content 2"), "Tab 2", icon);
        tabs.setWidth("150px");
        gl.addComponent(tabs);

        // Accordion, caption + tab icons
        Accordion acc = new Accordion();
        acc.setCaption("Accordion");
View Full Code Here


public class TestTabSheet {

    @Test
    public void addExistingComponent() {
        Component c = new Label("abc");
        TabSheet tabSheet = new TabSheet();
        tabSheet.addComponent(c);
        tabSheet.addComponent(c);

        Iterator<Component> iter = tabSheet.getComponentIterator();

        assertEquals(c, iter.next());
        assertEquals(false, iter.hasNext());
        assertNotNull(tabSheet.getTab(c));
    }
View Full Code Here

    }

    @Test
    public void getComponentFromTab() {
        Component c = new Label("abc");
        TabSheet tabSheet = new TabSheet();
        Tab tab = tabSheet.addTab(c);
        assertEquals(c, tab.getComponent());
    }
View Full Code Here

        assertEquals(c, tab.getComponent());
    }

    @Test
    public void addTabWithComponentOnly() {
        TabSheet tabSheet = new TabSheet();
        Tab tab1 = tabSheet.addTab(new Label("aaa"));
        Tab tab2 = tabSheet.addTab(new Label("bbb"));
        Tab tab3 = tabSheet.addTab(new Label("ccc"));

        // Check right order of tabs
        assertEquals(0, tabSheet.getTabPosition(tab1));
        assertEquals(1, tabSheet.getTabPosition(tab2));
        assertEquals(2, tabSheet.getTabPosition(tab3));

        // Calling addTab with existing component does not move tab
        tabSheet.addTab(tab1.getComponent());

        // Check right order of tabs
        assertEquals(0, tabSheet.getTabPosition(tab1));
        assertEquals(1, tabSheet.getTabPosition(tab2));
        assertEquals(2, tabSheet.getTabPosition(tab3));
    }
View Full Code Here

        assertEquals(2, tabSheet.getTabPosition(tab3));
    }

    @Test
    public void addTabWithComponentAndIndex() {
        TabSheet tabSheet = new TabSheet();
        Tab tab1 = tabSheet.addTab(new Label("aaa"));
        Tab tab2 = tabSheet.addTab(new Label("bbb"));
        Tab tab3 = tabSheet.addTab(new Label("ccc"));

        Tab tab4 = tabSheet.addTab(new Label("ddd"), 1);
        Tab tab5 = tabSheet.addTab(new Label("eee"), 3);

        assertEquals(0, tabSheet.getTabPosition(tab1));
        assertEquals(1, tabSheet.getTabPosition(tab4));
        assertEquals(2, tabSheet.getTabPosition(tab2));
        assertEquals(3, tabSheet.getTabPosition(tab5));
        assertEquals(4, tabSheet.getTabPosition(tab3));

        // Calling addTab with existing component does not move tab
        tabSheet.addTab(tab1.getComponent(), 3);

        assertEquals(0, tabSheet.getTabPosition(tab1));
        assertEquals(1, tabSheet.getTabPosition(tab4));
        assertEquals(2, tabSheet.getTabPosition(tab2));
        assertEquals(3, tabSheet.getTabPosition(tab5));
        assertEquals(4, tabSheet.getTabPosition(tab3));
    }
View Full Code Here

        final Table table = new Table();
        table.setCaption("tab 2");
        table.setWidth("100%");
        table.setHeight("100%");

        final TabSheet tabsheet = new TabSheet();
        tabsheet.addComponent(tabButton);
        tabsheet.addComponent(table);
        tabsheet.addListener(new TabSheet.SelectedTabChangeListener() {
            @Override
            public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) {
                if (tabsheet.getSelectedTab() == tabButton) {
                    tabsheet.setSizeUndefined();
                    layout.setSizeUndefined();
                    subwindow.setSizeUndefined();
                } else if (tabsheet.getSelectedTab() == table) {
                    subwindow.setWidth("500px");
                    subwindow.setHeight("500px");
                    layout.setSizeFull();
                    tabsheet.setSizeFull();
                }
            }
        });
        layout.addComponent(tabsheet);
View Full Code Here

    private VerticalLayout page() {

        VerticalLayout vP = new VerticalLayout();
        vP.setStyleName(Reindeer.LAYOUT_BLUE);
        TabSheet t = new TabSheet();
        t.setWidth(1000, Unit.PIXELS);

        HorizontalLayout hP = new HorizontalLayout();
        t.addTab(Ranking(), "Ranking");
        try {

            t.addTab(GDocs(""), "Dez 2011");
            t.addTab(GDocs(""), "Jan 2012");
            t.addTab(GDocs(""), "Abr 2012");

        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
View Full Code Here

        w.addComponent(new Label(info));
        createUI(w);
    }

    private void createUI(LegacyWindow w) {
        TabSheet ts = new TabSheet();
        Label l1 = new Label("111");
        Label l2 = new Label("222");
        Label l3 = new Label("333");
        Label l4 = new Label("444");

        ts.addTab(l1, "1", null);
        ts.addTab(l2, "2", null);
        ts.addTab(l3, "3", null);
        ts.addTab(l4, "4", null);

        l1.setVisible(false);

        w.addComponent(ts);
    }
View Full Code Here

        final LegacyWindow mainWin = new LegacyWindow("Test app to #1519");
        setMainWindow(mainWin);

        setTheme("tests-tickets");
        TabSheet ts = new TabSheet();

        ts.addTab(new CustomLayout("Ticket1519_News"), "News", null);
        ts.addTab(new CustomLayout("Ticket1519_Support"), "Support", null);

        mainWin.addComponent(ts);

    }
View Full Code Here

        }
        return t;
    }

    protected TabSheet createTabSheet() {
        TabSheet ts = new TabSheet();
        Table t = createTable();
        t.setSizeFull();
        ts.addTab(t, "Size full Table", ICON_16_USER_PNG_UNCACHEABLE);
        ts.addTab(new Button("A button"), "Button", null);
        return ts;
    }
View Full Code Here

TOP

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

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.