modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/DatePickerBehavior.java
Print this page
rev 9038 : RT-34620: [ComboBox, DatePicker] Buttons set to default/cancel are not reacting to ComboBox enter/esc keys
*** 55,101 ****
* *
* Key event handling *
* *
**************************************************************************/
- /**
- * Opens the Date Picker Popup
- */
- protected static final String OPEN_ACTION = "Open";
-
- /**
- * Closes the Date Picker Popup
- */
- protected static final String CLOSE_ACTION = "Close";
-
-
protected static final List<KeyBinding> DATE_PICKER_BINDINGS = new ArrayList<KeyBinding>();
static {
! DATE_PICKER_BINDINGS.add(new KeyBinding(F4, KEY_RELEASED, "togglePopup"));
! DATE_PICKER_BINDINGS.add(new KeyBinding(UP, "togglePopup").alt());
! DATE_PICKER_BINDINGS.add(new KeyBinding(DOWN, "togglePopup").alt());
! }
!
! @Override protected void callAction(String name) {
! switch (name) {
! case OPEN_ACTION:
! show(); break;
!
! case CLOSE_ACTION:
! hide(); break;
!
! case "togglePopup":
! if (getControl().isShowing()) {
! hide();
! } else {
! show();
! }
! break;
!
! default:
! super.callAction(name);
! }
}
@Override public void onAutoHide() {
// when we click on some non-interactive part of the
// calendar - we do not want to hide.
--- 55,67 ----
* *
* Key event handling *
* *
**************************************************************************/
protected static final List<KeyBinding> DATE_PICKER_BINDINGS = new ArrayList<KeyBinding>();
static {
! DATE_PICKER_BINDINGS.addAll(COMBO_BOX_BASE_BINDINGS);
}
@Override public void onAutoHide() {
// when we click on some non-interactive part of the
// calendar - we do not want to hide.