com.vaadin.flow.component.html.
Class Input
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.AbstractField<C,T>
-
- com.vaadin.flow.component.AbstractSinglePropertyField<Input,String>
-
- com.vaadin.flow.component.html.Input
-
All Implemented Interfaces:
AttachNotifier, BlurNotifier<Input>, DetachNotifier, Focusable<Input>, FocusNotifier<Input>, HasElement, HasEnabled, HasSize, HasStyle, HasValue<AbstractField.ComponentValueChangeEvent<Input,String>,String>, HasValueAndElement<AbstractField.ComponentValueChangeEvent<Input,String>,String>, Serializable
@Tag(value="input") public class Input extends AbstractSinglePropertyField<Input,String> implements Focusable<Input>, HasSize, HasStyle
Component representing an
<input>
element.Since:
1.0
Author:
Vaadin Ltd
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
AbstractField.ComponentValueChangeEvent<C extends Component,V>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
BlurNotifier.BlurEvent<C extends Component>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
FocusNotifier.FocusEvent<C extends Component>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>
-
-
Constructor Summary
Constructors Constructor and Description Input()
Creates a new input without any specific type.
-
Method Summary
All Methods Modifier and Type Method and Description Optional<String>
getPlaceholder()
Gets the placeholder text.
String
getType()
Gets the type of this input.
void
setPlaceholder(String placeholder)
Sets the placeholder text that is shown if the input is empty.
void
setType(String type)
Sets the type of this input.
-
Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
hasValidValue, setPresentationValue, setSynchronizedEvent
-
Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.Focusable
blur, focus, getTabIndex, setTabIndex
-
Methods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListener
-
Methods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListener
-
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getWidth, setHeight, setSizeFull, setSizeUndefined, setWidth
-
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
-
Methods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValue
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
-
-
-
Method Detail
-
setPlaceholder
public void setPlaceholder(String placeholder)
Sets the placeholder text that is shown if the input is empty.
Parameters:
placeholder
- the placeholder text to set, ornull
to remove the placeholder
-
getPlaceholder
public Optional<String> getPlaceholder()
Gets the placeholder text.
Returns:
an optional placeholder, or an empty optional if no placeholder has been set
See Also:
-
setType
public void setType(String type)
Sets the type of this input.
Parameters:
type
- the type, notnull
See Also:
-
getType
public String getType()
Gets the type of this input.
Returns:
the input type, by default "text"
-
-