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.
| 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 |
layoutAndBorder
protected BuddyLayoutAndBorder layoutAndBorder
BuddyTextFieldUI
public BuddyTextFieldUI(TextUI delegate)
- Creates a new
BuddyTextFieldUI which delegates most work to
another TextUI.
- Parameters:
delegate -
paint
public void paint(Graphics g,
JComponent c)
- Description copied from class:
PromptTextUI
- Delegates painting when
PromptTextUI.shouldPaintPrompt(JTextComponent)
returns false. Otherwise the prompt component is retrieved by calling
PromptTextUI.getPromptComponent(JTextComponent) and painted. Then the caret
of the given text component is painted.
- Overrides:
paint in class PromptTextUI
- Parameters:
g - the Graphics context in which to paintc - the component being painted;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components- See Also:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
installUI
public void installUI(JComponent c)
- Description copied from class:
PromptTextUI
- Calls TextUI#installUI(JComponent) on the delegate and installs a focus
listener on
c which repaints the component when it gains
or loses the focus.
- Overrides:
installUI in class PromptTextUI
- Parameters:
c - the component where this UI delegate is being installed- See Also:
ComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()
createBuddyLayoutAndBorder
protected BuddyLayoutAndBorder createBuddyLayoutAndBorder()
uninstallUI
public void uninstallUI(JComponent c)
- Description copied from class:
PromptTextUI
- Delegates, then uninstalls the focus listener.
- Overrides:
uninstallUI in class PromptTextUI
- Parameters:
c - the component from which this UI delegate is being removed;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components- See Also:
ComponentUI.installUI(javax.swing.JComponent),
JComponent.updateUI()
getPreferredSize
public Dimension getPreferredSize(JComponent c)
- TODO: comment
- Overrides:
getPreferredSize in class PromptTextUI
- Parameters:
c - the component whose preferred size is being queried;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components- See Also:
ComponentUI.getPreferredSize(javax.swing.JComponent)