Examples of replaceComponent()


Examples of com.vaadin.ui.Layout.replaceComponent()

                    @Override
                    public void buttonClick(ClickEvent event) {
                        container.setVisible(true);
                        root.setHeight(lastHeight, lastHeightUnit);
                        buttonContainer.replaceComponent(expand, collapse);
                    }
                });
            }

        }
View Full Code Here

Examples of com.vaadin.ui.TabSheet.replaceComponent()

        tab2.setDescription("description");
        tab2.setEnabled(false);

        // Replace component not in tabsheet with one already in tabsheet -
        // should be no-op
        tabSheet.replaceComponent(lbl3, lbl2);
        assertEquals(2, tabSheet.getComponentCount());
        assertSame(tab1, tabSheet.getTab(lbl1));
        assertSame(tab2, tabSheet.getTab(lbl2));
        assertNull(tabSheet.getTab(lbl3));
View Full Code Here

Examples of com.vaadin.ui.TabSheet.replaceComponent()

        assertSame(tab2, tabSheet.getTab(lbl2));
        assertNull(tabSheet.getTab(lbl3));

        // Replace component not in tabsheet with one not in tabsheet either
        // should add lbl4 as last tab
        tabSheet.replaceComponent(lbl3, lbl4);
        assertEquals(3, tabSheet.getComponentCount());
        assertSame(tab1, tabSheet.getTab(lbl1));
        assertSame(tab2, tabSheet.getTab(lbl2));
        assertEquals(2, tabSheet.getTabPosition(tabSheet.getTab(lbl4)));
View Full Code Here

Examples of com.vaadin.ui.TabSheet.replaceComponent()

        assertEquals(2, tabSheet.getTabPosition(tabSheet.getTab(lbl4)));

        // Replace component in tabsheet with another
        // should swap places, tab association should stay the same but tabs
        // should swap metadata
        tabSheet.replaceComponent(lbl1, lbl2);
        assertSame(tab1, tabSheet.getTab(lbl1));
        assertSame(tab2, tabSheet.getTab(lbl2));
        assertEquals(false, tab1.isClosable());
        assertEquals(true, tab2.isClosable());
        assertEquals(false, tab1.isEnabled());
View Full Code Here

Examples of com.vaadin.ui.TabSheet.replaceComponent()

        // Replace component in tabsheet with one not in tabsheet
        // should create a new tab instance for the new component, old tab
        // instance should become unattached
        // tab metadata should be copied from old to new
        tabSheet.replaceComponent(lbl1, lbl3);
        assertEquals(3, tabSheet.getComponentCount());
        assertNull(tabSheet.getTab(lbl1));
        assertNull(tab1.getComponent());
        assertNotNull(tabSheet.getTab(lbl3));
        assertEquals(false, tabSheet.getTab(lbl3).isEnabled());
View Full Code Here

Examples of com.vaadin.ui.TabSheet.replaceComponent()

                        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

Examples of com.vaadin.ui.VerticalLayout.replaceComponent()

        button.addClickListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                if (verticalLayout.getComponentIndex(label1) > -1) {
                    verticalLayout.replaceComponent(label1, label2);
                } else {
                    verticalLayout.replaceComponent(label2, label1);
                }
            }
        });
View Full Code Here

Examples of com.vaadin.ui.VerticalLayout.replaceComponent()

            @Override
            public void buttonClick(ClickEvent event) {
                if (verticalLayout.getComponentIndex(label1) > -1) {
                    verticalLayout.replaceComponent(label1, label2);
                } else {
                    verticalLayout.replaceComponent(label2, label1);
                }
            }
        });
        verticalLayout.addComponent(button);
        verticalLayout.addComponent(label1);
View Full Code Here

Examples of com.vaadin.ui.VerticalLayout.replaceComponent()

        first.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                if (mainLayout.getComponent(1).equals(secondLayout)) {
                    mainLayout.replaceComponent(secondLayout, firstLayout);
                    mainLayout.setExpandRatio(firstLayout, 1);
                }
            }
        });
        second.addListener(new Button.ClickListener() {
View Full Code Here

Examples of com.vaadin.ui.VerticalLayout.replaceComponent()

        second.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                if (mainLayout.getComponent(1).equals(firstLayout)) {
                    mainLayout.replaceComponent(firstLayout, secondLayout);
                    mainLayout.setExpandRatio(secondLayout, 1);
                }
            }
        });
        return mainLayout;
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.