Search in sources :

Example 1 with MessageDialogBuilder

use of com.haulmont.cuba.gui.Dialogs.MessageDialogBuilder in project cuba by cuba-platform.

the class WebScreens method showMessageDialog.

@Override
public void showMessageDialog(String title, String message, Frame.MessageType messageType) {
    MessageDialogBuilder builder = ui.getDialogs().createMessageDialog().withCaption(title).withMessage(message).withType(convertMessageType(messageType.getMessageMode())).withContentMode(Frame.MessageMode.isHTML(messageType.getMessageMode()) ? ContentMode.HTML : ContentMode.TEXT);
    if (messageType.getWidth() != null) {
        SizeUnit sizeUnit = messageType.getWidthUnit() != null ? messageType.getWidthUnit() : SizeUnit.PIXELS;
        builder.withWidth(messageType.getWidth() + sizeUnit.getSymbol());
    }
    if (messageType.getModal() != null) {
        builder.withModal(messageType.getModal());
    }
    if (messageType.getCloseOnClickOutside() != null) {
        builder.withCloseOnClickOutside(messageType.getCloseOnClickOutside());
    }
    if (messageType.getMaximized() != null) {
        builder.withMaximized(messageType.getMaximized());
    }
    builder.show();
}
Also used : MessageDialogBuilder(com.haulmont.cuba.gui.Dialogs.MessageDialogBuilder)

Aggregations

MessageDialogBuilder (com.haulmont.cuba.gui.Dialogs.MessageDialogBuilder)1