Package org.jdesktop.swingx.plaf.basic
Class BasicMonthViewUI.KeyboardAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.jdesktop.swingx.plaf.basic.BasicMonthViewUI.KeyboardAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action
- Enclosing class:
- BasicMonthViewUI
private class BasicMonthViewUI.KeyboardAction extends javax.swing.AbstractActionClass that supports keyboard traversal of the JXMonthView component.
-
-
Field Summary
Fields Modifier and Type Field Description static intACCEPT_SELECTIONprivate intactionstatic intADJUST_SELECTION_NEXT_DAYstatic intADJUST_SELECTION_NEXT_WEEKstatic intADJUST_SELECTION_PREVIOUS_DAYstatic intADJUST_SELECTION_PREVIOUS_WEEKstatic intCANCEL_SELECTIONstatic intSELECT_DAY_NEXT_WEEKstatic intSELECT_DAY_PREVIOUS_WEEKstatic intSELECT_NEXT_DAYstatic intSELECT_PREVIOUS_DAY
-
Constructor Summary
Constructors Constructor Description KeyboardAction(int action)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent ev)private voidaddToSelection(int action)If we are in a mode that allows for range selection this method will extend the currently selected range.private booleanisIntervalMode()private java.util.DatenextDay(java.util.Calendar cal, java.util.Date date)private java.util.DatenextWeek(java.util.Calendar cal, java.util.Date date)private java.util.DatepreviousDay(java.util.Calendar cal, java.util.Date date)private java.util.DatepreviousWeek(java.util.Calendar cal, java.util.Date date)private voidtraverse(int action)-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
ACCEPT_SELECTION
public static final int ACCEPT_SELECTION
- See Also:
- Constant Field Values
-
CANCEL_SELECTION
public static final int CANCEL_SELECTION
- See Also:
- Constant Field Values
-
SELECT_PREVIOUS_DAY
public static final int SELECT_PREVIOUS_DAY
- See Also:
- Constant Field Values
-
SELECT_NEXT_DAY
public static final int SELECT_NEXT_DAY
- See Also:
- Constant Field Values
-
SELECT_DAY_PREVIOUS_WEEK
public static final int SELECT_DAY_PREVIOUS_WEEK
- See Also:
- Constant Field Values
-
SELECT_DAY_NEXT_WEEK
public static final int SELECT_DAY_NEXT_WEEK
- See Also:
- Constant Field Values
-
ADJUST_SELECTION_PREVIOUS_DAY
public static final int ADJUST_SELECTION_PREVIOUS_DAY
- See Also:
- Constant Field Values
-
ADJUST_SELECTION_NEXT_DAY
public static final int ADJUST_SELECTION_NEXT_DAY
- See Also:
- Constant Field Values
-
ADJUST_SELECTION_PREVIOUS_WEEK
public static final int ADJUST_SELECTION_PREVIOUS_WEEK
- See Also:
- Constant Field Values
-
ADJUST_SELECTION_NEXT_WEEK
public static final int ADJUST_SELECTION_NEXT_WEEK
- See Also:
- Constant Field Values
-
action
private int action
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ev)
-
isIntervalMode
private boolean isIntervalMode()
- Returns:
-
traverse
private void traverse(int action)
-
addToSelection
private void addToSelection(int action)
If we are in a mode that allows for range selection this method will extend the currently selected range. NOTE: This may not be the expected behavior for the keyboard controls and we ay need to update this code to act in a way that people expect.- Parameters:
action- action for adjusting selection
-
nextWeek
private java.util.Date nextWeek(java.util.Calendar cal, java.util.Date date)- Parameters:
cal-date-- Returns:
-
previousWeek
private java.util.Date previousWeek(java.util.Calendar cal, java.util.Date date)- Parameters:
cal-date-- Returns:
-
nextDay
private java.util.Date nextDay(java.util.Calendar cal, java.util.Date date)- Parameters:
cal-date-- Returns:
-
previousDay
private java.util.Date previousDay(java.util.Calendar cal, java.util.Date date)- Parameters:
cal-date-- Returns:
-
-