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.AbstractAction
Class that supports keyboard traversal of the JXMonthView component.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACCEPT_SELECTION
private int
action
static int
ADJUST_SELECTION_NEXT_DAY
static int
ADJUST_SELECTION_NEXT_WEEK
static int
ADJUST_SELECTION_PREVIOUS_DAY
static int
ADJUST_SELECTION_PREVIOUS_WEEK
static int
CANCEL_SELECTION
static int
SELECT_DAY_NEXT_WEEK
static int
SELECT_DAY_PREVIOUS_WEEK
static int
SELECT_NEXT_DAY
static int
SELECT_PREVIOUS_DAY
-
Constructor Summary
Constructors Constructor Description KeyboardAction(int action)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent ev)
private void
addToSelection(int action)
If we are in a mode that allows for range selection this method will extend the currently selected range.private boolean
isIntervalMode()
private java.util.Date
nextDay(java.util.Calendar cal, java.util.Date date)
private java.util.Date
nextWeek(java.util.Calendar cal, java.util.Date date)
private java.util.Date
previousDay(java.util.Calendar cal, java.util.Date date)
private java.util.Date
previousWeek(java.util.Calendar cal, java.util.Date date)
private void
traverse(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:
-
-