X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fcom%2Fgooglecode%2Flanterna%2Fgui2%2Fdialogs%2FWaitingDialog.java;fp=src%2Fcom%2Fgooglecode%2Flanterna%2Fgui2%2Fdialogs%2FWaitingDialog.java;h=0000000000000000000000000000000000000000;hp=0bbcef258a3cc5a40a2bda800f380b9e8f092fde;hb=f06c81000632cfb5f525ca458f719338f55f9f66;hpb=a73a906356c971b080c36368e71a15d87e8b8d31 diff --git a/src/com/googlecode/lanterna/gui2/dialogs/WaitingDialog.java b/src/com/googlecode/lanterna/gui2/dialogs/WaitingDialog.java deleted file mode 100644 index 0bbcef2..0000000 --- a/src/com/googlecode/lanterna/gui2/dialogs/WaitingDialog.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * This file is part of lanterna (http://code.google.com/p/lanterna/). - * - * lanterna is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * Copyright (C) 2010-2015 Martin - */ -package com.googlecode.lanterna.gui2.dialogs; - -import com.googlecode.lanterna.gui2.*; - -/** - * Dialog that displays a text message, an optional spinning indicator and an optional progress bar. There is no buttons - * in this dialog so it has to be explicitly closed through code. - * @author martin - */ -public class WaitingDialog extends DialogWindow { - private WaitingDialog(String title, String text) { - super(title); - - Panel mainPanel = Panels.horizontal( - new Label(text), - AnimatedLabel.createClassicSpinningLine()); - setComponent(mainPanel); - } - - @Override - public Object showDialog(WindowBasedTextGUI textGUI) { - showDialog(textGUI, true); - return null; - } - - /** - * Displays the waiting dialog and optionally blocks until another thread closes it - * @param textGUI GUI to add the dialog to - * @param blockUntilClosed If {@code true}, the method call will block until another thread calls {@code close()} on - * the dialog, otherwise the method call returns immediately - */ - public void showDialog(WindowBasedTextGUI textGUI, boolean blockUntilClosed) { - textGUI.addWindow(this); - - if(blockUntilClosed) { - //Wait for the window to close, in case the window manager doesn't honor the MODAL hint - waitUntilClosed(); - } - } - - /** - * Creates a new waiting dialog - * @param title Title of the waiting dialog - * @param text Text to display on the waiting dialog - * @return Created waiting dialog - */ - public static WaitingDialog createDialog(String title, String text) { - return new WaitingDialog(title, text); - } - - /** - * Creates and displays a waiting dialog without blocking for it to finish - * @param textGUI GUI to add the dialog to - * @param title Title of the waiting dialog - * @param text Text to display on the waiting dialog - * @return Created waiting dialog - */ - public static WaitingDialog showDialog(WindowBasedTextGUI textGUI, String title, String text) { - WaitingDialog waitingDialog = createDialog(title, text); - waitingDialog.showDialog(textGUI, false); - return waitingDialog; - } -}