Package com.vaadin.ui

Examples of com.vaadin.ui.Component$ErrorListener


        assertNotNull(componentArea);
    }

    public void testGridLayoutDetachListener() {
        // Add a component to detach
        Component comp = new Label();
        gridlayout.addComponent(comp);

        // Reset state variables (since they are set by the attach listener)
        resetVariables();
View Full Code Here


    public void testAbsoluteLayoutAttachListener() {
        // Reset state variables
        resetVariables();

        // Add component -> Should trigger attach listener
        Component comp = new Label();
        absolutelayout.addComponent(comp);

        // Attach counter should get incremented
        assertEquals(1, attachCounter);
View Full Code Here

        assertNotNull(componentPosition);
    }

    public void testAbsoluteLayoutDetachListener() {
        // Add a component to detach
        Component comp = new Label();
        absolutelayout.addComponent(comp);

        // Reset state variables (since they are set by the attach listener)
        resetVariables();
View Full Code Here

    public void testCSSLayoutAttachListener() {
        // Reset state variables
        resetVariables();

        // Add component -> Should trigger attach listener
        Component comp = new Label();
        csslayout.addComponent(comp);

        // Attach counter should get incremented
        assertEquals(1, attachCounter);
View Full Code Here

        assertTrue(foundInContainer);
    }

    public void testCSSLayoutDetachListener() {
        // Add a component to detach
        Component comp = new Label();
        csslayout.addComponent(comp);

        // Reset state variables (since they are set by the attach listener)
        resetVariables();
View Full Code Here

    protected void setup() {

        addComponent(new Button("Click to resize", new Button.ClickListener() {
            public void buttonClick(ClickEvent event) {
                for (int i = 1; i < getLayout().getComponentCount(); ++i) {
                    Component c = getLayout().getComponent(i);
                    c.setWidth("400px");
                    c.setHeight("200px");
                }
            }
        }));

        Component content;

        content = new Button("Undefined-sized Button");
        content.setSizeUndefined();
        addDnDPanel(content);

        content = new Label("Full-sized Label");
        content.setSizeFull();
        addDnDPanel(content);

        content = new TextArea(null, "200x100px TextArea");
        content.setWidth("200px");
        content.setHeight("100px");
        addDnDPanel(content);
    }
View Full Code Here

        table.setPageLength(50);

        setMainWindow(new LegacyWindow(""));
        getMainWindow().getContent().setSizeUndefined();

        Component l2 = null;
        for (int i = 0; i < 10; i++) {
            l2 = l("X" + i);
            getMainWindow().addComponent(l2);
        }

        final Component x9 = l2;

        HorizontalLayout horizontalLayout = new HorizontalLayout();

        Component l = null;
        for (int i = 0; i < 10; i++) {
            l = l("Y" + i);
            horizontalLayout.addComponent(l);
        }

        getMainWindow().addComponent(horizontalLayout);
        final Component y9 = l;

        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        final Window window = new Window();
        window.setHeight("500px");
        window.setWidth("500px");
        window.setPositionX(200);
        window.setPositionY(200);

        layout.addComponent(new Button("Scroll mainwin to X9",
                new ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        getMainWindow().scrollIntoView(x9);

                    }
                }));
        layout.addComponent(new Button("Scroll mainwin to Y9",
                new ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        getMainWindow().scrollIntoView(y9);

                    }
                }));

        VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setMargin(true);
        Panel panel = new Panel("scrollable panel", panelLayout);
        panel.setHeight(400, Panel.UNITS_PIXELS);
        panel.setScrollLeft(50);
        panel.setScrollTop(50);
        panelLayout.setSizeUndefined();
        layout.addComponent(l("Spacer", 500, 500));

        l2 = null;
        for (int i = 0; i < 10; i++) {
            l2 = l("X" + i);
            panelLayout.addComponent(l2);
        }

        final Component x29 = l2;

        horizontalLayout = new HorizontalLayout();

        l = null;
        for (int i = 0; i < 10; i++) {
            l = l("Y" + i);
            horizontalLayout.addComponent(l);
        }
        panelLayout.addComponent(horizontalLayout);
        final Component y29 = l;

        ((VerticalLayout) getMainWindow().getContent()).addComponent(
                new Button("Scroll win to X9", new ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
View Full Code Here

                        Iterator<Component> componentIterator = contentLayout
                                .getComponentIterator();
                        while (componentIterator.hasNext()) {

                            Iterator<Component> columHolderIterator;
                            Component child = componentIterator.next();
                            if (child instanceof Panel) {
                                columHolderIterator = ((ComponentContainer) ((Panel) child)
                                        .getContent()).getComponentIterator();
                            } else {
                                columHolderIterator = ((ComponentContainer) child)
View Full Code Here

    }

    @Override
    public void buttonClick(ClickEvent event) {
        Component c = event.getButton();
        while (!(c instanceof Window)) {
            c = c.getParent();
        }
        ((Window) c).close();

        Button prev = (Button) event.getButton().getData();
        if (prev != null) {
View Full Code Here

            @Override
            public void valueChange(ValueChangeEvent event) {
                for (Iterator<Component> it = layout.getComponentIterator(); it
                        .hasNext();) {
                    Component c = it.next();
                    if (c instanceof AbstractSelect) {
                        c.setReadOnly(!c.isReadOnly());
                    }
                }
            }
        });
        CheckBox cb2 = new CheckBox("Switch Selects Enabled", true);
        cb2.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                for (Iterator<Component> it = layout.getComponentIterator(); it
                        .hasNext();) {
                    Component c = it.next();
                    if (c instanceof AbstractSelect) {
                        boolean enabled = !c.isEnabled();
                        c.setEnabled(enabled);
                        c.setCaption(c.getCaption().replace(
                                (enabled ? "disabled" : "enabled"),
                                (enabled ? "enabled" : "disabled")));
                    }
                }
            }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Component$ErrorListener

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.