Package org.jdesktop.swingx.plaf
Class BuddyTextFieldUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.TextUI
-
- org.jdesktop.swingx.plaf.PromptTextUI
-
- org.jdesktop.swingx.plaf.PromptTextFieldUI
-
- org.jdesktop.swingx.plaf.BuddyTextFieldUI
-
- Direct Known Subclasses:
SearchFieldUI
public class BuddyTextFieldUI extends PromptTextFieldUI
TODO: queries the text components layout manager for the preferred size.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jdesktop.swingx.plaf.PromptTextUI
PromptTextUI.PainterHighlighter
-
-
Field Summary
Fields Modifier and Type Field Description protected BuddyLayoutAndBorderlayoutAndBorderprivate static java.awt.InsetsMAC_MARGIN-
Fields inherited from class org.jdesktop.swingx.plaf.PromptTextUI
delegate, focusHandler, promptComponent
-
-
Constructor Summary
Constructors Constructor Description BuddyTextFieldUI(javax.swing.plaf.TextUI delegate)Creates a newBuddyTextFieldUIwhich delegates most work to anotherTextUI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BuddyLayoutAndBordercreateBuddyLayoutAndBorder()java.awt.DimensiongetPreferredSize(javax.swing.JComponent c)TODO: commentprivate booleanhasMacTextFieldBorder(javax.swing.JComponent c)voidinstallUI(javax.swing.JComponent c)Calls TextUI#installUI(JComponent) on the delegate and installs a focus listener oncwhich repaints the component when it gains or loses the focus.voidpaint(java.awt.Graphics g, javax.swing.JComponent c)Delegates painting whenPromptTextUI.shouldPaintPrompt(JTextComponent)returns false.voiduninstallUI(javax.swing.JComponent c)Delegates, then uninstalls the focus listener.-
Methods inherited from class org.jdesktop.swingx.plaf.PromptTextFieldUI
createPromptComponent, getPromptComponent
-
Methods inherited from class org.jdesktop.swingx.plaf.PromptTextUI
contains, damageRange, damageRange, equals, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getEditorKit, getMaximumSize, getMinimumSize, getNextVisualPositionFrom, getRootView, getToolTipText, hashCode, modelToView, modelToView, paintPromptComponent, shouldPaintPrompt, toString, update, viewToModel, viewToModel
-
-
-
-
Field Detail
-
layoutAndBorder
protected BuddyLayoutAndBorder layoutAndBorder
-
MAC_MARGIN
private static final java.awt.Insets MAC_MARGIN
-
-
Constructor Detail
-
BuddyTextFieldUI
public BuddyTextFieldUI(javax.swing.plaf.TextUI delegate)
Creates a newBuddyTextFieldUIwhich delegates most work to anotherTextUI.- Parameters:
delegate-
-
-
Method Detail
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)Description copied from class:PromptTextUIDelegates painting whenPromptTextUI.shouldPaintPrompt(JTextComponent)returns false. Otherwise the prompt component is retrieved by callingPromptTextUI.getPromptComponent(JTextComponent)and painted. Then the caret of the given text component is painted.- Overrides:
paintin classPromptTextUI
-
hasMacTextFieldBorder
private boolean hasMacTextFieldBorder(javax.swing.JComponent c)
-
installUI
public void installUI(javax.swing.JComponent c)
Description copied from class:PromptTextUICalls TextUI#installUI(JComponent) on the delegate and installs a focus listener oncwhich repaints the component when it gains or loses the focus.- Overrides:
installUIin classPromptTextUI
-
createBuddyLayoutAndBorder
protected BuddyLayoutAndBorder createBuddyLayoutAndBorder()
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
Description copied from class:PromptTextUIDelegates, then uninstalls the focus listener.- Overrides:
uninstallUIin classPromptTextUI
-
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
TODO: comment- Overrides:
getPreferredSizein classPromptTextUI- See Also:
ComponentUI.getPreferredSize(javax.swing.JComponent)
-
-