de.akquinet.engineering.vaadin.html5.widgetset.RangeField.java Source code

Java tutorial

Introduction

Here is the source code for de.akquinet.engineering.vaadin.html5.widgetset.RangeField.java

Source

/*
 * Copyright 2014 akquinet engineering GmbH
 *  
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package de.akquinet.engineering.vaadin.html5.widgetset;

import com.vaadin.data.Property;
import com.vaadin.ui.TextField;

import de.akquinet.engineering.vaadin.html5.widgetset.client.RangeFieldState;

public class RangeField extends TextField {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    public RangeField() {
        super();
    }

    public RangeField(Property<?> dataSource) {
        super(dataSource);
    }

    public RangeField(String caption, Property<?> dataSource) {
        super(caption, dataSource);
    }

    public RangeField(String caption, String value) {
        super(caption, value);
    }

    public RangeField(String caption) {
        super(caption);
    }

    @Override
    protected RangeFieldState getState() {
        return (RangeFieldState) super.getState();
    }

    /**
     * @return the minimum number to be entered (or null for any number)
     */
    public Integer getMin() {
        return getState().min;
    }

    /**
     * @param min
     *            the minimum number to be entered (or null for any number)
     */
    public void setMin(Integer min) {
        getState().min = min;
    }

    /**
     * @return the maximum number to be entered (or null for any number)
     */
    public Integer getMax() {
        return getState().max;
    }

    /**
     * @param max
     *            the maximum number to be entered (or null for any number)
     */
    public void setMax(Integer max) {
        getState().max = max;
    }

    /**
     * @return the step for the number to be entered (or null for any number)
     */
    public Integer getStep() {
        return getState().step;
    }

    /**
     * @param step
     *            the step for the number to be entered (or null for any number)
     */
    public void setStep(Integer step) {
        getState().step = step;
    }

}