public class WebDateFieldUI extends DateFieldUI implements Styleable, ShapeProvider, MarginSupport, PaddingSupport, java.beans.PropertyChangeListener
| Modifier and Type | Class and Description |
|---|---|
protected static class |
WebDateFieldUI.UpdateSource
This enumeration represents the type of source that caused view update.
|
| Modifier and Type | Field and Description |
|---|---|
protected WebButton |
button |
protected WebCalendar |
calendar |
protected WebDateField |
dateField
Runtime variables.
|
protected WebFormattedTextField |
field
UI elements.
|
protected java.awt.Insets |
margin |
protected java.awt.Insets |
padding |
protected IDateFieldPainter |
painter
Component painter.
|
protected WebPopOver |
popup |
protected boolean |
updating |
EMPTYEMPTY| Constructor and Description |
|---|
WebDateFieldUI() |
| Modifier and Type | Method and Description |
|---|---|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
Returns an instance of the WebDateFieldUI for the specified component.
|
protected void |
customizeCalendar()
Performs calendar customizations.
|
protected java.util.Date |
getDate(java.lang.String text)
Returns date specified in text field.
|
java.awt.Insets |
getMargin()
Returns current margin.
|
java.awt.Insets |
getPadding()
Returns current padding.
|
Painter |
getPainter()
Returns date field painter.
|
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c) |
StyleId |
getStyleId()
Returns component style ID.
|
protected java.lang.String |
getText(java.util.Date date)
Returns text date representation according to date format.
|
protected void |
installActions()
Installs actions for UI elements.
|
protected void |
installComponents()
Installs date field UI elements.
|
void |
installUI(javax.swing.JComponent c)
Installs UI in the specified component.
|
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
Paints date field.
|
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
java.awt.Shape |
provideShape()
Returns component shape.
|
protected void |
setDate(java.util.Date date,
WebDateFieldUI.UpdateSource source)
Sets currently selected date and updates component depending on update source.
|
void |
setMargin(java.awt.Insets margin)
Sets new margin.
|
void |
setPadding(java.awt.Insets padding)
Sets new padding.
|
void |
setPainter(Painter painter)
Sets date field painter.
|
StyleId |
setStyleId(StyleId id)
Sets new component style ID.
|
protected void |
showDateChooserPopup()
Displays date chooser popup.
|
protected void |
uninstallActions()
Uninstalls actions for UI elements.
|
protected void |
uninstallComponents()
Uninstalls date field UI elements.
|
void |
uninstallUI(javax.swing.JComponent c)
Uninstalls UI from the specified component.
|
protected void |
updateEnabledState()
Updates sub-components enabled state
|
protected void |
updateExpectedFieldLength()
Updates expected text field length.
|
@DefaultPainter(value=DateFieldPainter.class) protected IDateFieldPainter painter
protected WebFormattedTextField field
protected WebButton button
protected WebPopOver popup
protected WebCalendar calendar
protected WebDateField dateField
protected java.awt.Insets margin
protected java.awt.Insets padding
protected boolean updating
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c - component that will use UI instancepublic void installUI(javax.swing.JComponent c)
installUI in class javax.swing.plaf.ComponentUIc - component for this UIpublic void uninstallUI(javax.swing.JComponent c)
uninstallUI in class javax.swing.plaf.ComponentUIc - component with this UIprotected void installComponents()
protected void uninstallComponents()
protected void installActions()
protected void uninstallActions()
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerprotected void updateEnabledState()
protected void updateExpectedFieldLength()
protected void showDateChooserPopup()
protected void customizeCalendar()
protected void setDate(java.util.Date date,
WebDateFieldUI.UpdateSource source)
date - new selected datesource - date update sourceprotected java.util.Date getDate(java.lang.String text)
text - text to retrieve date fromprotected java.lang.String getText(java.util.Date date)
date - date to retrieve text frompublic StyleId getStyleId()
StyleablegetStyleId in interface Styleablepublic StyleId setStyleId(StyleId id)
StyleablesetStyleId in interface Styleableid - custom component style IDpublic java.awt.Shape provideShape()
ShapeProviderprovideShape in interface ShapeProviderpublic java.awt.Insets getMargin()
MarginSupportgetMargin in interface MarginSupportpublic void setMargin(java.awt.Insets margin)
MarginSupportnull can be provided to set an empty [0,0,0,0] margin.setMargin in interface MarginSupportmargin - new marginpublic java.awt.Insets getPadding()
PaddingSupportgetPadding in interface PaddingSupportpublic void setPadding(java.awt.Insets padding)
PaddingSupportnull can be provided to set an empty [0,0,0,0] padding.setPadding in interface PaddingSupportpadding - new paddingpublic Painter getPainter()
public void setPainter(Painter painter)
painter - new date field painterpublic void paint(java.awt.Graphics g,
javax.swing.JComponent c)
paint in class javax.swing.plaf.ComponentUIg - graphicsc - componentpublic java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
getPreferredSize in class javax.swing.plaf.ComponentUI