Class LocalDateTimeDialog
java.lang.Object
com.amalgamasimulation.desktop.binding.dialogs.LocalDateTimeDialog
The class is used to create and open a dialog for editing LocalDateTime.
- Author:
- Ionov Ivan
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFlag indicating whether the clear value button will be shownprotected com.amalgamasimulation.desktop.binding.dialogs.AbstractLocalDateTimeDialog.DialogTypeDialog type.protected org.eclipse.swt.widgets.Shell -
Constructor Summary
ConstructorsConstructorDescriptionLocalDateTimeDialog(org.eclipse.swt.widgets.Shell shell, Supplier<LocalDateTime> getter, Consumer<LocalDateTime> handler) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoAction(LocalDateTime newValue) protected LocalDateTimegetValue()voidopen()Open dialog with date\time editors.Opens the dialog and blocks until the user closes it.com.amalgamasimulation.desktop.binding.dialogs.AbstractLocalDateTimeDialog<LocalDateTime> setButtonClear(boolean clearButtonExist) Set flag clearButtonExistsetNewLocalDateTimeCreator(Supplier<LocalDateTime> newLocalDateTimeCreator) Set function to get a new LocalDateTimeSets the dialog type to DATE.Sets the dialog type to TIME.
-
Field Details
-
currentType
protected com.amalgamasimulation.desktop.binding.dialogs.AbstractLocalDateTimeDialog.DialogType currentTypeDialog type. Depending on this dialog type, time and/or date editor(s) will be shown in the dialog -
clearButtonExist
protected boolean clearButtonExistFlag indicating whether the clear value button will be shown -
shell
protected org.eclipse.swt.widgets.Shell shell
-
-
Constructor Details
-
LocalDateTimeDialog
public LocalDateTimeDialog(org.eclipse.swt.widgets.Shell shell, Supplier<LocalDateTime> getter, Consumer<LocalDateTime> handler)
-
-
Method Details
-
getValue
-
doAction
-
setOnlyDate
Sets the dialog type to DATE. Only the date editor will be shown- Returns:
- this object
-
setOnlyTime
Sets the dialog type to TIME. Only the time editor will be shown- Returns:
- this object
-
setNewLocalDateTimeCreator
public LocalDateTimeDialog setNewLocalDateTimeCreator(Supplier<LocalDateTime> newLocalDateTimeCreator) Set function to get a new LocalDateTime- Parameters:
newLocalDateTimeCreator- - Function to get a new LocalDateTime if the container object is empty- Returns:
- this object
-
openAndGetValue
Opens the dialog and blocks until the user closes it.- Returns:
- selected value on OK, null on Cancel or Clear
-
setButtonClear
public com.amalgamasimulation.desktop.binding.dialogs.AbstractLocalDateTimeDialog<LocalDateTime> setButtonClear(boolean clearButtonExist) Set flag clearButtonExist- Parameters:
clearButtonExist- Flag indicating whether the clear value button will be shown- Returns:
- this object
-
open
public void open()Open dialog with date\time editors.
-