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
,ViewFactory
public class FlatPasswordFieldUI extends FlatTextFieldUI
Provides the Flat LaF UI delegate forJPasswordField
.- UiDefault:
- PasswordField.font Font, PasswordField.background Color, PasswordField.foreground Color also used if not editable, PasswordField.caretForeground Color, PasswordField.selectionBackground Color, PasswordField.selectionForeground Color, PasswordField.disabledBackground Color used if not enabled, PasswordField.inactiveBackground Color used if not editable, PasswordField.inactiveForeground Color used if not enabled (yes, this is confusing; this should be named disabledForeground), PasswordField.border Border, PasswordField.margin Insets, PasswordField.caretBlinkRate int default is 500 milliseconds , Component.minimumWidth int, Component.isIntelliJTheme boolean, PasswordField.placeholderForeground Color, PasswordField.focusedBackground Color optional, PasswordField.iconTextGap int optional, default is 4, TextComponent.selectAllOnFocusPolicy String never, once (default) or always, TextComponent.selectAllOnMouseClick boolean , PasswordField.echoChar character, PasswordField.showCapsLock boolean, PasswordField.showRevealButton boolean, PasswordField.capsLockIcon Icon, PasswordField.revealIcon Icon
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTextUI
BasicTextUI.BasicCaret, BasicTextUI.BasicHighlighter
-
-
Field Summary
Fields Modifier and Type Field Description protected Icon
capsLockIcon
protected Icon
revealIcon
protected boolean
showCapsLock
protected boolean
showRevealButton
-
Fields inherited from class com.formdev.flatlaf.ui.FlatTextFieldUI
clearButton, disabledBackground, focusedBackground, iconTextGap, inactiveBackground, isIntelliJTheme, leadingComponent, leadingIcon, minimumWidth, placeholderForeground, showClearButton, trailingComponent, trailingIcon
-
-
Constructor Summary
Constructors Constructor Description FlatPasswordFieldUI()
-
Method Summary
-
Methods inherited from class com.formdev.flatlaf.ui.FlatTextFieldUI
clearButtonClicked, createCaret, createClearButton, documentChanged, getIconsRect, getLeadingComponents, getLeadingIconWidth, getMinimumSize, getPadding, getPreferredSize, getVisibleEditorRect, hasLeadingIcon, installClearButton, installDocumentListener, installLayout, installLeadingComponent, installStyle, installTrailingComponent, paintBackground, paintPlaceholder, paintSafely, prepareLeadingOrTrailingComponent, scrollCaretToVisible, uninstallClearButton, uninstallLeadingComponent, uninstallTrailingComponent, 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
-
Methods inherited from class javax.swing.plaf.TextUI
getToolTipText2D
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
-
-
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
getPropertyPrefix
protected String getPropertyPrefix()
- Overrides:
getPropertyPrefix
in classBasicTextFieldUI
-
installUI
public void installUI(JComponent c)
- Overrides:
installUI
in classFlatTextFieldUI
-
uninstallUI
public void uninstallUI(JComponent c)
- Overrides:
uninstallUI
in classFlatTextFieldUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classFlatTextFieldUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in classFlatTextFieldUI
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classFlatTextFieldUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classFlatTextFieldUI
-
installKeyboardActions
protected void installKeyboardActions()
- Overrides:
installKeyboardActions
in classBasicTextUI
-
applyStyle
protected void applyStyle(Object style)
- Overrides:
applyStyle
in classFlatTextFieldUI
-
applyStyleProperty
protected Object applyStyleProperty(String key, Object value)
- Overrides:
applyStyleProperty
in classFlatTextFieldUI
- Since:
- 2
-
getStyleableInfos
public Map<String,Class<?>> getStyleableInfos(JComponent c)
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableUI
- Overrides:
getStyleableInfos
in classFlatTextFieldUI
- Since:
- 2
-
getStyleableValue
public Object getStyleableValue(JComponent c, String key)
- Specified by:
getStyleableValue
in interfaceFlatStylingSupport.StyleableUI
- Overrides:
getStyleableValue
in classFlatTextFieldUI
-
create
public View create(Element elem)
- Specified by:
create
in interfaceViewFactory
- Overrides:
create
in classBasicTextFieldUI
-
paintIcons
protected void paintIcons(Graphics g, Rectangle r)
Description copied from class:FlatTextFieldUI
Paints 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:
paintIcons
in classFlatTextFieldUI
- Since:
- 2
-
hasTrailingIcon
protected boolean hasTrailingIcon()
- Overrides:
hasTrailingIcon
in classFlatTextFieldUI
- Since:
- 2
-
getTrailingIconWidth
protected int getTrailingIconWidth()
- Overrides:
getTrailingIconWidth
in classFlatTextFieldUI
- Since:
- 2
-
isCapsLockVisible
protected boolean isCapsLockVisible()
- Since:
- 1.4
-
installRevealButton
protected void installRevealButton()
- Since:
- 2
-
createRevealButton
protected JToggleButton createRevealButton()
- Since:
- 2
-
updateRevealButton
protected void updateRevealButton()
- Since:
- 2.5
-
propertyChange
protected void propertyChange(PropertyChangeEvent e)
- Overrides:
propertyChange
in classFlatTextFieldUI
-
uninstallRevealButton
protected void uninstallRevealButton()
- Since:
- 2
-
getTrailingComponents
protected JComponent[] getTrailingComponents()
Description copied from class:FlatTextFieldUI
Returns components placed at the trailing side of the text field. The returned array may containnull
. The default implementation returnsFlatTextFieldUI.trailingComponent
andFlatTextFieldUI.clearButton
.Note: The components in the array must be in reverse (visual) order.
- Overrides:
getTrailingComponents
in classFlatTextFieldUI
-
-