1 /*
   2  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
   3  * Use is subject to license terms.
   4  *
   5  * ident        "%Z%%M% %I%     %E% SMI"
   6  */
   7 
   8 import java.awt.*;
   9 import java.awt.event.*;
  10 import java.text.*;
  11 import java.util.*;
  12 
  13 /*
  14  * This class creates a dialog box that helps the user select encryption types
  15  * with some mouse clicks.  The dialog box need only be created
  16  * once. The Ok and Cancel buttons merely call setVisible with an
  17  * argument of false.
  18  */
  19 
  20 // The layout will consist of 2 panels:
  21 // topPanel contains the dynamic list of encryption type check boxes.
  22 // bottomPanel contains the buttons ok, clear, cancel, and help.
  23 // The two panels are separated by a LineSeparator.
  24 
  25 public class EncListDialog extends Dialog {
 
 239         }
 240 
 241         /*
 242          * Listener for all the buttons. The listener is shared for the sake
 243          * of reducing the number of overall listeners.
 244          * TBD: I18N the help
 245          */
 246         private class DCButtonListener implements ActionListener {
 247 
 248                 public void actionPerformed(ActionEvent e) {
 249                         if (e.getSource() == ok) {
 250                                 EncListDialog.this.encListDialogClose(true);
 251                         } else if (e.getSource() == cancel) {
 252                                 EncListDialog.this.encListDialogClose(false);
 253                         } else if (e.getSource() == clear) {
 254                                 for (int i = 0; i < cb.length; i++) {
 255                                         cb[i].setState(false);
 256                                 }
 257                         } else if (e.getSource() == help) {
 258                                 if (hd != null)
 259                                         hd.show();
 260                                 else {
 261                                         hd = new HelpDialog(
 262                                             EncListDialog.this.parent,
 263                                             getString(
 264                                             "Help for Encryption Type Dialog"),
 265                                             false);
 266                                         hd.setVisible(true);
 267                                         hd.setText(getString(hrb,
 268                                              "EncryptionTypeDialogHelp"));
 269                                 }
 270                         }
 271                 } // actionPerformed
 272         }
 273 
 274         /*
 275          * The string representation of the dialog box.
 276          * @return a String which contians the encryption type list
 277          */
 278         public String toString() {
 279 
 
 | 
   1 /*
   2  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
   3  * Use is subject to license terms.
   4  */
   5 
   6 import java.awt.*;
   7 import java.awt.event.*;
   8 import java.text.*;
   9 import java.util.*;
  10 
  11 /*
  12  * This class creates a dialog box that helps the user select encryption types
  13  * with some mouse clicks.  The dialog box need only be created
  14  * once. The Ok and Cancel buttons merely call setVisible with an
  15  * argument of false.
  16  */
  17 
  18 // The layout will consist of 2 panels:
  19 // topPanel contains the dynamic list of encryption type check boxes.
  20 // bottomPanel contains the buttons ok, clear, cancel, and help.
  21 // The two panels are separated by a LineSeparator.
  22 
  23 public class EncListDialog extends Dialog {
 
 237         }
 238 
 239         /*
 240          * Listener for all the buttons. The listener is shared for the sake
 241          * of reducing the number of overall listeners.
 242          * TBD: I18N the help
 243          */
 244         private class DCButtonListener implements ActionListener {
 245 
 246                 public void actionPerformed(ActionEvent e) {
 247                         if (e.getSource() == ok) {
 248                                 EncListDialog.this.encListDialogClose(true);
 249                         } else if (e.getSource() == cancel) {
 250                                 EncListDialog.this.encListDialogClose(false);
 251                         } else if (e.getSource() == clear) {
 252                                 for (int i = 0; i < cb.length; i++) {
 253                                         cb[i].setState(false);
 254                                 }
 255                         } else if (e.getSource() == help) {
 256                                 if (hd != null)
 257                                         hd.setVisible(true);
 258                                 else {
 259                                         hd = new HelpDialog(
 260                                             EncListDialog.this.parent,
 261                                             getString(
 262                                             "Help for Encryption Type Dialog"),
 263                                             false);
 264                                         hd.setVisible(true);
 265                                         hd.setText(getString(hrb,
 266                                             "EncryptionTypeDialogHelp"));
 267                                 }
 268                         }
 269                 } // actionPerformed
 270         }
 271 
 272         /*
 273          * The string representation of the dialog box.
 274          * @return a String which contians the encryption type list
 275          */
 276         public String toString() {
 277 
 
 |