Examples of Accordion


Examples of com.vaadin.ui.Accordion

        row.setWidth("100%");
        addComponent(row);

        row.addComponent(getAccordion("Normal"));

        Accordion ac = getAccordion("Borderless");
        ac.addStyleName("borderless");
        row.addComponent(ac);

    }
View Full Code Here

Examples of com.vaadin.ui.Accordion

    }

    Accordion getAccordion(String caption) {
        TestIcon testIcon = new TestIcon(0);
        Accordion ac = new Accordion();
        ac.setCaption(caption);
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Fabio vel iudice vincam, sunt in culpa qui officia. Ut enim ad minim veniam, quis nostrud exercitation."));
            }
        }, "First Caption", testIcon.get());
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Gallia est omnis divisa in partes tres, quarum."));
            }
        }, "Second Caption", testIcon.get());
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Nihil hic munitissimus habendi senatus locus, nihil horum? Sed haec quis possit intrepidus aestimare tellus."));
            }
        }, "Third Caption", testIcon.get());
        ac.addTab(new VerticalLayout() {
            {
                setMargin(true);
                addComponent(new Label(
                        "Inmensae subtilitatis, obscuris et malesuada fames. Quisque ut dolor gravida, placerat libero vel, euismod."));
            }
View Full Code Here

Examples of com.vaadin.ui.Accordion

        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");
        acc.setIcon(icon);
        acc.addTab(new Label(), "Section 1", icon);
        acc.addTab(new Label(), "Section 2", icon);
        gl.addComponent(acc);

        // Table, caption + column + row + action icons
        Table tbl = new Table("Table");
        tbl.setRowHeaderMode(RowHeaderMode.ICON_ONLY);
View Full Code Here

Examples of com.vaadin.ui.Accordion

        main.getContent().setSizeFull();
        ((MarginHandler) main.getContent()).setMargin(true);

        setTheme("tests-tickets");

        Accordion ts;

        ts = new Accordion();
        ts.setSizeFull();
        ts.setWidth("300px");

        TextArea l = new TextArea("DSFS");
        l.setRows(2);
        l.setStyleName("red");
        l.setSizeFull();
        ts.addTab(l, "100% h component", null);

        Label testContent = new Label(
                "TabSheet by default uses caption, icon, errors etc. from Components. ");

        testContent.setCaption("Introduction to test");

        ts.addTab(testContent);

        // main.addComponent(ts);

        ts = new Accordion();
        ts.setSizeFull();
        ts.setHeight("200px");
        ts.setWidth("300px");

        l = new TextArea("DSFS");
        l.setRows(2);
        l.setStyleName("red");
        l.setSizeFull();
        ts.addTab(l, "200px h component", null);

        testContent = new Label(
                "TabSheet by default uses caption, icon, errors etc. from Components. ");

        testContent.setCaption("Introduction to test");

        ts.addTab(testContent);

        main.addComponent(ts);

        ts = new Accordion();
        ts.setSizeFull();
        ts.setHeight("50%");
        ts.setWidth("300px");

        l = new TextArea("DSFS");
        l.setRows(2);
        l.setStyleName("red");
        l.setSizeFull();
        ts.addTab(l, "50% h component", null);

        testContent = new Label(
                "TabSheet by default uses caption, icon, errors etc. from Components. ");

        testContent.setCaption("Introduction to test");

        ts.addTab(testContent);

        // main.addComponent(ts);

    }
View Full Code Here

Examples of com.vaadin.ui.Accordion

    protected void setup() {
        HorizontalSplitPanel sp = new HorizontalSplitPanel();
        sp.setWidth("100%");
        sp.setHeight("100px");

        Accordion acc = new Accordion();

        Tab tab1 = acc.addTab(new TextField("first field"));
        tab1.setCaption("First tab");

        Tab tab2 = acc.addTab(new TextField("second field"));
        tab2.setCaption("Second tab");

        acc.setSizeFull();

        sp.addComponent(acc);
        addComponent(sp);

    }
View Full Code Here

Examples of com.vaadin.ui.Accordion

        return "Tests the removal of individual tabs from an Accordion. No matter what is done in this test the tab caption \"Tab X\" should always match the content \"Tab X\". Use \"remove first\" and \"remove active\" buttons to remove the first or the active tab. The \"reorder\" button reverses the order by adding and removing all components.";
    }

    @Override
    protected void setup() {
        accordion = new Accordion();
        for (int i = 1; i <= tab.length; i++) {
            tab[i - 1] = new Label("This is the contents of tab " + i);
            tab[i - 1].setCaption("Tab " + i);

            accordion.addComponent(tab[i - 1]);
View Full Code Here

Examples of com.vaadin.ui.Accordion

    private int debugIdCounter = 0;

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

        Accordion def = createAccordionWith("Def Accordion", null);
        parent.addComponent(def);

        Accordion light = createAccordionWith("Light Accordion",
                Runo.ACCORDION_LIGHT);
        parent.addComponent(light);

        Accordion opaque = createAccordionWith("Oppaque Accordion",
                ChameleonTheme.ACCORDION_OPAQUE);
        parent.addComponent(opaque);

    }
View Full Code Here

Examples of com.vaadin.ui.Accordion

        parent.addComponent(opaque);

    }

    private Accordion createAccordionWith(String caption, String styleName) {
        Accordion acc = new Accordion();
        acc.setId("accordion" + debugIdCounter++);
        acc.setCaption(caption);
        acc.setComponentError(new UserError("A error message..."));

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

        Label l1 = new Label("There are no previously saved actions.");
        Label l2 = new Label("There are no saved notes.");
        Label l3 = new Label("There are currently no issues.");

        acc.addTab(l1, "Actions", new ThemeResource(parent.ICON_URL));
        acc.addTab(l2, "Notes", new ThemeResource(parent.ICON_URL));
        acc.addTab(l3, "Issues", new ThemeResource(parent.ICON_URL));

        acc.getTab(l2).setEnabled(false);

        return acc;
    }
View Full Code Here

Examples of com.vaadin.ui.Accordion

*/
public class AccordionRemoveTab extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        final Accordion tabs = new Accordion();
        addComponent(tabs);
        tabs.setHeight(300, Unit.PIXELS);
        final VerticalLayout one = new VerticalLayout();
        one.setCaption("One");
        one.addComponent(new Label("On first tab"));
        tabs.addTab(one);
        VerticalLayout two = new VerticalLayout();
        two.setCaption("Two");
        two.addComponent(new Label("On second tab"));
        tabs.addTab(two);

        tabs.setSelectedTab(two);

        VerticalLayout l = new VerticalLayout();
        l.addComponent(new Label("On third tab"));
        Tab last = tabs.addTab(l);
        last.setCaption("Three");

        addButton("Remove First", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                tabs.removeComponent(tabs.iterator().next());
            }
        });
    }
View Full Code Here

Examples of com.vaadin.ui.Accordion

*/
public class AccordionAddTab extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        final Accordion tabs = new Accordion();
        addComponent(tabs);
        tabs.setHeight(500, Unit.PIXELS);
        Button remove = new Button("Remove 'First'");
        final Tab me = tabs.addTab(addTab("First"));
        remove.addClickListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                tabs.removeTab(me);
                Tab tab = tabs.addTab(addTab("Next"));
                tabs.setSelectedTab(tab);
            }
        });
        addComponent(remove);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.