X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fcom%2Fgooglecode%2Flanterna%2Fgui2%2Fdialogs%2FDialogWindow.java;fp=src%2Fcom%2Fgooglecode%2Flanterna%2Fgui2%2Fdialogs%2FDialogWindow.java;h=0000000000000000000000000000000000000000;hp=1e637eaac9e35d0368581bd4c8dc1c695edc42d3;hb=f06c81000632cfb5f525ca458f719338f55f9f66;hpb=a73a906356c971b080c36368e71a15d87e8b8d31 diff --git a/src/com/googlecode/lanterna/gui2/dialogs/DialogWindow.java b/src/com/googlecode/lanterna/gui2/dialogs/DialogWindow.java deleted file mode 100644 index 1e637ea..0000000 --- a/src/com/googlecode/lanterna/gui2/dialogs/DialogWindow.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.googlecode.lanterna.gui2.dialogs; - -import com.googlecode.lanterna.gui2.*; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -/** - * Thin layer on top of the {@code AbstractWindow} class that automatically sets properties and hints to the window to - * make it act more like a modal dialog window - */ -public abstract class DialogWindow extends AbstractWindow { - - private static final Set 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 - */ - 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) { - textGUI.addWindow(this); - - //Wait for the window to close, in case the window manager doesn't honor the MODAL hint - waitUntilClosed(); - return null; - } -}