code: public static Window show(String dialog, Map<String, Object> args, boolean closable, boolean sizable, boolean show,
                                IEventListener closeListener) {
          Window parent = new Window(); // Temporary parent in case materialize fails, so can cleanup.
          Page currentPage = ExecutionContext.getPage();
          parent.setParent(currentPage);
          Window window = null;
          
          try {
              PageUtil.createPage(dialog, parent, args);
              window = parent.getChild(Window.class);
              
              if (window != null) { // If any top component is a window, discard temp parent
                  window.setParent(null);
                  BaseComponent child;
                  
                  while ((child = parent.getFirstChild()) != null) {
                      child.setParent(window);
                  }
                  
                  parent.destroy();
                  window.setParent(currentPage);
              } else { // Otherwise, use the temp parent as the window
                  window = parent;
              }
              
              window.setClosable(closable);
              window.setSizable(sizable);
              
              if (show) {
                  window.modal(closeListener);
              }
          } catch (Exception e) {
              if (window != null) {
                  window.destroy();
                  window = null;
              }
              
              if (parent != null) {
                  parent.destroy();
              }
              
              DialogUtil.showError(e);
              log.error("Error materializing page", e);
          }
          
          return window;
      }
docs: Can be used to popup any page definition as a modal dialog.
  
  @param dialog String Page used to construct the dialog.
  @param args Argument list (may be null)
  @param closable If true, window closure button appears.
  @param sizable If true, window sizing grips appear.
  @param show If true, the window is displayed modally. If false, the window is created but not
  displayed.
  @param closeListener Called upon window closure.
  @return Reference to the opened window, if successful.