Class WPasswordEdit
A password edit is a line edit where the character are hidden.
The widget corresponds to the HTML <input type="password">
tag.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Field Summary
Fields inherited from class eu.webtoolkit.jwt.WInteractWidget
dragTouchEndSlot_, dragTouchSlot_, noDefault
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a password edit with empty content.WPasswordEdit
(WContainerWidget parentContainer) Creates a password edit with empty content.WPasswordEdit
(String content) Creates a password edit with given content.WPasswordEdit
(String content, WContainerWidget parentContainer) Creates a password edit with given content. -
Method Summary
Modifier and TypeMethodDescriptionReturns the message displayed when the password is empty and required.Returns the message displayed when the password does not match the pattern.Returns the message displayed when the password is too long.Returns the message displayed when the password is too small.int
Returns the minimum length of text that can be entered.Return the pattern the password must match.protected WValidator
protected String
getType()
Returns the validator.boolean
Returns whether a native HTML5 control is used.boolean
Return if the password is required.void
Sets the message to display when the password is empty and required.void
Sets the message to display when the password does not match the pattern.void
Sets the message to display when the password is too long.void
Sets the message to display when the password is too small.void
setMaxLength
(int length) Specifies the maximum length of text that can be entered.void
setMinLength
(int length) Specifies the minimum length of text that can be entered.void
setNativeControl
(boolean nativeControl) Changes whether a native HTML5 control is used.void
setPattern
(String newPattern) Specifies the pattern that the password must match.void
setRequired
(boolean required) Specifies if the password is required.void
setValidator
(WValidator validator) Sets a validator for this field.validate()
Validates the field.Methods inherited from class eu.webtoolkit.jwt.WLineEdit
boxBorder, boxPadding, getAutoCompleteToken, getCursorPosition, getDisplayText, getDomChanges, getEchoMode, getInputMask, getInputMode, getMaxLength, getSelectedText, getSelectionStart, getText, getTextSize, getValueText, hasSelectedText, isAutoComplete, render, setAutoComplete, setAutoComplete, setEchoMode, setFormData, setInputMask, setInputMask, setInputMask, setInputMask, setInputMode, setSelection, setText, setTextSize, setValueText, textInput
Methods inherited from class eu.webtoolkit.jwt.WFormWidget
changed, enableAjax, getLabel, getPlaceholderText, getTabIndex, hasValidatorChanged, isCanReceiveFocus, isReadOnly, propagateSetEnabled, refresh, remove, setEnabled, setHidden, setPlaceholderText, setReadOnly, setToolTip, validated, validatorChanged
Methods inherited from class eu.webtoolkit.jwt.WInteractWidget
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, getMouseOverDelay, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, setDraggable, setDraggable, setDraggable, setDraggable, setMouseOverDelay, setPopup, touchEnded, touchMoved, touchStarted, unsetDraggable
Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, beingDeleted, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, hideToolTip, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, iterateChildren, jsStringLiteral, jsStringLiteral, manageWidget, parentResized, parentResized, propagateSetVisible, removeScript, removeStyleClass, resize, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFlexBox, setFloatSide, setFocus, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setVerticalAlignment, showToolTip, showToolTipOnHover, unescapeText, updateSignalConnection, voidEventSignal, widgetAdded, widgetRemoved
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, layoutSizeChanged, needsRerender, positionAt, positionAt, positionAt, positionAt, removeFromParent, removeStyleClass, removeWidget, render, resize, scheduleRender, scheduleRender, scheduleRender, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
Methods inherited from class eu.webtoolkit.jwt.WObject
getObjectName
-
Constructor Details
-
WPasswordEdit
Creates a password edit with empty content. -
WPasswordEdit
public WPasswordEdit()Creates a password edit with empty content. -
WPasswordEdit
Creates a password edit with given content. -
WPasswordEdit
Creates a password edit with given content.
-
-
Method Details
-
setMaxLength
public void setMaxLength(int length) Description copied from class:WLineEdit
Specifies the maximum length of text that can be entered.A value <= 0 indicates that there is no limit.
The default value is -1.
- Overrides:
setMaxLength
in classWLineEdit
-
setNativeControl
public void setNativeControl(boolean nativeControl) Changes whether a native HTML5 control is used.When enabled the browser's native attribute for password input (<input type="password">) will be used instead of a validator.
This option is set to false by default. @see WPasswordEdit#isNativeControl()
-
isNativeControl
public boolean isNativeControl()Returns whether a native HTML5 control is used.- See Also:
-
setMinLength
public void setMinLength(int length) Specifies the minimum length of text that can be entered.The default value is 0.
-
getMinLength
public int getMinLength()Returns the minimum length of text that can be entered.- See Also:
-
setRequired
public void setRequired(boolean required) Specifies if the password is required.If true, the password cannot be empty.
The default value is true.
-
isRequired
public boolean isRequired()Return if the password is required.- See Also:
-
setPattern
Specifies the pattern that the password must match.The default value is "".
-
getPattern
Return the pattern the password must match.- See Also:
-
setInvalidTooLongText
Sets the message to display when the password is too long.The default value is "Password too long".
-
getInvalidTooLongText
Returns the message displayed when the password is too long.- See Also:
-
setInvalidTooShortText
Sets the message to display when the password is too small.The default value is "Password too small".
-
getInvalidTooShortText
Returns the message displayed when the password is too small. -
setInvalidNoMatchText
Sets the message to display when the password does not match the pattern.The default value is "Invalid input".
-
getInvalidNoMatchText
Returns the message displayed when the password does not match the pattern.- See Also:
-
setInvalidBlankText
Sets the message to display when the password is empty and required.The default value is "This field cannot be empty".
-
getInvalidBlankText
Returns the message displayed when the password is empty and required.- See Also:
-
setValidator
Description copied from class:WFormWidget
Sets a validator for this field.The validator is used to validate the current input.
The default value is
null
.- Overrides:
setValidator
in classWFormWidget
- See Also:
-
getValidator
Description copied from class:WFormWidget
Returns the validator.- Overrides:
getValidator
in classWFormWidget
-
validate
Description copied from class:WFormWidget
Validates the field. -
getType
-
getRealValidator
- Overrides:
getRealValidator
in classWFormWidget
-