com.vaadin.flow.component.dialog.Dialog Java Examples

The following examples show how to use com.vaadin.flow.component.dialog.Dialog. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainLayout.java    From electron-java-app with Apache License 2.0 6 votes vote down vote up
private void onMenuAbout() {
    var helpWindow = new Dialog();
    helpWindow.setSizeUndefined();

    var content = new VerticalLayout();
    content.setSizeUndefined();
    content.setPadding(false);

    content.add(new H2("About"));

    var aboutLabel = new Html("<span>Electron+Vaadin Demo<br>Authors: Yuriy Artamonov, Erik Lumme</span>");
    content.add(aboutLabel);

    var okBtn = new Button("Ok", VaadinIcon.CHECK.create());
    okBtn.focus();
    okBtn.addClickListener(event -> helpWindow.close());

    content.add(okBtn);
    content.setAlignSelf(Alignment.CENTER, okBtn);

    helpWindow.add(content);
    helpWindow.open();
}
 
Example #2
Source File: WindowBasedCrudLayout.java    From crudui with Apache License 2.0 5 votes vote down vote up
@Override
public void showDialog(String caption, Component form) {
    VerticalLayout dialogLayout = new VerticalLayout(form);
    dialogLayout.setWidth("100%");
    dialogLayout.setMargin(false);
    dialogLayout.setPadding(false);

    dialog = new Dialog(new H3(caption), dialogLayout);
    dialog.setWidth(formWindowWidth);
    dialog.open();
}