Package com.vaadin.ui

Examples of com.vaadin.ui.Component


        layout.addListener(new LayoutClickListener() {
            @Override
            public void layoutClick(LayoutClickEvent event) {

                // Get the deepest nested component which was clicked
                Component clickedComponent = event.getClickedComponent();

                if (clickedComponent == null) {
                    // Not over any child component
                    LayoutClickListenerTest.this.addComponent(new Label(
                            "The click was not over any component."));
                } else {
                    // Over a child component
                    String message = "The click was over a "
                            + clickedComponent.getClass().getCanonicalName()
                            + " in an immediate child component of type "
                            + event.getChildComponent().getClass()
                                    .getCanonicalName();
                    LayoutClickListenerTest.this
                            .addComponent(new Label(message));
View Full Code Here


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

        for (int i = 0; i < 5; i++) {
            String caption = "Tab " + i;
            Component c = new Label(caption);
            tabSheet.addTab(c, caption);
        }

        addComponent(tabSheet);
View Full Code Here

                    @Override
                    public void buttonClick(ClickEvent event) {
                        Iterator<Component> iter = tabs.getComponentIterator();
                        iter.next();

                        Component content2 = iter.next();
                        Tab tab = tabs.getTab(content2);

                        // Replace content
                        tabs.replaceComponent(tab.getComponent(), new Label(
                                "Replacement 2"));
View Full Code Here

        cb.setImmediate(true);
        hidingControls.addComponent(cb);
        elp.setVisible(false);
        el.setHeight("700px");
        addFields(el);
        Component firstComponent = el.getComponentIterator().next();
        firstComponent.setSizeFull();
        el.setExpandRatio(firstComponent, 1);
        lo.addComponent(elp);
        HorizontalLayout elh = new HorizontalLayout();
        Panel elhp = new LayoutTestingPanel(
                "ExpandLayout width first component expanded; horizontal", elh);
        cb = new CheckBox("ExpandLayout (horizontal)",
                new MethodProperty<Boolean>(elhp, "visible"));
        cb.setImmediate(true);
        hidingControls.addComponent(cb);
        elhp.setVisible(false);
        elh.setWidth("2000px");
        elh.setHeight("100px");
        addFields(elh);
        Component firstComponentElh = elh.getComponentIterator().next();
        firstComponentElh.setSizeFull();
        elh.setExpandRatio(firstComponentElh, 1);
        lo.addComponent(elhp);

        // CustomLayout
        VerticalLayout cl = new VerticalLayout();
View Full Code Here

    @Override
    public void setup() {
        final TabSheet tabsOuter = new TabSheet();
        final TabSheet tabsInner = new TabSheet();

        final Component tab2;

        tabsInner.addTab(tab2 = getLayoutWithComponents(6, "tab2"), "Tab 2");
        tabsInner.addTab(getLayoutWithComponents(8, "tab3"), "Tab 3");

        tabsOuter.addTab(tabsInner, "Inner tabs");
View Full Code Here

        getLayout().addComponent(reorderTabs);

    }

    private void closeCurrentTab() {
        Component c = tabsheet.getSelectedTab();
        if (c != null) {
            tabsheet.removeComponent(c);
        }
    }
View Full Code Here

            tabsheet.removeComponent(c);
        }
    }

    private void closeCurrentTabWithTab() {
        Component c = tabsheet.getSelectedTab();
        if (c != null) {
            Tab t = tabsheet.getTab(c);
            tabsheet.removeTab(t);
        }
    }
View Full Code Here

        tabsheet.removeComponent(tabsheet.getComponentIterator().next());
    }

    private void closeLastTab() {
        Iterator<Component> i = tabsheet.getComponentIterator();
        Component last = null;
        while (i.hasNext()) {
            last = i.next();

        }
        tabsheet.removeComponent(last);
View Full Code Here

        if (container != null) {
            List<Component> c = new ArrayList<Component>();
            Iterator<Component> i = container.getComponentIterator();
            while (i.hasNext()) {
                Component comp = i.next();
                c.add(comp);
            }
            container.removeAllComponents();

            for (int j = c.size() - 1; j >= 0; j--) {
View Full Code Here

    protected void setup(VaadinRequest request) {

        final TabSheet tabsheet = new TabSheet();
        tabsheet.setWidth("400px");

        Component lastLabel = null;

        for (int i = 1; i <= 5; i++) {
            String caption = "Tab " + i;
            Label label = new Label(caption);
            tabsheet.addTab(label, caption);

            lastLabel = label;
        }

        tabsheet.setSelectedTab(0);

        final Component lastTab = lastLabel;

        tabsheet.addSelectedTabChangeListener(new SelectedTabChangeListener() {

            @Override
            public void selectedTabChange(SelectedTabChangeEvent event) {
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Component

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.