Examples of HorizontalLayout


Examples of com.vaadin.ui.HorizontalLayout

        Label h1 = new Label("Tables");
        h1.addStyleName("h1");
        addComponent(h1);

        HorizontalLayout wrap = new HorizontalLayout();
        wrap.addStyleName("wrapping");
        wrap.setSpacing(true);
        addComponent(wrap);

        wrap.addComponents(hierarchical, footer, sized, expandRatios, stripes,
                verticalLines, horizontalLines, borderless, headers, compact,
                small, rowIndex, rowCaption, rowIcon, componentsInCells);

        ValueChangeListener update = new ValueChangeListener() {
            @Override
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        LegacyWindow main = new LegacyWindow();
        setMainWindow(main);

        main.addComponent(info);

        HorizontalLayout l = new HorizontalLayout();
        main.addComponent(l);

        l.addComponent(new Button("Toggle root panel",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        toggle(root);
                    }
                }));
        l.addComponent(new Button("Toggle panel one",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        toggle(one);
                    }
                }));
        l.addComponent(new Button("Toggle panel two",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        toggle(two);
                    }
                }));
        l.addComponent(new Button("Toggle form", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                toggle(form);
            }
        }));
        l.addComponent(new Button("Toggle table", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                toggle(table);
            }
        }));
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        setTheme("tests-tickets");
        createUI((AbstractOrderedLayout) w.getContent());
    }

    private void createUI(AbstractOrderedLayout layout) {
        HorizontalLayout horiz = new HorizontalLayout();
        horiz.setSpacing(true);
        horiz.setMargin(true);
        horiz.setStyleName("ticket2222");

        horiz.addComponent(new Label("Horiz spacing: 60px;"));
        horiz.addComponent(new Label("Margin-left: 40px"));
        horiz.addComponent(new Label("Margin-top: 100px;"));
        horiz.addComponent(new Label("Margin-right: 20px;"));
        horiz.addComponent(new Label("Margin-bottom: 30px;"));
        horiz.addStyleName("borders");

        VerticalLayout vert = new VerticalLayout();
        vert.setSizeUndefined();
        vert.setSpacing(true);
        vert.setMargin(false);
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        initHideWeekEndButton();
        initReadOnlyButton();
        initDisabledButton();
        initAddNewEventButton();

        HorizontalLayout hl = new HorizontalLayout();
        hl.setWidth("100%");
        hl.setSpacing(true);
        hl.addComponent(prevButton);
        hl.addComponent(captionLabel);

        CssLayout group = new CssLayout();
        group.addStyleName("v-component-group");
        group.addComponent(dayButton);
        group.addComponent(weekButton);
        group.addComponent(monthButton);
        hl.addComponent(group);

        hl.addComponent(nextButton);
        hl.setComponentAlignment(prevButton, Alignment.MIDDLE_LEFT);
        hl.setComponentAlignment(captionLabel, Alignment.MIDDLE_CENTER);
        hl.setComponentAlignment(group, Alignment.MIDDLE_CENTER);
        hl.setComponentAlignment(nextButton, Alignment.MIDDLE_RIGHT);

        // monthButton.setVisible(viewMode == Mode.WEEK);
        // weekButton.setVisible(viewMode == Mode.DAY);

        HorizontalLayout controlPanel = new HorizontalLayout();
        controlPanel.setSpacing(true);
        controlPanel.setWidth("100%");
        controlPanel.addComponent(localeSelect);
        controlPanel.addComponent(timeZoneSelect);
        controlPanel.addComponent(formatSelect);
        controlPanel.addComponent(hideWeekendsButton);
        controlPanel.addComponent(readOnlyButton);
        controlPanel.addComponent(disabledButton);
        controlPanel.addComponent(addNewEvent);

        controlPanel.setComponentAlignment(timeZoneSelect,
                Alignment.MIDDLE_LEFT);
        controlPanel.setComponentAlignment(formatSelect, Alignment.MIDDLE_LEFT);
        controlPanel.setComponentAlignment(localeSelect, Alignment.MIDDLE_LEFT);
        controlPanel.setComponentAlignment(hideWeekendsButton,
                Alignment.MIDDLE_LEFT);
        controlPanel.setComponentAlignment(readOnlyButton,
                Alignment.MIDDLE_LEFT);
        controlPanel.setComponentAlignment(disabledButton,
                Alignment.MIDDLE_LEFT);
        controlPanel.setComponentAlignment(addNewEvent, Alignment.MIDDLE_LEFT);

        Label viewCaption = new Label("Calendar");
        viewCaption.setStyleName(ValoTheme.LABEL_H1);
        addComponent(viewCaption);
        addComponent(controlPanel);
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        }
        lo.addComponent(elp);
        elp.setWidth("300px");
        elp.setHeight("300px");

        HorizontalLayout elh = new HorizontalLayout();
        Panel elph = new Panel(
                "Horizontal ExpandLayout /w first component expanded", elh);
        elh.setWidth("1000px");
        for (int i = 0; i < 3; i++) {
            Button b = new Button("x");
            elh.addComponent(b);
            if (i == 0) {
                b.setSizeFull();
                elh.setExpandRatio(b, 1);
            }
        }
        lo.addComponent(elph);
        elph.setWidth("300px");
        elph.setHeight("300px");
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

            public void windowClose(Window.CloseEvent e) {
                discardCalendarEvent();
            }
        });

        HorizontalLayout buttons = new HorizontalLayout();
        buttons.addStyleName("v-window-bottom-toolbar");
        buttons.setWidth("100%");
        buttons.setSpacing(true);
        buttons.addComponent(deleteEventButton);
        buttons.addComponent(applyEventButton);
        buttons.setExpandRatio(applyEventButton, 1);
        buttons.setComponentAlignment(applyEventButton, Alignment.TOP_RIGHT);
        buttons.addComponent(cancel);
        layout.addComponent(buttons);

    }
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

    private Layout buildLayout() {
        final VerticalLayout mainLayout = new VerticalLayout();
        mainLayout.setSizeFull();

        HorizontalLayout buttonBar = new HorizontalLayout();
        buttonBar.setSizeUndefined();
        Button first = new Button("First layout");
        Button second = new Button("Second layout");
        first.setId("FirstButton");
        second.setId("SecondButton");
        buttonBar.addComponent(first);
        buttonBar.addComponent(second);
        mainLayout.addComponent(buttonBar);

        final HorizontalLayout firstLayout = buildTestLayout(true);
        final HorizontalLayout secondLayout = buildTestLayout(false);

        mainLayout.addComponent(firstLayout);
        mainLayout.setExpandRatio(firstLayout, 1);

        first.addListener(new Button.ClickListener() {
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

    }

    private HorizontalLayout buildTestLayout(boolean first) {
        String which = first ? "First" : "Second";

        HorizontalLayout hl = new HorizontalLayout();
        hl.setSizeFull();
        hl.setId(which + "Layout");

        Table t = new Table();
        t.addContainerProperty("name", String.class, null);
        for (int i = 0; i < 10; i++) {
            String id = which + " " + i;
            t.addItem(new String[] { id }, id);
        }
        t.setId(which + "Table");
        t.setItemCaptionPropertyId("name");
        t.setSizeFull();

        hl.addComponent(t);

        return hl;
    }
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

    private Label column3Width = new Label("Undefined");

    @Override
    protected void setup() {

        HorizontalLayout widths = new HorizontalLayout();
        widths.setSpacing(true);
        widths.setWidth("50%");

        column1Width.setCaption("Column 1 width");
        widths.addComponent(column1Width);

        column2Width.setCaption("Column 2 width");
        widths.addComponent(column2Width);

        column3Width.setCaption("Column 3 width");
        widths.addComponent(column3Width);

        addComponent(widths);

        Table table1 = initTable();
        addComponent(table1);
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        w.setContent(layout);
        createUI(layout);
    }

    private void createUI(GridLayout layout) {
        HorizontalLayout buttonLayout = new HorizontalLayout();
        button1 = new Button("Button which is 50px wide");
        button1.setWidth("50px");
        button2 = new Button("Button without width");
        button3 = new Button("Click to repaint buttons", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                button1.markAsDirty();
                button2.markAsDirty();
                button3.markAsDirty();

            }

        });

        buttonLayout.addComponent(button1);
        buttonLayout.addComponent(button2);
        buttonLayout.addComponent(button3);

        layout.addComponent(buttonLayout);

    }
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.