public class BuddyTextFieldUI extends PromptTextFieldUI
TODO: queries the text components layout manager for the preferred size.
PromptTextUI.PainterHighlighter
Modifier and Type | Field and Description |
---|---|
protected BuddyLayoutAndBorder |
layoutAndBorder |
delegate, promptComponent
Constructor and Description |
---|
BuddyTextFieldUI(TextUI delegate)
Creates a new
BuddyTextFieldUI which delegates most work to
another TextUI . |
Modifier and Type | Method and Description |
---|---|
protected BuddyLayoutAndBorder |
createBuddyLayoutAndBorder() |
Dimension |
getPreferredSize(JComponent c)
TODO: comment
|
void |
installUI(JComponent c)
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. |
void |
paint(Graphics g,
JComponent c)
Delegates painting when
PromptTextUI.shouldPaintPrompt(JTextComponent)
returns false. |
void |
uninstallUI(JComponent c)
Delegates, then uninstalls the focus listener.
|
createPromptComponent, getPromptComponent
contains, damageRange, damageRange, equals, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getEditorKit, getMaximumSize, getMinimumSize, getNextVisualPositionFrom, getRootView, getToolTipText, hashCode, modelToView, modelToView, paintPromptComponent, shouldPaintPrompt, toString, update, viewToModel, viewToModel
createUI, getBaselineResizeBehavior
protected BuddyLayoutAndBorder layoutAndBorder
public BuddyTextFieldUI(TextUI delegate)
BuddyTextFieldUI
which delegates most work to
another TextUI
.delegate
- public void paint(Graphics g, JComponent c)
PromptTextUI
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.paint
in class PromptTextUI
public void installUI(JComponent c)
PromptTextUI
c
which repaints the component when it gains or
loses the focus.installUI
in class PromptTextUI
protected BuddyLayoutAndBorder createBuddyLayoutAndBorder()
public void uninstallUI(JComponent c)
PromptTextUI
uninstallUI
in class PromptTextUI
public Dimension getPreferredSize(JComponent c)
getPreferredSize
in class PromptTextUI
ComponentUI.getPreferredSize(javax.swing.JComponent)
Copyright © 2017. All rights reserved.