diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-09-13 00:26:05 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-09-13 00:26:05 +0000 |
commit | 7a042e4f8a987a50143415af690a878881d4b48f (patch) | |
tree | 338a92488326f0585d65743bd3d6ec0650fd6db1 /java/gjt/YesNoDialog.java | |
parent | 9b50028195a935518c2716dcdb94d5bb167a0af2 (diff) | |
download | ATCD-TAO-1_0_4.tar.gz |
This commit was manufactured by cvs2svn to create tag 'TAO-1_0_4'.TAO-1_0_4
Diffstat (limited to 'java/gjt/YesNoDialog.java')
-rw-r--r-- | java/gjt/YesNoDialog.java | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/java/gjt/YesNoDialog.java b/java/gjt/YesNoDialog.java deleted file mode 100644 index 2db64ea6e4b..00000000000 --- a/java/gjt/YesNoDialog.java +++ /dev/null @@ -1,80 +0,0 @@ -package gjt; - -import java.awt.*; - -/** - * Similar in fuction to the MessageDialog, YesNoDialog poses - * a question, that is answered by selection of either a Yes - * button or a No button.<p> - * - * Note that the YesNoDialog is a singleton - meaning there is - * only one YesNoDialog in existence per applet. Clients - * may obtain the YesNoDialog by invoking getYesNoDialog().<p> - * - * @version 1.0, Apr 1 1996 - * @author David Geary - * @see GJTDialog - * @see MessageDialog - * @see gjt.test.DialogTest - */ -public class YesNoDialog extends GJTDialog { - static private YesNoDialog _theYesNoDialog; - private Button yesButton; - private Button noButton; - private String message; - private boolean answer = false; - private ButtonPanel buttonPanel = new ButtonPanel(); - - static public YesNoDialog getYesNoDialog( Frame frame, - DialogClient client, - String title, - String message) { - if(_theYesNoDialog == null) - _theYesNoDialog = new YesNoDialog(frame,client, - title,message); - else { - _theYesNoDialog.setClient (client); - _theYesNoDialog.setTitle (title); - _theYesNoDialog.setMessage(message); - } - return _theYesNoDialog; - } - private YesNoDialog(Frame frame, DialogClient client, - String title, String message) { - super(frame, title, client, true); - yesButton = buttonPanel.add("Yes"); - noButton = buttonPanel.add("No"); - - setLayout(new BorderLayout()); - add("Center", new YesNoPanel(message)); - add("South", buttonPanel); - pack(); - } - public void show() { - yesButton.requestFocus(); - super.show(); - } - public boolean answeredYes() { - return answer; - } - public boolean action(Event event, Object what) { - if(event.target == yesButton) answer = true; - else answer = false; - - hide(); - client.dialogDismissed(this); - return true; - } - private void setMessage(String message) { - this.message = message; - } -} - -class YesNoPanel extends Panel { - public YesNoPanel(String question) { - add("Center", new Label(question, Label.CENTER)); - } - public Insets insets() { - return new Insets(10,10,10,10); - } -} |