Package com.formdev.flatlaf.ui
Class FlatPasswordFieldUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.TextUI
-
- javax.swing.plaf.basic.BasicTextUI
-
- javax.swing.plaf.basic.BasicTextFieldUI
-
- com.formdev.flatlaf.ui.FlatTextFieldUI
-
- com.formdev.flatlaf.ui.FlatPasswordFieldUI
-
- All Implemented Interfaces:
FlatStylingSupport.StyleableUI,javax.swing.text.ViewFactory
public class FlatPasswordFieldUI extends FlatTextFieldUI
Provides the Flat LaF UI delegate forJPasswordField.
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.IconcapsLockIconprivate booleancapsLockIconSharedprivate java.awt.event.KeyListenercapsLockListenerprivate java.lang.CharacterechoCharprivate static java.lang.StringKEY_REVEAL_SELECTEDprivate javax.swing.JToggleButtonrevealButtonprotected javax.swing.IconrevealIconprotected booleanshowCapsLockprotected booleanshowRevealButtonprivate booleanuninstallEchoChar-
Fields inherited from class com.formdev.flatlaf.ui.FlatTextFieldUI
clearButton, disabledBackground, focusedBackground, iconTextGap, inactiveBackground, leadingComponent, leadingIcon, minimumWidth, placeholderForeground, showClearButton, trailingComponent, trailingIcon
-
-
Constructor Summary
Constructors Constructor Description FlatPasswordFieldUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyStyle(java.lang.Object style)protected java.lang.ObjectapplyStyleProperty(java.lang.String key, java.lang.Object value)javax.swing.text.Viewcreate(javax.swing.text.Element elem)protected javax.swing.JToggleButtoncreateRevealButton()static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent c)protected java.lang.StringgetPropertyPrefix()java.util.Map<java.lang.String,java.lang.Class<?>>getStyleableInfos(javax.swing.JComponent c)java.lang.ObjectgetStyleableValue(javax.swing.JComponent c, java.lang.String key)(package private) java.lang.StringgetStyleType()protected javax.swing.JComponent[]getTrailingComponents()Returns components placed at the trailing side of the text field.protected intgetTrailingIconWidth()protected booleanhasTrailingIcon()protected voidinstallDefaults()protected voidinstallKeyboardActions()protected voidinstallListeners()protected voidinstallRevealButton()voidinstallUI(javax.swing.JComponent c)protected booleanisCapsLockVisible()protected voidpaintCapsLock(java.awt.Graphics g, java.awt.Rectangle r)protected voidpaintIcons(java.awt.Graphics g, java.awt.Rectangle r)Paints the leading and trailing icons in the given rectangle.protected voidpropertyChange(java.beans.PropertyChangeEvent e)protected voiduninstallDefaults()protected voiduninstallListeners()protected voiduninstallRevealButton()voiduninstallUI(javax.swing.JComponent c)private voidupdateEchoChar(boolean selected)protected voidupdateRevealButton()-
Methods inherited from class com.formdev.flatlaf.ui.FlatTextFieldUI
clearButtonClicked, createCaret, createClearButton, documentChanged, getBackground, getIconsRect, getLeadingComponents, getLeadingIconWidth, getMinimumSize, getPadding, getPreferredSize, getVisibleEditorRect, hasDefaultMargins, hasLeadingIcon, installClearButton, installDocumentListener, installLayout, installLeadingComponent, installStyle, installTrailingComponent, isLeftToRight, paintBackground, paintBackground, paintPlaceholder, paintSafely, prepareLeadingOrTrailingComponent, scrollCaretToVisible, uninstallClearButton, uninstallLeadingComponent, uninstallTrailingComponent, updateBackground, updateClearButton
-
Methods inherited from class javax.swing.plaf.basic.BasicTextFieldUI
getBaseline, getBaselineResizeBehavior
-
Methods inherited from class javax.swing.plaf.basic.BasicTextUI
create, createHighlighter, createKeymap, damageRange, damageRange, getComponent, getEditorKit, getKeymapName, getMaximumSize, getNextVisualPositionFrom, getRootView, getToolTipText, modelChanged, modelToView, modelToView, modelToView2D, paint, setView, uninstallKeyboardActions, update, viewToModel, viewToModel, viewToModel2D
-
-
-
-
Field Detail
-
KEY_REVEAL_SELECTED
private static final java.lang.String KEY_REVEAL_SELECTED
- See Also:
- Constant Field Values
-
echoChar
private java.lang.Character echoChar
-
showCapsLock
protected boolean showCapsLock
-
showRevealButton
protected boolean showRevealButton
- Since:
- 2
-
capsLockIcon
protected javax.swing.Icon capsLockIcon
-
revealIcon
protected javax.swing.Icon revealIcon
- Since:
- 2
-
capsLockListener
private java.awt.event.KeyListener capsLockListener
-
capsLockIconShared
private boolean capsLockIconShared
-
revealButton
private javax.swing.JToggleButton revealButton
-
uninstallEchoChar
private boolean uninstallEchoChar
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
-
getPropertyPrefix
protected java.lang.String getPropertyPrefix()
- Overrides:
getPropertyPrefixin classjavax.swing.plaf.basic.BasicTextFieldUI
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUIin classFlatTextFieldUI
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUIin classFlatTextFieldUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaultsin classFlatTextFieldUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaultsin classFlatTextFieldUI
-
installListeners
protected void installListeners()
- Overrides:
installListenersin classFlatTextFieldUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListenersin classFlatTextFieldUI
-
installKeyboardActions
protected void installKeyboardActions()
- Overrides:
installKeyboardActionsin classjavax.swing.plaf.basic.BasicTextUI
-
getStyleType
java.lang.String getStyleType()
- Overrides:
getStyleTypein classFlatTextFieldUI- Since:
- 2
-
applyStyle
protected void applyStyle(java.lang.Object style)
- Overrides:
applyStylein classFlatTextFieldUI
-
applyStyleProperty
protected java.lang.Object applyStyleProperty(java.lang.String key, java.lang.Object value)- Overrides:
applyStylePropertyin classFlatTextFieldUI- Since:
- 2
-
getStyleableInfos
public java.util.Map<java.lang.String,java.lang.Class<?>> getStyleableInfos(javax.swing.JComponent c)
- Specified by:
getStyleableInfosin interfaceFlatStylingSupport.StyleableUI- Overrides:
getStyleableInfosin classFlatTextFieldUI- Since:
- 2
-
getStyleableValue
public java.lang.Object getStyleableValue(javax.swing.JComponent c, java.lang.String key)- Specified by:
getStyleableValuein interfaceFlatStylingSupport.StyleableUI- Overrides:
getStyleableValuein classFlatTextFieldUI
-
create
public javax.swing.text.View create(javax.swing.text.Element elem)
- Specified by:
createin interfacejavax.swing.text.ViewFactory- Overrides:
createin classjavax.swing.plaf.basic.BasicTextFieldUI
-
paintIcons
protected void paintIcons(java.awt.Graphics g, java.awt.Rectangle r)Description copied from class:FlatTextFieldUIPaints the leading and trailing icons in the given rectangle. The rectangle is updated by this method so that subclasses can use it without painting over leading or trailing icons.- Overrides:
paintIconsin classFlatTextFieldUI- Since:
- 2
-
paintCapsLock
protected void paintCapsLock(java.awt.Graphics g, java.awt.Rectangle r)- Since:
- 2
-
hasTrailingIcon
protected boolean hasTrailingIcon()
- Overrides:
hasTrailingIconin classFlatTextFieldUI- Since:
- 2
-
getTrailingIconWidth
protected int getTrailingIconWidth()
- Overrides:
getTrailingIconWidthin classFlatTextFieldUI- Since:
- 2
-
isCapsLockVisible
protected boolean isCapsLockVisible()
- Since:
- 1.4
-
installRevealButton
protected void installRevealButton()
- Since:
- 2
-
createRevealButton
protected javax.swing.JToggleButton createRevealButton()
- Since:
- 2
-
updateRevealButton
protected void updateRevealButton()
- Since:
- 2.5
-
propertyChange
protected void propertyChange(java.beans.PropertyChangeEvent e)
- Overrides:
propertyChangein classFlatTextFieldUI
-
updateEchoChar
private void updateEchoChar(boolean selected)
-
uninstallRevealButton
protected void uninstallRevealButton()
- Since:
- 2
-
getTrailingComponents
protected javax.swing.JComponent[] getTrailingComponents()
Description copied from class:FlatTextFieldUIReturns components placed at the trailing side of the text field. The returned array may containnull. The default implementation returnsFlatTextFieldUI.trailingComponentandFlatTextFieldUI.clearButton.Note: The components in the array must be in reverse (visual) order.
- Overrides:
getTrailingComponentsin classFlatTextFieldUI
-
-