class DialogWindow extends AbstractWindow {

    private static final Set<Hint> GLOBAL_DIALOG_HINTS =
            Collections.unmodifiableSet(new HashSet<>(Collections.singletonList(Hint.MODAL)));

    /**
     * Default constructor, takes a title for the dialog and runs code shared for dialogs
     * @param title Title of the window
     */
    protected DialogWindow(String title) {
        super(title);
        setHints(GLOBAL_DIALOG_HINTS);
    }

    /**
     * Opens the dialog by showing it on the GUI and doesn't return until the dialog has been closed
     * @param textGUI Text GUI to add the dialog to
     * @return Depending on the {@code DialogWindow} implementation, by default {@code null}
     */
    public Object showDialog(WindowBasedTextGUI textGUI) {<FILL_FUNCTION_BODY>}
}

        textGUI.addWindow(this);

        //Wait for the window to close, in case the window manager doesn't honor the MODAL hint
        waitUntilClosed();
        return null;
    
<methods>public void <init>() ,public void <init>(java.lang.String) ,public void addWindowListener(com.googlecode.lanterna.gui2.WindowListener) ,public void close() ,public void draw(com.googlecode.lanterna.gui2.TextGUIGraphics) ,public com.googlecode.lanterna.TerminalPosition fromGlobal(com.googlecode.lanterna.TerminalPosition) ,public com.googlecode.lanterna.TerminalPosition fromGlobalToContentRelative(com.googlecode.lanterna.TerminalPosition) ,public com.googlecode.lanterna.TerminalPosition fromGlobalToDecoratedRelative(com.googlecode.lanterna.TerminalPosition) ,public final com.googlecode.lanterna.TerminalSize getDecoratedSize() ,public Set<com.googlecode.lanterna.gui2.Window.Hint> getHints() ,public final com.googlecode.lanterna.TerminalPosition getPosition() ,public com.googlecode.lanterna.gui2.WindowPostRenderer getPostRenderer() ,public com.googlecode.lanterna.TerminalSize getPreferredSize() ,public final com.googlecode.lanterna.TerminalSize getSize() ,public com.googlecode.lanterna.gui2.WindowBasedTextGUI getTextGUI() ,public java.lang.String getTitle() ,public boolean handleInput(com.googlecode.lanterna.input.KeyStroke) ,public boolean isVisible() ,public void removeWindowListener(com.googlecode.lanterna.gui2.WindowListener) ,public void setCloseWindowWithEscape(boolean) ,public void setContentOffset(com.googlecode.lanterna.TerminalPosition) ,public final void setDecoratedSize(com.googlecode.lanterna.TerminalSize) ,public void setFixedSize(com.googlecode.lanterna.TerminalSize) ,public void setHints(Collection<com.googlecode.lanterna.gui2.Window.Hint>) ,public final void setPosition(com.googlecode.lanterna.TerminalPosition) ,public void setSize(com.googlecode.lanterna.TerminalSize) ,public void setTextGUI(com.googlecode.lanterna.gui2.WindowBasedTextGUI) ,public void setTitle(java.lang.String) ,public void setVisible(boolean) ,public void setWindowPostRenderer(com.googlecode.lanterna.gui2.WindowPostRenderer) ,public com.googlecode.lanterna.TerminalPosition toGlobal(com.googlecode.lanterna.TerminalPosition) ,public com.googlecode.lanterna.TerminalPosition toGlobalFromContentRelative(com.googlecode.lanterna.TerminalPosition) ,public com.googlecode.lanterna.TerminalPosition toGlobalFromDecoratedRelative(com.googlecode.lanterna.TerminalPosition) ,public void waitUntilClosed() <variables>private boolean closeWindowWithEscape,private com.googlecode.lanterna.TerminalPosition contentOffset,private Set<com.googlecode.lanterna.gui2.Window.Hint> hints,private com.googlecode.lanterna.TerminalSize lastKnownDecoratedSize,private com.googlecode.lanterna.TerminalPosition lastKnownPosition,private com.googlecode.lanterna.TerminalSize lastKnownSize,private com.googlecode.lanterna.gui2.WindowBasedTextGUI textGUI,private java.lang.String title,private boolean visible,private com.googlecode.lanterna.gui2.WindowPostRenderer windowPostRenderer