Since header style background can be interchangeable, there's no need to keep redundant dialog fxml files. Instead refactor them to their base template dialog fxml such as:
OK dialog
OK CANCEL dialog
YES NO dialog
Input text dialog and
Exception dialog
Refactor includes:
DialogType will served as dialog fxml path enum
move DialogType.java to ../dialog/ package
delete Fxml.java
add private constructor with fxml path as parameter
add a protected getPath() method so that Dialog will only have access to the values
Refactor fxml files to their base template
Remove redundant fxml files such as:
WarningDialog
ConfirmationDialog
InformationDialog
WarningDialog
All generic dialogs
Rename applyHeaderColorStyle(HeaderColorStyle headerColorStyle) to setHeaderColorStyle(HeaderColorStyle headerColorStyle) and set it to public final
Update the new setHeaderColorStyle(HeaderColorStyle headerColorStyle) for default and custom style background
Refactor constructor with fxml file loading using DialogType instead of Fxml enum
Add updateHeaderColorStyle(HeaderColorStyle headerColorStyle) method for easy style color switching for setHeaderColorStyle(HeaderColorStyle headerColorStyle)
Define a default background color (WHITE) for the dialog's header if CUSTOM style is selected in the constructor (this will keep the drop shadow effect for the header in play, otherwise the effect is applied to the text if no background is applied). Let user apply their own custom style via setCustomHeaderColorStyle(String colorStyle) later on.
Since header style background can be interchangeable, there's no need to keep redundant dialog fxml files. Instead refactor them to their base template dialog fxml such as:
Refactor includes:
DialogType.java
to../dialog/
packageFxml.java
getPath()
method so that Dialog will only have access to the valuesWarningDialog
ConfirmationDialog
InformationDialog
WarningDialog
applyHeaderColorStyle(HeaderColorStyle headerColorStyle)
tosetHeaderColorStyle(HeaderColorStyle headerColorStyle)
and set it topublic final
setHeaderColorStyle(HeaderColorStyle headerColorStyle)
setHeaderColorStyle(HeaderColorStyle headerColorStyle)
for default and custom style backgroundupdateHeaderColorStyle(HeaderColorStyle headerColorStyle)
method for easy style color switching forsetHeaderColorStyle(HeaderColorStyle headerColorStyle)
setCustomHeaderColorStyle(String colorStyle)
later on.