本文整理汇总了Java中javafx.scene.control.DatePicker.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java DatePicker.getValue方法的具体用法?Java DatePicker.getValue怎么用?Java DatePicker.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.DatePicker
的用法示例。
在下文中一共展示了DatePicker.getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: focusGained
import javafx.scene.control.DatePicker; //导入方法依赖的package包/类
@Override public void focusGained(RFXComponent prev) {
DatePicker datePicker = (DatePicker) node;
LocalDate value = datePicker.getValue();
if (value == null && datePicker.isEditable()) {
prevDate = datePicker.getEditor().getText();
} else {
prevDate = getDatePickerText(datePicker, value);
}
}
示例2: focusLost
import javafx.scene.control.DatePicker; //导入方法依赖的package包/类
@Override public void focusLost(RFXComponent next) {
DatePicker datePicker = (DatePicker) node;
LocalDate value = datePicker.getValue();
String currentDate;
if (value == null && datePicker.isEditable()) {
currentDate = datePicker.getEditor().getText();
} else {
currentDate = getDatePickerText(datePicker, value);
}
if (!currentDate.equals(prevDate))
recorder.recordSelect(this, currentDate);
}
示例3: updateDatePicker
import javafx.scene.control.DatePicker; //导入方法依赖的package包/类
private void updateDatePicker(DatePicker datePicker, LocalDateTime newValue) {
if (newValue == null) {
if (datePicker.getValue() != null)
datePicker.setValue(null);
return;
}
LocalDate current = datePicker.getValue();
if (current != null && current.equals(newValue.toLocalDate()))
return;
datePicker.setValue(newValue.toLocalDate());
}
示例4: datePicker
import javafx.scene.control.DatePicker; //导入方法依赖的package包/类
public static void datePicker(DatePicker campo) throws Erro{
if(campo.getValue() == null){
Janela.showTooltip(Status.ADVERTENCIA, idioma.getMensagem("campo_nao_informado"), campo, Duracao.CURTA);
campo.requestFocus();
throw new Erro();
}
}
示例5: getDate
import javafx.scene.control.DatePicker; //导入方法依赖的package包/类
private Optional<ZonedDateTime> getDate(DatePicker datePicker) {
return datePicker.getValue() != null
? Optional.of(ZonedDateTime.of(datePicker.getValue().atTime(0, 0), ZoneId.of("UTC")))
: Optional.empty();
}