Package docking.widgets.textfield
Class LocalDateTextField
- java.lang.Object
-
- docking.widgets.textfield.LocalDateTextField
-
public class LocalDateTextField extends java.lang.ObjectText field for entering dates. Optionally, a minimum and maximum date value can be set on this text field.
-
-
Constructor Summary
Constructors Constructor Description LocalDateTextField(java.lang.String dateFormatPattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionListener(java.awt.event.ActionListener listener)voidaddChangeListener(javax.swing.event.ChangeListener listener)Adds a change listener that will be notified whenever the value changes.javax.swing.JComponentgetComponent()java.time.LocalDategetMaximum()java.time.LocalDategetMinimum()javax.swing.JTextFieldgetTextField()java.time.LocalDategetValue()booleanisShowingFieldMode()voidremoveActionListener(java.awt.event.ActionListener listener)voidremoveChangeListener(javax.swing.event.ChangeListener listener)Removes the changes listener.voidrequestFocus()voidselectAll()voidsetDayMode()Sets the mode to Day.voidsetEnabled(boolean enabled)voidsetMaximum(java.time.LocalDate maximum)Sets the maximum allowed date.voidsetMinimum(java.time.LocalDate minimum)Sets the minimum allowed date.voidsetMonthMode()Sets the mode to Month.voidsetShowFieldMode(boolean show)Turns on or off the faded text that indicates if the field is in month or day modevoidsetValue(java.time.LocalDate newDate)
-
-
-
Method Detail
-
setMinimum
public void setMinimum(java.time.LocalDate minimum)
Sets the minimum allowed date. Can be null.- Parameters:
minimum- the minimum allowed date.
-
setMaximum
public void setMaximum(java.time.LocalDate maximum)
Sets the maximum allowed date. Can be null.- Parameters:
maximum- the minimum allowed date.
-
setValue
public void setValue(java.time.LocalDate newDate)
-
getValue
public java.time.LocalDate getValue()
-
getMinimum
public java.time.LocalDate getMinimum()
-
getMaximum
public java.time.LocalDate getMaximum()
-
setShowFieldMode
public void setShowFieldMode(boolean show)
Turns on or off the faded text that indicates if the field is in month or day mode- Parameters:
show- true to show the mode.
-
isShowingFieldMode
public boolean isShowingFieldMode()
-
setMonthMode
public void setMonthMode()
Sets the mode to Month.
-
setDayMode
public void setDayMode()
Sets the mode to Day.
-
getTextField
public javax.swing.JTextField getTextField()
-
getComponent
public javax.swing.JComponent getComponent()
-
setEnabled
public void setEnabled(boolean enabled)
-
requestFocus
public void requestFocus()
-
selectAll
public void selectAll()
-
addActionListener
public void addActionListener(java.awt.event.ActionListener listener)
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener listener)
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener listener)
Adds a change listener that will be notified whenever the value changes.- Parameters:
listener- the change listener to add.
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener listener)
Removes the changes listener.- Parameters:
listener- the listener to be removed.
-
-