Class DateSpinner
- java.lang.Object
-
- docking.widgets.table.constrainteditor.DateSpinner
-
public class DateSpinner extends java.lang.Object
Creates a component for editing Dates using a formated textfield and a Jspinner.
-
-
Constructor Summary
Constructors Constructor Description DateSpinner(LocalDateSpinnerModel spinnerModel, java.lang.String pattern)
Creates a DateSpinner object using the given spinnerModel and a pattern for a formated text field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a ChangeListener to the model's listener list.protected void
fireStateChanged()
Run each ChangeListeners stateChanged() method.LocalDateTextField
getDateField()
Returns the DateTextField component.javax.swing.JSpinner
getSpinner()
Returns the spinner component.void
removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a ChangeListener from the model's listener list.void
setValue(java.time.LocalDate newValue)
Sets the Date value for this DateSpinner.
-
-
-
Constructor Detail
-
DateSpinner
public DateSpinner(LocalDateSpinnerModel spinnerModel, java.lang.String pattern)
Creates a DateSpinner object using the given spinnerModel and a pattern for a formated text field.- Parameters:
spinnerModel
- the spinner modelpattern
- a pattern to be used by a JFormattedTextField
-
-
Method Detail
-
getSpinner
public javax.swing.JSpinner getSpinner()
Returns the spinner component.- Returns:
- the spinner component.
-
getDateField
public LocalDateTextField getDateField()
Returns the DateTextField component.- Returns:
- the DateTextField component.
-
setValue
public void setValue(java.time.LocalDate newValue)
Sets the Date value for this DateSpinner.- Parameters:
newValue
- the new Date for this DateSpinner.
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener listener)
Adds a ChangeListener to the model's listener list. The ChangeListeners must be notified when the models value changes.- Parameters:
listener
- the ChangeListener to add- See Also:
removeChangeListener(javax.swing.event.ChangeListener)
,SpinnerModel.addChangeListener(javax.swing.event.ChangeListener)
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a ChangeListener from the model's listener list.- Parameters:
listener
- the ChangeListener to remove- See Also:
addChangeListener(javax.swing.event.ChangeListener)
,SpinnerModel.removeChangeListener(javax.swing.event.ChangeListener)
-
fireStateChanged
protected void fireStateChanged()
Run each ChangeListeners stateChanged() method.- See Also:
setValue(java.time.LocalDate)
,EventListenerList
-
-