Search in sources :

Example 1 with JFXDialog

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();
}
Also used : ActionEvent(javafx.event.ActionEvent) JFXDialog(com.jfoenix.controls.JFXDialog) Text(javafx.scene.text.Text) JFXButton(com.jfoenix.controls.JFXButton) JFXDialogLayout(com.jfoenix.controls.JFXDialogLayout)

Example 2 with JFXDialog

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);
                }
            });
        }
    }
}
Also used : JFXDatePicker(com.jfoenix.controls.JFXDatePicker) JFXDialog(com.jfoenix.controls.JFXDialog)

Example 3 with JFXDialog

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);
                }
            });
        }
    }
}
Also used : JFXDialog(com.jfoenix.controls.JFXDialog)

Example 4 with JFXDialog

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();
}
Also used : ActionEvent(javafx.event.ActionEvent) Label(javafx.scene.control.Label) JFXDialog(com.jfoenix.controls.JFXDialog) Text(javafx.scene.text.Text) JFXButton(com.jfoenix.controls.JFXButton) JFXDialogLayout(com.jfoenix.controls.JFXDialogLayout)

Aggregations

JFXDialog (com.jfoenix.controls.JFXDialog)4 JFXButton (com.jfoenix.controls.JFXButton)2 JFXDialogLayout (com.jfoenix.controls.JFXDialogLayout)2 ActionEvent (javafx.event.ActionEvent)2 Text (javafx.scene.text.Text)2 JFXDatePicker (com.jfoenix.controls.JFXDatePicker)1 Label (javafx.scene.control.Label)1