Examples of HorizontalLayout


Examples of com.vaadin.ui.HorizontalLayout

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

        HorizontalLayout row = new HorizontalLayout();
        row.setSpacing(true);
        row.setWidth("100%");
        addComponent(row);

        row.addComponent(getAccordion("Normal"));

        Accordion ac = getAccordion("Borderless");
        ac.addStyleName("borderless");
        row.addComponent(ac);

    }
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

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

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

        Slider slider = new Slider("Horizontal");
        slider.setValue(50.0);
        row.addComponent(slider);

        slider = new Slider("Horizontal, sized");
        slider.setValue(50.0);
        slider.setWidth("200px");
        row.addComponent(slider);

        slider = new Slider("Custom handle");
        slider.setValue(50.0);
        slider.setWidth("200px");
        slider.addStyleName("color1");
        row.addComponent(slider);

        slider = new Slider("Custom track");
        slider.setValue(50.0);
        slider.setWidth("200px");
        slider.addStyleName("color2");
        row.addComponent(slider);

        slider = new Slider("Custom indicator");
        slider.setValue(50.0);
        slider.setWidth("200px");
        slider.addStyleName("color3");
        row.addComponent(slider);

        slider = new Slider("No indicator");
        slider.setValue(50.0);
        slider.setWidth("200px");
        slider.addStyleName("no-indicator");
        row.addComponent(slider);

        slider = new Slider("With ticks (not in IE8 & IE9)");
        slider.setValue(3.0);
        slider.setWidth("200px");
        slider.setMax(4);
        slider.addStyleName("ticks");
        row.addComponent(slider);

        slider = new Slider("Toggle imitation");
        slider.setWidth("50px");
        slider.setResolution(0);
        slider.setMin(0);
        slider.setMax(1);
        row.addComponent(slider);

        slider = new Slider("Vertical");
        slider.setValue(50.0);
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("Vertical, sized");
        slider.setValue(50.0);
        slider.setOrientation(SliderOrientation.VERTICAL);
        slider.setHeight("200px");
        row.addComponent(slider);

        slider = new Slider("Custom handle");
        slider.setValue(50.0);
        slider.setHeight("200px");
        slider.addStyleName("color1");
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("Custom track");
        slider.setValue(50.0);
        slider.setHeight("200px");
        slider.addStyleName("color2");
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("Custom indicator");
        slider.setValue(50.0);
        slider.setHeight("200px");
        slider.addStyleName("color3");
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("No indicator");
        slider.setValue(50.0);
        slider.setHeight("200px");
        slider.addStyleName("no-indicator");
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("With ticks");
        slider.setValue(3.0);
        slider.setHeight("200px");
        slider.setMax(4);
        slider.addStyleName("ticks");
        slider.setOrientation(SliderOrientation.VERTICAL);
        row.addComponent(slider);

        slider = new Slider("Disabled");
        slider.setValue(50.0);
        slider.setEnabled(false);
        row.addComponent(slider);

        h1 = new Label("Progress Bars");
        h1.addStyleName("h1");
        addComponent(h1);

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

        pb = new ProgressBar();
        pb.setCaption("Default");
        pb.setWidth("300px");
        // pb.setValue(0.6f);
        row.addComponent(pb);

        pb2 = new ProgressBar();
        pb2.setCaption("Point style");
        pb2.setWidth("300px");
        pb2.addStyleName("point");
        // pb2.setValue(0.6f);
        row.addComponent(pb2);

        if (!ValoThemeUI.isTestMode()) {
            ProgressBar pb3 = new ProgressBar();
            pb3.setIndeterminate(true);
            pb3.setCaption("Indeterminate");
            row.addComponent(pb3);
        }
    }
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        return 3076;
    }

    @Override
    protected void setup() {
        HorizontalLayout hl = new HorizontalLayout();

        container50 = createContainer(50);
        container2 = createContainer(2);

        table = new Table();
        table.setContainerDataSource(container2);
        table.setPageLength(10);

        VerticalLayout buttonLayout = new VerticalLayout();
        buttonLayout.setWidth(null);

        Button b = new Button("Set items to 2", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                table.setContainerDataSource(container2);
            }
        });
        buttonLayout.addComponent(b);

        b = new Button("Set items to 50", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                table.setContainerDataSource(container50);
            }

        });
        buttonLayout.addComponent(b);

        hl.addComponent(buttonLayout);
        hl.addComponent(table);

        addComponent(hl);
    }
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        private static final int LAST = 1;
        private Button up;
        private Button down;

        MyComponent(String name) {
            HorizontalLayout ol = new HorizontalLayout();
            ol.setId(name.replaceAll(" ", ""));
            ol.addComponent(new Label(name));
            up = new Button("up");
            up.addListener(new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    int newIndex = order.indexOf(MyComponent.this) - 1;
                    MyComponent old = order.get(newIndex);
                    main.replaceComponent(old, MyComponent.this);
                    order.remove(MyComponent.this);
                    order.add(newIndex, MyComponent.this);
                    if (newIndex == 0) {
                        MyComponent.this.setMode(FIRST);
                    } else {
                        MyComponent.this.setMode(69);
                    }
                }
            });
            ol.addComponent(up);

            down = new Button("down");
            down.addListener(new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    int newIndex = order.indexOf(MyComponent.this) + 1;
                    MyComponent old = order.get(newIndex);
                    main.replaceComponent(old, MyComponent.this);
                    order.remove(MyComponent.this);
                    order.add(newIndex, MyComponent.this);
                    if (newIndex == order.size() - 1) {
                        MyComponent.this.setMode(LAST);
                    } else {
                        MyComponent.this.setMode(69);
                    }
                }
            });
            ol.addComponent(down);

            setCompositionRoot(ol);

        }
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        // Create horizontal ordered layout
        VerticalLayout panelALayout = new VerticalLayout();
        panelALayout.setMargin(true);
        final Panel panelA = new Panel(
                "Panel containing horizontal ordered layout", panelALayout);
        HorizontalLayout layoutA = new HorizontalLayout();
        // Add 4 random components
        fillLayout(layoutA, componentCountA);
        // Add layout to panel
        panelALayout.addComponent(layoutA);

        // Create vertical ordered layout
        VerticalLayout panelBLayout = new VerticalLayout();
        panelBLayout.setMargin(true);
        final Panel panelB = new Panel(
                "Panel containing vertical ordered layout", panelBLayout);
        VerticalLayout layoutB = new VerticalLayout();
        // Add 4 random components
        fillLayout(layoutB, componentCountB);
        // Add layout to panel
        panelBLayout.addComponent(layoutB);

        // Create grid layout
        final int gridSize = (int) java.lang.Math.sqrt(componentCountC);
        VerticalLayout panelGLayout = new VerticalLayout();
        panelGLayout.setMargin(true);
        final Panel panelG = new Panel("Panel containing grid layout ("
                + gridSize + " x " + gridSize + ")", panelGLayout);
        GridLayout layoutG = new GridLayout(gridSize, gridSize);
        // Add 12 random components
        fillLayout(layoutG, componentCountC);
        // Add layout to panel
        panelGLayout.addComponent(layoutG);

        // Create TabSheet
        final TabSheet tabsheet = new TabSheet();
        tabsheet.setCaption("Tabsheet, above layouts are added to this component");
        layoutA = new HorizontalLayout();
        // Add 4 random components
        fillLayout(layoutA, componentCountA);
        tabsheet.addTab(layoutA, "Horizontal ordered layout", null);
        layoutB = new VerticalLayout();
        // Add 4 random components
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        addComponent(withParametersButton);
    }

    public void addComponents(List<Class<? extends Component>> components,
            String URL) {
        final HorizontalLayout hl = new HorizontalLayout();
        for (Class<? extends Component> cls : components) {
            try {
                AbstractComponent c = (AbstractComponent) cls.newInstance();
                c.setId(cls.getName());
                c.setCaption(cls.getName());
                c.setDescription(URL);
                c.setWidth("100px");
                c.setHeight("100px");
                hl.addComponent(c);

                new BrowserWindowOpener(URL).extend(c);

                if (c instanceof Button) {
                    ((Button) c).addClickListener(new ClickListener() {
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

@Theme("tests-responsive")
public class ResponsiveLayoutUpdate extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        HorizontalLayout layout = new HorizontalLayout();
        layout.addStyleName("layout-update");
        layout.setWidth("100%");
        setContent(layout);
        Responsive.makeResponsive(layout);

        Label label = new Label(
                "This label changes its size between the breakpoints, allowing more space for the adjacent component.");
        label.addStyleName("change-width");
        label.setSizeUndefined();
        layout.addComponent(label);

        Panel panel = new Panel("Panel");
        panel.setContent(new Label(
                "This Panel should be maximized in both breakpoints."));
        panel.setSizeFull();
        layout.addComponent(panel);
        layout.setExpandRatio(panel, 1);
    }
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        }
        return t;
    }

    public Component createTestBench(Tree t) {
        final HorizontalLayout ol = new HorizontalLayout();

        ol.addComponent(t);

        final VerticalLayout statusLayout = new VerticalLayout();
        statusLayout.setMargin(true);
        final Panel status = new Panel("Events", statusLayout);
        final Button clear = new Button("c");
        clear.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                statusLayout.removeAllComponents();
                statusLayout.addComponent(clear);
            }
        });
        statusLayout.addComponent(clear);

        status.setHeight("300px");
        status.setWidth("400px");

        ol.addComponent(status);

        t.addListener(new Listener() {
            @Override
            public void componentEvent(Event event) {
                statusLayout
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        olayout = new HorizontalLayout();
        olayout.addComponentAttachListener(new MyAttachListener());
        olayout.addComponentDetachListener(new MyDetachListener());

        gridlayout = new GridLayout();
        gridlayout.addComponentAttachListener(new MyAttachListener());
View Full Code Here

Examples of com.vaadin.ui.HorizontalLayout

        ttc.setMaxWidth(350);
        ttc.setOpenDelay(200);
        ttc.setCloseTimeout(200);
        ttc.setQuickOpenDelay(1000);
        ttc.setQuickOpenTimeout(1000);
        HorizontalLayout layout = new HorizontalLayout();
        layout.addComponent(makeButton("first"));
        layout.addComponent(makeButton("second"));
        addComponent(layout);

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