/** * Sets the editor value to the model's selectedDate. */ private void updateEditorValue() { datePicker.getEditor().setValue(datePicker.getMonthView().getSelectionDate()); }
/** * Sets the editor value to the model's selectedDate. */ private void updateEditorValue() { datePicker.getEditor().setValue(datePicker.getMonthView().getSelectionDate()); }
/** * Sets the editor value to the model's selectedDate. */ private void updateEditorValue() { datePicker.getEditor().setValue(datePicker.getMonthView().getSelectionDate()); }
/** * Sets the editor value to the model's selectedDate. */ private void updateEditorValue() { datePicker.getEditor().setValue(datePicker.getMonthView().getSelectionDate()); }
/** * Sets the editor value to the model's selectedDate. */ private void updateEditorValue() { datePicker.getEditor().setValue(datePicker.getMonthView().getSelectionDate()); }
@Override @NbBundle.Messages({ "LBL_ChooseDate=Choose Date" }) public boolean openDaySelector () { JXMonthView monthView = datePicker.getMonthView(); JPanel panel = new JPanel(new BorderLayout()); panel.add(monthView); NotifyDescriptor nd = new NotifyDescriptor( panel, Bundle.LBL_ChooseDate(), NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.PLAIN_MESSAGE, null, NotifyDescriptor.OK_OPTION); if (DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.OK_OPTION) { setDate(monthView.getSelectionDate()); return true; } else { return false; } } }
@Override public void actionPerformed(ActionEvent e) { popupMenu.setVisible(false); Date date = monthView.getSelectionDate(); if (date != null) { formattedTextField.setValue(LocalDate.fromDateFields(date)); } else { formattedTextField.setValue(null); } } });
@Override public void actionPerformed(ActionEvent e) { popupMenu.setVisible(false); Date date = monthView.getSelectionDate(); if (date != null) { LocalDateTime oldValue = (LocalDateTime) formattedTextField.getValue(); if (oldValue == null) { oldValue = new LocalDateTime(); } Calendar c = Calendar.getInstance(); c.setTime(date); LocalDateTime newValue = oldValue.withDate(c.get(Calendar.YEAR), c.get(Calendar.MONTH) + 1, c.get(Calendar.DAY_OF_MONTH)); newValue = newValue.withTime(0, 0, 0, 0); formattedTextField.setValue(newValue); formattedTextField.firePropertyChange("calendar", false, true); } else { formattedTextField.setValue(null); } } });
/** * Updates date related properties in picker/monthView * after a change in the editor's value. Reverts the * value if the new date is unselectable. * * @param oldDate the editor value before the change * @param newDate the editor value after the change */ protected void updateFromValueChanged(Date oldDate, Date newDate) { if ((newDate != null) && datePicker.getMonthView().isUnselectableDate(newDate)) { revertValue(oldDate); return; } // the other place to interrupt the update spiral if (!CalendarUtils.areEqual(newDate, datePicker.getMonthView().getSelectionDate())) { datePicker.getMonthView().setSelectionDate(newDate); } datePicker.setDate(newDate); }
/** * Updates date related properties in picker/monthView * after a change in the editor's value. Reverts the * value if the new date is unselectable. * * @param oldDate the editor value before the change * @param newDate the editor value after the change */ protected void updateFromValueChanged(Date oldDate, Date newDate) { if ((newDate != null) && datePicker.getMonthView().isUnselectableDate(newDate)) { revertValue(oldDate); return; } // the other place to interrupt the update spiral if (!CalendarUtils.areEqual(newDate, datePicker.getMonthView().getSelectionDate())) { datePicker.getMonthView().setSelectionDate(newDate); } datePicker.setDate(newDate); }
/** * Updates date related properties in picker/monthView * after a change in the editor's value. Reverts the * value if the new date is unselectable. * * @param oldDate the editor value before the change * @param newDate the editor value after the change */ protected void updateFromValueChanged(Date oldDate, Date newDate) { if ((newDate != null) && datePicker.getMonthView().isUnselectableDate(newDate)) { revertValue(oldDate); return; } // the other place to interrupt the update spiral if (!CalendarUtils.areEqual(newDate, datePicker.getMonthView().getSelectionDate())) { datePicker.getMonthView().setSelectionDate(newDate); } datePicker.setDate(newDate); }
/** * Updates date related properties in picker/monthView * after a change in the editor's value. Reverts the * value if the new date is unselectable. * * @param oldDate the editor value before the change * @param newDate the editor value after the change */ protected void updateFromValueChanged(Date oldDate, Date newDate) { if ((newDate != null) && datePicker.getMonthView().isUnselectableDate(newDate)) { revertValue(oldDate); return; } // the other place to interrupt the update spiral if (!CalendarUtils.areEqual(newDate, datePicker.getMonthView().getSelectionDate())) { datePicker.getMonthView().setSelectionDate(newDate); } datePicker.setDate(newDate); }
/** * Updates date related properties in picker/monthView * after a change in the editor's value. Reverts the * value if the new date is unselectable. * * @param oldDate the editor value before the change * @param newDate the editor value after the change */ protected void updateFromValueChanged(Date oldDate, Date newDate) { if ((newDate != null) && datePicker.getMonthView().isUnselectableDate(newDate)) { revertValue(oldDate); return; } // the other place to interrupt the update spiral if (!CalendarUtils.areEqual(newDate, datePicker.getMonthView().getSelectionDate())) { datePicker.getMonthView().setSelectionDate(newDate); } datePicker.setDate(newDate); }