Print this page
4719 Common patchset for jdk1.7 support preparation


 265      */
 266     private class DHWindowListener extends WindowAdapter {
 267         public  void windowClosing(WindowEvent e) {
 268                 durationHelperClose(false);
 269         }
 270     }
 271 
 272     /**
 273      * Listener for all the buttons.
 274      * The listener is shared for the sake
 275      * of reducing the number of overall listeners.
 276      */
 277     private class ButtonListener implements ActionListener {
 278         public void actionPerformed(ActionEvent e) {
 279             if (e.getSource() == ok) {
 280                 DurationHelper.this.durationHelperClose(true);
 281             } else if (e.getSource() == cancel) {
 282                 DurationHelper.this.durationHelperClose(false);
 283             } else if (e.getSource() == help) {
 284                 if (hd != null)
 285                     hd.show();
 286                 else {
 287                     hd = new HelpDialog(DurationHelper. this.parent,
 288                         getString("Help for entering time duration"),
 289                                     false, 5, 45);
 290                     hd.setVisible(true);
 291                     hd.setText(getString(hrb, "DurationHelperHelp"));
 292                 }
 293             } else if (e.getSource() == compute) {
 294                 checkErrorAndSetTotal();
 295             }
 296         }
 297     }
 298 
 299     /**
 300      * Call rb.getString(), but catch exception
 301      * and return English
 302      * key so that small spelling errors don't cripple the GUI
 303      *
 304      */
 305     private static final String getString(String key) {




 265      */
 266     private class DHWindowListener extends WindowAdapter {
 267         public  void windowClosing(WindowEvent e) {
 268                 durationHelperClose(false);
 269         }
 270     }
 271 
 272     /**
 273      * Listener for all the buttons.
 274      * The listener is shared for the sake
 275      * of reducing the number of overall listeners.
 276      */
 277     private class ButtonListener implements ActionListener {
 278         public void actionPerformed(ActionEvent e) {
 279             if (e.getSource() == ok) {
 280                 DurationHelper.this.durationHelperClose(true);
 281             } else if (e.getSource() == cancel) {
 282                 DurationHelper.this.durationHelperClose(false);
 283             } else if (e.getSource() == help) {
 284                 if (hd != null)
 285                     hd.setVisible(true);
 286                 else {
 287                     hd = new HelpDialog(DurationHelper. this.parent,
 288                         getString("Help for entering time duration"),
 289                                     false, 5, 45);
 290                     hd.setVisible(true);
 291                     hd.setText(getString(hrb, "DurationHelperHelp"));
 292                 }
 293             } else if (e.getSource() == compute) {
 294                 checkErrorAndSetTotal();
 295             }
 296         }
 297     }
 298 
 299     /**
 300      * Call rb.getString(), but catch exception
 301      * and return English
 302      * key so that small spelling errors don't cripple the GUI
 303      *
 304      */
 305     private static final String getString(String key) {