Package com.vaadin.ui

Examples of com.vaadin.ui.VerticalLayout


        NativeButton componentWithLongTooltip = new NativeButton("Long tooltip");
        componentWithLongTooltip.setId("longTooltip");
        componentWithLongTooltip.setDescription(LONG_TOOLTIP_TEXT);

        VerticalLayout vl = new VerticalLayout();

        TextField component1 = new TextField("TextField");
        component1.setId("component1");
        TextField component2 = new TextField("TextField");
        TextField component3 = new TextField("TextField");
        TextField component4 = new TextField("TextField");
        TextField component5 = new TextField("TextField");
        TextField component6 = new TextField("TextField");
        TextField component7 = new TextField("TextField");
        TextField component8 = new TextField("TextField");

        // some count of any components should be added before (between) buttons
        // to make defect reproducible
        vl.addComponents(component1, component2, component2, component3,
                component4, component5, component5, component6, component7,
                component8);

        getLayout().addComponents(componentWithShortTooltip, vl,
                componentWithLongTooltip);
View Full Code Here


public class TooltipInWindow extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        Window window = new Window("Window", layout);
        layout.setSizeUndefined();
        window.center();
        layout.addComponent(createTextField("tf1"));

        addWindow(window);
        addComponent(createTextField("tf2"));
    }
View Full Code Here

    static final String TABLE = "table";

    @Override
    public void init(VaadinRequest request) {
        final VerticalLayout rootLayout = new VerticalLayout();

        rootLayout.setSpacing(true);
        rootLayout.setSizeFull();
        rootLayout.setMargin(true);

        final Label sizeLabel = new Label();
        final ExpandingContainer container = new ExpandingContainer(sizeLabel);
        container.logDetails(false);

        Table table = new Table(null, container) {
            @Override
            public void changeVariables(Object source,
                    Map<String, Object> variables) {
                if (variables.containsKey("firstvisible")) {
                    int index = (Integer) variables.get("firstvisible");
                    container.checkExpand(index);
                }
                if (variables.containsKey("reqfirstrow")
                        || variables.containsKey("reqrows")) {
                    try {
                        int index = ((Integer) variables
                                .get("lastToBeRendered")).intValue();
                        container.checkExpand(index);
                    } catch (Exception e) {
                        // do nothing
                    }
                }
                super.changeVariables(source, variables);
            }
        };
        table.setId(TABLE);
        table.setCacheRate(0);
        table.setSizeFull();
        table.setVisibleColumns(ExpandingContainer.PROPERTY_IDS
                .toArray(new String[ExpandingContainer.PROPERTY_IDS.size()]));

        table.setCurrentPageFirstItemIndex(120);

        rootLayout.addComponent(table);
        rootLayout.setExpandRatio(table, 1);

        rootLayout.addComponent(sizeLabel);

        setContent(rootLayout);

        container.checkExpand(300);
    }
View Full Code Here

        loginForm.setCaption("LoginForm (" + w + "/" + h + ")");
    }

    protected void login(LoginForm loginForm, String user, String password) {
        VerticalLayout infoLayout = new VerticalLayout();

        Label info = new Label("User '" + user + "', password='" + password
                + "' logged in");
        Button logoutButton = new Button("Log out", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Button b = event.getButton();
                loginFormLayout.replaceComponent(b.getParent(),
                        (LoginForm) b.getData());
            }

        });
        logoutButton.setData(loginForm);

        infoLayout.addComponent(info);
        infoLayout.addComponent(logoutButton);

        loginFormLayout.replaceComponent(loginForm, infoLayout);

    }
View Full Code Here

        getUI().addWindow(createResizableWindow());
        getUI().addWindow(createResizableWindowWithHorizontalScrollbar());
    }

    private Window createNonResizableWindow() {
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        Window w = new Window("Scroll", layout);
        Label desc = new Label(
                "This is a new child window with a preset"
                        + " width, height and position. Resizing has been"
                        + " disabled for this window. Additionally, this text label"
                        + " is intentionally too large to fit the window. You can"
                        + " use the scrollbars to view different parts of the window content.");
        layout.addComponent(desc);

        // Set window position
        w.setPositionX(100);
        w.setPositionY(100);
View Full Code Here

        return w;
    }

    private Window createNonResizableWindowWithHorizontalScrollbar() {
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        Window w = new Window("Scroll", layout);
        Label desc = new Label(
                "This is a new child window with a preset"
                        + " width, height and position. Resizing has been"
                        + " disabled for this window. Additionally, this text label"
                        + " is intentionally too large to fit the window. You could"
                        + " use the scrollbars to view different parts of the window content,"
                        + " except it's too small for that either.");
        // disable wrapping
        desc.setSizeUndefined();
        layout.addComponent(desc);

        // Set window position
        w.setPositionX(200);
        w.setPositionY(100);
View Full Code Here

        return w;
    }

    private Window createResizableWindow() {
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        Window w = new Window("Resize", layout);
        Label desc = new Label(
                "This is a new child window with a preset"
                        + " width, height and position. Resizing has not been"
                        + " disabled for this window. Additionally, this text label"
                        + " is intentionally too large to fit the window. You can resize or"
                        + " use the scrollbars to view different parts of the window content.");
        layout.addComponent(desc);

        // Set window position
        w.setPositionX(300);
        w.setPositionY(100);
View Full Code Here

        return w;
    }

    private Window createResizableWindowWithHorizontalScrollbar() {
        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(true);
        Window w = new Window("Resize", layout);
        Label desc = new Label(
                "This is a new child window with a preset"
                        + " width, height and position. Resizing has not been"
                        + " disabled for this window. Additionally, this text label"
                        + " is intentionally too large to fit the window. You can resize"
                        + " to view different parts of the window content.");
        // disable wrapping
        desc.setSizeUndefined();
        layout.addComponent(desc);

        // Set window position
        w.setPositionX(400);
        w.setPositionY(100);
View Full Code Here

    public final static String SUCCESS_TEXT = "Click received succesfully!";
    public final static String WRONG_BUTTON_TEXT = "Wrong button clicked.";

    @Override
    protected void setup(VaadinRequest request) {
        final VerticalLayout rootLayout = new VerticalLayout();
        final Label statusLabel = new Label("Test initialized");
        rootLayout.addComponent(new Button("Click here", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                statusLabel.setValue(SUCCESS_TEXT);
            }

        }));
        Button visitLocation = new Button("Drag here", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                statusLabel.setValue(WRONG_BUTTON_TEXT);
            }

        });
        rootLayout.addComponent(statusLabel);
        rootLayout.addComponent(visitLocation);
        rootLayout.setComponentAlignment(visitLocation, Alignment.BOTTOM_RIGHT);
        rootLayout.setSizeFull();
        rootLayout.setMargin(true);
        setContent(rootLayout);
    }
View Full Code Here

        createLayout(l1, new HorizontalLayout(), "1000px", "150px", "100%",
                null, true);
        createLayout(l1, new HorizontalLayout(), "1000px", "150px", "50px",
                null, false);
        GridLayout l2 = new GridLayout(6, 1);
        createLayout(l2, new VerticalLayout(), "200px", "500px", true);
        createLayout(l2, new VerticalLayout(), "200px", "500px", "100%", null,
                true);
        createLayout(l2, new VerticalLayout(), "150px", "500px", true);
        createLayout(l2, new VerticalLayout(), "150px", "500px", "100%", null,
                true);
        createLayout(l2, new VerticalLayout(), "100px", "500px", true);
        createLayout(l2, new VerticalLayout(), "100px", "500px", "100%", null,
                true);
        layout.addComponent(l1);
        layout.addComponent(l2);

        return layout;
View Full Code Here

TOP

Related Classes of com.vaadin.ui.VerticalLayout

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.