Package com.vaadin.ui

Examples of com.vaadin.ui.TabSheet$TabSheetTabImpl


    @Override
    protected void setup() {

        outerPanel = new Panel("Outer panel, enabled");
        innerTabsheet = new TabSheet();
        innerTabsheet.setCaption("Inner Tabsheet, enabled");

        button = new Button("Button, enabled");

        outerPanel.setContent(innerTabsheet);
View Full Code Here


    private int debugIdCounter = 0;

    public TabSheetsCssTest(TestSampler parent) {
        this.parent = parent;

        TabSheet basic = createTabSheetWith("Basic TabSheet", null);
        parent.addComponent(basic);

        TabSheet bordeless = createTabSheetWith("Borderelss TabSheet",
                Reindeer.TABSHEET_BORDERLESS);
        parent.addComponent(bordeless);

        TabSheet bar = createTabSheetWith("A small/bar TabSheet",
                Reindeer.TABSHEET_SMALL);
        parent.addComponent(bar);

        TabSheet minimal = createTabSheetWith("A minimal tabsheet",
                Reindeer.TABSHEET_MINIMAL);
        parent.addComponent(minimal);

        TabSheet hoverClosable = createTabSheetWith(
                "A hover-closable TabSheet", Reindeer.TABSHEET_HOVER_CLOSABLE);
        parent.addComponent(hoverClosable);

        TabSheet selectedClosable = createTabSheetWith(
                "A selected-closable TabSheet",
                Reindeer.TABSHEET_SELECTED_CLOSABLE);
        parent.addComponent(selectedClosable);

        TabSheet light = createTabSheetWith("A light TabSheet",
                Runo.TABSHEET_SMALL);
        parent.addComponent(light);

    }
View Full Code Here

        parent.addComponent(light);

    }

    private TabSheet createTabSheetWith(String caption, String styleName) {
        TabSheet ts = new TabSheet();
        ts.setId("tabsheet" + debugIdCounter++);
        ts.setCaption(caption);
        ts.setComponentError(new UserError("A error message"));

        Label content = new Label("First Component");
        ts.addTab(content, "First");
        Label content2 = new Label("Second Component");
        ts.addTab(content2, "Second");
        ts.getTab(content2).setClosable(true);

        Label content3 = new Label("Third Component");
        ts.addTab(content3, "Third", new ThemeResource(parent.ICON_URL));
        ts.getTab(content3).setEnabled(false);

        if (styleName != null) {
            ts.addStyleName(styleName);
        }

        return ts;

    }
View Full Code Here

        layout.setWidth("100%");
        layout.addComponent(new Label("<h1>Grid layout</h1>", ContentMode.HTML));
        layout.addComponent(new Label("Next row"));
        addComponent(layout);

        TabSheet tabSheet = new TabSheet();
        tabSheet.addTab(new Label("<h1>Tabsheet</h1>", ContentMode.HTML),
                "Label");
        addComponent(tabSheet);

        Accordion accordion = new Accordion();
        accordion.addTab(new Label("<h1>Accordion</h1>", ContentMode.HTML),
View Full Code Here

        cssLayout.addComponent(p);
        return cssLayout;
    }

    private Component getTabSheetTest() {
        TabSheet ts = new TabSheet();
        ts.setCaption("Tabsheet");
        ts.setHeight("100%");
        ts.addTab(getBigComponent(), "Tab 1");
        ts.addTab(getBigComponent(), "Tab 2");
        return ts;
    }
View Full Code Here

    static TabSheet getTabSheet(boolean caption, String style,
            boolean closable, boolean scrolling, boolean icon, boolean disable) {
        TestIcon testIcon = new TestIcon(60);

        TabSheet ts = new TabSheet();
        ts.addStyleName(style);
        StringGenerator sg = new StringGenerator();

        for (int i = 1; i <= (scrolling ? 10 : 3); i++) {
            String tabcaption = caption ? sg.nextString(true) + " "
                    + sg.nextString(false) : null;

            VerticalLayout content = new VerticalLayout();
            content.setMargin(true);
            content.setSpacing(true);
            content.addComponent(new Label("Content for tab " + i));
            if (i == 2) {
                content.addComponent(new Label(
                        "Excepteur sint obcaecat cupiditat non proident culpa. Magna pars studiorum, prodita quaerimus."));
            }
            Tab t = ts.addTab(content, tabcaption);
            t.setClosable(closable);
            t.setEnabled(!disable);

            // First tab is always enabled
            if (i == 1) {
                t.setEnabled(true);
            }

            if (icon) {
                t.setIcon(testIcon.get(false));
            }
        }

        ts.addSelectedTabChangeListener(new SelectedTabChangeListener() {
            @Override
            public void selectedTabChange(SelectedTabChangeEvent event) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
View Full Code Here

        assertEquals(Button.class, panel.getContent().getClass());
    }

    @Test
    public void inflate_tabSheet_captionsAssigned() {
        TabSheet layout = (TabSheet) inflater.inflate(getXml("tabsheet.xml"));

        // check tab captions
        assertEquals("caption-tab1", layout.getTab(0).getCaption());
        assertEquals("caption-tab2", layout.getTab(1).getCaption());
    }
View Full Code Here

        return c;
    }

    /** Create new TabSheet and add it to current component container. */
    public TabSheet tabsheet() {
        TabSheet c = new TabSheet();
        c.setImmediate(true);
        add(c);
        return c;
    }
View Full Code Here

    /**
     * Create new TabSheet with given caption and add it to current component
     * container.
     */
    public TabSheet tabsheet(String caption) {
        TabSheet c = tabsheet();
        c.setCaption(caption);
        return c;
    }
View Full Code Here

    push(next);
  }

  @Override
  protected void doCompositeStart(LObject object) {
    TabSheet tab = new TabSheet();
    tab.setSizeFull();
    ((ILayout)parent).addFullComponent(tab);
    push(tab);
  }
View Full Code Here

TOP

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

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.