Package com.vaadin.ui

Examples of com.vaadin.ui.Slider


            table.addContainerProperty("slider", TextField.class, null);
            table.addGeneratedColumn("slider", new ColumnGenerator() {
                @Override
                public Object generateCell(Table source, Object itemId,
                        Object columnId) {
                    Slider s = new Slider();
                    s.setValue(30.0);
                    return s;
                }
            });

            table.addContainerProperty("progress", TextField.class, null);
View Full Code Here


        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);
View Full Code Here

                        });

                        layout.addComponent(s1);
                        layout.addComponent(s2);

                        Slider s = new Slider();
                        s.setCaption("Volume");
                        s.setMax(13);
                        s.setMin(12);
                        s.setResolution(2);
                        s.setImmediate(true);
                        // s.setOrientation(Slider.ORIENTATION_VERTICAL);
                        // s.setArrows(false);

                        layout.addComponent(s);
View Full Code Here

import com.vaadin.ui.Slider.ValueOutOfBoundsException;

public class SliderTest extends TestCase {

    public void testOutOfBounds() {
        Slider s = new Slider(0, 10);
        s.setValue(0.0);
        Assert.assertEquals(0.0, s.getValue().doubleValue(), 0.001);
        s.setValue(10.0);
        Assert.assertEquals(10.0, s.getValue().doubleValue(), 0.001);
        try {
            s.setValue(20.0);
            fail("Should throw out of bounds exception");
        } catch (ValueOutOfBoundsException e) {
            // TODO: handle exception
        }
View Full Code Here

     * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
     * VaadinRequest)
     */
    @Override
    protected void setup(VaadinRequest request) {
        Slider slider = new Slider();
        slider.setDescription("Tooltip");
        addComponent(slider);
    }
View Full Code Here

        fields.add(new PasswordField());
        fields.add(new TextField());
        fields.add(new TextArea());
        fields.add(new RichTextArea());
        fields.add(new CheckBox());
        fields.add(new Slider());

        clearTabIndexes.click();

        buttonLayout.addComponents(clearTabIndexes, setTabIndexesToOne,
                setTabIndexesInOrder, setTabIndexesInReverseOrder);
View Full Code Here

        test(layout, rta);

        final Select select = new Select("Select " + count++);
        test(layout, select);

        final Slider slider = new Slider("Slider " + count++);
        test(layout, slider);

        final Table table = new Table("Table " + count++);
        test(layout, table);
View Full Code Here

public class SlidersCssTest {

    private int debugIdCounter = 0;

    public SlidersCssTest(TestSampler parent) {
        Slider slide = new Slider();
        slide.setId("slider" + debugIdCounter++);
        parent.addComponent(slide);

        slide = new Slider();
        slide.setOrientation(SliderOrientation.VERTICAL);
        slide.setId("slider" + debugIdCounter++);
        parent.addComponent(slide);
    }
View Full Code Here

    protected void setup(VaadinRequest request) {
        VerticalLayout content = new VerticalLayout();
        content.setMargin(true);
        content.setSpacing(true);

        final Slider slider = new Slider(0, 5);
        slider.setWidth(200, Unit.PIXELS);
        slider.setValue(1.0D);

        Button disableButton = new Button("Disable slider");
        disableButton.setId("disableButton");
        disableButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                slider.setEnabled(false);
            }
        });

        content.addComponent(slider);
        content.addComponent(disableButton);
View Full Code Here

    @Override
    protected void setup(VaadinRequest request) {
        Item item = new BeanItem<TestBean>(new TestBean());

        Slider slider = new Slider(0, 20);
        slider.setWidth("200px");
        slider.setPropertyDataSource(item.getItemProperty("doubleValue"));
        addComponent(slider);

        ProgressIndicator pi = new ProgressIndicator();
        pi.setPollingInterval(60 * 1000);
        pi.setWidth("200px");
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Slider

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.