Package com.github.weisj.darklaf.ui.text
Class DarkTextFieldUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.TextUI
-
- javax.swing.plaf.basic.BasicTextUI
-
- com.github.weisj.darklaf.ui.text.DarkTextUI
-
- com.github.weisj.darklaf.ui.text.bridge.DarkTextFieldUIBridge
-
- com.github.weisj.darklaf.ui.text.DarkTextFieldUI
-
- All Implemented Interfaces:
MouseClickListener
,OpacityBufferedUI
,FocusListener
,MouseListener
,PropertyChangeListener
,EventListener
,ViewFactory
- Direct Known Subclasses:
DarkFormattedTextFieldUI
,DarkPasswordFieldUIBridge
public class DarkTextFieldUI extends DarkTextFieldUIBridge implements PropertyChangeListener, MouseClickListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DarkTextFieldUI.ClickAction
-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTextUI
BasicTextUI.BasicCaret, BasicTextUI.BasicHighlighter
-
-
Field Summary
Fields Modifier and Type Field Description protected int
arcSize
protected Color
background
protected Icon
clear
protected Icon
clearHover
protected Color
inactiveBackground
static String
KEY_FIND_POPUP
protected static String
KEY_PREFIX
static String
KEY_SHOW_CLEAR
static String
KEY_VARIANT
protected Insets
padding
protected Icon
search
protected int
searchArcSize
protected Icon
searchDisabled
protected Icon
searchWithHistory
protected Icon
searchWithHistoryDisabled
static String
VARIANT_SEARCH
-
Fields inherited from class com.github.weisj.darklaf.ui.text.DarkTextUI
darkCaret, defaultTextRenderer, disabledColor, editor, inactiveColor, KEY_DEFAULT_TEXT, KEY_EXTEND_LINE_SELECTION, KEY_HAS_ERROR, KEY_HAS_WARNING, KEY_IS_LIST_EDITOR, KEY_IS_TABLE_EDITOR, KEY_IS_TREE_EDITOR, KEY_ROUNDED_SELECTION, TOGGLE_INSERT, uninstalling
-
-
Constructor Summary
Constructors Constructor Description DarkTextFieldUI()
-
Method Summary
-
Methods inherited from class com.github.weisj.darklaf.ui.text.bridge.DarkTextFieldUIBridge
create, getBaseline, getBaselineResizeBehavior, getPropertyPrefix
-
Methods inherited from class com.github.weisj.darklaf.ui.text.DarkTextUI
createCaret, createDarkCaret, createDefaultTextRenderer, createHighlighter, createKeymap, createPopupMenu, focusGained, focusLost, getBackground, getBorder, getBorderInsets, getCaretWidth, getDarkCaret, getDefaultInsertCaretStyle, getDefaultText, getDefaultTextRenderer, getDrawingRect, getRelevantParent, installBorder, installDarkKeyBoardActions, installPopupMenu, installUI, isBorderlessTextField, isEmpty, isInCell, paintBackground, paintBorderBackground, paintDefaultText, uninstallBorder, uninstallDefaults, uninstallPopupMenu, update, updateUI
-
Methods inherited from class javax.swing.plaf.basic.BasicTextUI
create, damageRange, damageRange, getComponent, getEditorKit, getKeymapName, getMaximumSize, getNextVisualPositionFrom, getRootView, getToolTipText, installKeyboardActions, modelChanged, modelToView, modelToView, modelToView2D, paint, setView, uninstallKeyboardActions, uninstallUI, viewToModel, viewToModel, viewToModel2D
-
Methods inherited from class javax.swing.plaf.TextUI
getToolTipText2D
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.weisj.darklaf.listener.MouseClickListener
mouseEntered, mouseExited, mousePressed, mouseReleased
-
-
-
-
Field Detail
-
KEY_PREFIX
protected static final String KEY_PREFIX
- See Also:
- Constant Field Values
-
KEY_VARIANT
public static final String KEY_VARIANT
- See Also:
- Constant Field Values
-
KEY_SHOW_CLEAR
public static final String KEY_SHOW_CLEAR
- See Also:
- Constant Field Values
-
KEY_FIND_POPUP
public static final String KEY_FIND_POPUP
- See Also:
- Constant Field Values
-
VARIANT_SEARCH
public static final String VARIANT_SEARCH
- See Also:
- Constant Field Values
-
clear
protected Icon clear
-
clearHover
protected Icon clearHover
-
search
protected Icon search
-
searchDisabled
protected Icon searchDisabled
-
searchWithHistory
protected Icon searchWithHistory
-
searchWithHistoryDisabled
protected Icon searchWithHistoryDisabled
-
arcSize
protected int arcSize
-
searchArcSize
protected int searchArcSize
-
background
protected Color background
-
inactiveBackground
protected Color inactiveBackground
-
padding
protected Insets padding
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
getRightIcon
protected Icon getRightIcon(JTextComponent c)
-
getClearIcon
protected Icon getClearIcon(boolean clearHovered)
-
getLeftIcon
protected Icon getLeftIcon(JTextComponent c)
-
getSearchIcon
protected Icon getSearchIcon(JTextComponent c)
-
getPreferredSize
public Dimension getPreferredSize(JComponent c)
- Overrides:
getPreferredSize
in classDarkTextUI
-
getMinimumSize
public Dimension getMinimumSize(JComponent c)
- Overrides:
getMinimumSize
in classBasicTextUI
-
getVisibleEditorRect
protected Rectangle getVisibleEditorRect()
- Overrides:
getVisibleEditorRect
in classBasicTextUI
-
getVisibleEditorRect
protected Rectangle getVisibleEditorRect(boolean shrinkHeight)
-
adjustTextRect
protected void adjustTextRect(JTextComponent c, Rectangle r)
-
updateCursor
protected void updateCursor(Point p)
-
getActionUnder
protected DarkTextFieldUI.ClickAction getActionUnder(Point p)
-
isSearchFieldWithHistoryPopup
public static boolean isSearchFieldWithHistoryPopup(JTextComponent c)
-
isSearchField
public static boolean isSearchField(Component c)
-
showClearIcon
public static boolean showClearIcon(JComponent c)
-
paintSafely
protected void paintSafely(Graphics g)
- Overrides:
paintSafely
in classDarkTextUI
-
paintIcons
protected void paintIcons(Graphics g)
-
doPaintLeftIcon
protected boolean doPaintLeftIcon(JTextComponent c)
-
doPaintRightIcon
protected boolean doPaintRightIcon(JTextComponent c)
-
paintRightIcon
protected void paintRightIcon(Graphics g)
-
paintLeftIcon
protected void paintLeftIcon(Graphics g)
-
getLeftIconCoord
protected Point getLeftIconCoord()
-
getRightIconCoord
protected Point getRightIconCoord()
-
showSearchPopup
protected void showSearchPopup()
-
getDefaultCaretStyle
protected DarkCaret.CaretStyle getDefaultCaretStyle()
- Specified by:
getDefaultCaretStyle
in classDarkTextUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classDarkTextUI
-
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classDarkTextUI
-
layoutChanged
protected void layoutChanged()
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classDarkTextUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classDarkTextUI
-
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClicked
in interfaceMouseClickListener
- Specified by:
mouseClicked
in interfaceMouseListener
-
leftActionClicked
protected void leftActionClicked()
-
rightActionClicked
protected void rightActionClicked()
-
-