com.vaadin.addon.touchkit.extensions
Class Html5InputSettings

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.server.AbstractExtension
          extended by com.vaadin.addon.touchkit.extensions.Html5InputSettings
All Implemented Interfaces:
com.vaadin.event.MethodEventSource, com.vaadin.server.ClientConnector, com.vaadin.server.Extension, com.vaadin.shared.Connector, Serializable

public class Html5InputSettings
extends com.vaadin.server.AbstractExtension

A TextField extension to control the new input properties that were introduced in HTML5. Browser support for these properties may vary, but among modern mobile browsers it is generally quite good.

Note that values are passed as-is to the related DOM element, so be sure to validate any user submitted values.

See the following links for references for the supported properties: W3 Schools, Apple.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
 
Constructor Summary
Html5InputSettings(com.vaadin.ui.TextField tf)
           
 
Method Summary
 String getAutoCapitalize()
           
 boolean getAutoComplete()
           
 boolean getAutoCorrect()
           
 String getMax()
           
 String getMin()
           
 String getPlaceholder()
           
 String getProperty(String key)
          Returns the property identified by the provided key.
protected  Html5InputSettingsState getState()
           
 String getStep()
           
 void setAutoCapitalize(String value)
          See Apple ios developer docs.
 void setAutoComplete(boolean value)
           
 void setAutoCorrect(boolean value)
          See Apple ios developer docs.
 void setMax(Number max)
          Specifies the maximum value or input length for the field in characters.
 void setMax(String max)
          Specifies the maximum value or input length for the field in characters.
 void setMin(Number min)
          Specifies the minimum value or input length for the field.
 void setMin(String min)
          Specifies the minimum value or input length for the field.
 void setPlaceholder(String placeholder)
          Specifies the placeholder text displayed in light grey when the search input field is not currently in use.
 void setProperty(String key, String value)
          Sets a generic property of the textfield.
 void setStep(Number step)
          Set the step value for a number field
 void setStep(String step)
          Set the step value for a number field
 
Methods inherited from class com.vaadin.server.AbstractExtension
extend, getParent, getSupportedParentType, remove, setParent
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 

Constructor Detail

Html5InputSettings

public Html5InputSettings(com.vaadin.ui.TextField tf)
Method Detail

setAutoComplete

public void setAutoComplete(boolean value)

getAutoComplete

public boolean getAutoComplete()

setAutoCapitalize

public void setAutoCapitalize(String value)
See Apple ios developer docs.

Parameters:
value - The value for the "autocapitalize" property.

getAutoCapitalize

public String getAutoCapitalize()
Returns:
The value for the "autocapitalize" property or null if none set through setAutoCapitalize(String)

setAutoCorrect

public void setAutoCorrect(boolean value)
See Apple ios developer docs.

Parameters:
value - true to turn auto correct on and false to turn it off for the input field.

getAutoCorrect

public boolean getAutoCorrect()
Returns:
true if auto correct is on, false if off or not set.

setPlaceholder

public void setPlaceholder(String placeholder)
Specifies the placeholder text displayed in light grey when the search input field is not currently in use.

Parameters:
placeholder - The placeholder text.

getPlaceholder

public String getPlaceholder()
Returns:
The placeholder text or null if none set using setPlaceholder(String)

setMin

public void setMin(Number min)
Specifies the minimum value or input length for the field.

Parameters:
min - The minimum value or input length for the field.

setMin

public void setMin(String min)
Specifies the minimum value or input length for the field.

Parameters:
min - The minimum value or input length for the field.

getMin

public String getMin()
Returns:
The minimum value or input length of the field or null if none set.

setMax

public void setMax(Number max)
Specifies the maximum value or input length for the field in characters.

Parameters:
max - The maximum value or input length of the field in characters.

setMax

public void setMax(String max)
Specifies the maximum value or input length for the field in characters.

Parameters:
max - The maximum value or input length of the field in characters.

getMax

public String getMax()
Returns:
the maximum value or input length of the field

setStep

public void setStep(Number step)
Set the step value for a number field

Parameters:
step - the delta for each step.

setStep

public void setStep(String step)
Set the step value for a number field

Parameters:
step - the delta for each step.

getStep

public String getStep()
Returns:
The delta for each step in a number field, or null if none set.

setProperty

public void setProperty(String key,
                        String value)
Sets a generic property of the textfield. Instead of using this method directly. Developers should prefer to use typed API instead.

Parameters:
key -
value -

getProperty

public String getProperty(String key)
Returns the property identified by the provided key.

Parameters:
key - The key of the property to return
Returns:
The value of the property identified by the key argument.

getState

protected Html5InputSettingsState getState()
Overrides:
getState in class com.vaadin.server.AbstractClientConnector


Copyright © 2014 Vaadin Ltd. All rights reserved.