All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.holonplatform.vaadin7.components.builders.InputConfigurator Maven / Gradle / Ivy

There is a newer version: 5.2.4
Show newest version
/*
 * Copyright 2016-2017 Axioma srl.
 * 
 * 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 com.holonplatform.vaadin7.components.builders;

import java.util.Locale;

import com.holonplatform.vaadin7.components.Input;
import com.holonplatform.vaadin7.components.ValueHolder.ValueChangeListener;

/**
 * Interface to configure a {@link Input} component.
 * 
 * @param  Value type
 * @param  Concrete configurator type
 * 
 * @since 5.0.0
 */
public interface InputConfigurator> extends ComponentConfigurator {

	/**
	 * Set the input component as read-only. The user can not change the value of a read-only input.
	 * @return this
	 */
	B readOnly();

	/**
	 * Sets the tabulator index of the component. The tab index property is used to specify the order in which
	 * the fields are focused when the user presses the Tab key. Components with a defined tab index are focused
	 * sequentially first, and then the components with no tab index.
	 * 

* If the tab index is not set (is set to zero), the default tab order is used. The order is somewhat * browser-dependent, but generally follows the HTML structure of the page. *

*

* A negative value means that the component is completely removed from the tabulation order and can not be reached * by pressing the Tab key at all. *

* @param tabIndex The tab order of this component. Indexes usually start from 1. Zero means that default tab order * should be used. A negative value means that the field should not be included in the tabbing sequence. * @return this */ B tabIndex(int tabIndex); /** * Sets an initial value for the field. * @param value The value to set * @return this */ B withValue(T value); /** * Add a {@link ValueChangeListener} to be notified when the input value changes. * @param listener The ValueChangeListener to add * @return this */ B withValueChangeListener(ValueChangeListener listener); /** * Sets the locale of this {@link Input} component. * @param locale The Locale to set * @return this */ B locale(Locale locale); /** * Base field configurator. * @param Field value type */ public interface BaseFieldConfigurator extends InputConfigurator> { } }