use of com.jfoenix.controls.JFXDialog in project SmartCity-Market by TechnionYP5777.
the class DialogMessagesService method alertCreator.
private static void alertCreator(String title, String header, String content) {
JFXDialogLayout dialogContent = new JFXDialogLayout();
dialogContent.setHeading(new Text(header == null ? title : title + "\n" + header));
dialogContent.setBody(new Text(content));
JFXButton close = new JFXButton("Close");
close.getStyleClass().add("JFXButton");
dialogContent.setActions(close);
JFXDialog dialog = new JFXDialog((StackPane) AbstractApplicationScreen.stage.getScene().getRoot(), dialogContent, JFXDialog.DialogTransition.CENTER);
close.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent __) {
dialog.close();
}
});
dialog.show();
}
use of com.jfoenix.controls.JFXDialog in project JFoenix by jfoenixadmin.
the class JFXDatePickerSkin method show.
@Override
public void show() {
if (!((JFXDatePicker) getSkinnable()).isOverLay())
super.show();
if (content != null) {
content.init();
content.clearFocus();
}
if (((JFXDatePicker) getSkinnable()).isOverLay()) {
if (dialog == null) {
StackPane dialogParent = jfxDatePicker.getDialogParent();
if (dialogParent == null)
dialogParent = (StackPane) getSkinnable().getScene().getRoot();
dialog = new JFXDialog(dialogParent, (Region) getPopupContent(), DialogTransition.CENTER, true);
arrowButton.setOnMouseClicked((click) -> {
if (((JFXDatePicker) getSkinnable()).isOverLay()) {
StackPane parent = jfxDatePicker.getDialogParent();
if (parent == null)
parent = (StackPane) getSkinnable().getScene().getRoot();
dialog.show(parent);
}
});
}
}
}
use of com.jfoenix.controls.JFXDialog in project JFoenix by jfoenixadmin.
the class JFXTimePickerSkin method show.
@Override
public void show() {
if (!jfxTimePicker.isOverLay())
super.show();
if (content != null) {
content.init();
content.clearFocus();
}
if (jfxTimePicker.isOverLay()) {
if (dialog == null) {
StackPane dialogParent = jfxTimePicker.getDialogParent();
if (dialogParent == null)
dialogParent = (StackPane) getSkinnable().getScene().getRoot();
dialog = new JFXDialog(dialogParent, (Region) getPopupContent(), DialogTransition.CENTER, true);
arrowButton.setOnMouseClicked((click) -> {
if (jfxTimePicker.isOverLay()) {
StackPane parent = jfxTimePicker.getDialogParent();
if (parent == null)
parent = (StackPane) getSkinnable().getScene().getRoot();
dialog.show(parent);
}
});
}
}
}
use of com.jfoenix.controls.JFXDialog in project SmartCity-Market by TechnionYP5777.
the class DialogMessagesService method showConfirmationDialog.
public static void showConfirmationDialog(String title, String header, String content, IConfiramtionDialog d) {
JFXDialogLayout dialogContent = new JFXDialogLayout();
dialogContent.setHeading(new Text(header == null ? title : title + "\n" + header));
dialogContent.setBody(new Text(content));
JFXButton yes = new JFXButton("Yes");
yes.getStyleClass().add("JFXButton");
JFXButton no = new JFXButton("No");
no.getStyleClass().add("JFXButton");
dialogContent.setActions(yes, new Label(" "), no);
JFXDialog dialog = new JFXDialog((StackPane) AbstractApplicationScreen.stage.getScene().getRoot(), dialogContent, JFXDialog.DialogTransition.CENTER);
yes.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent __) {
dialog.close();
d.onYes();
}
});
no.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent __) {
dialog.close();
d.onNo();
}
});
dialog.show();
}
Aggregations