/[schmitzm]/trunk/src/skrueger/i8n/SwitchLanguageDialog.java
ViewVC logotype

Diff of /trunk/src/skrueger/i8n/SwitchLanguageDialog.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 261 by mojays, Fri Jul 31 17:05:18 2009 UTC revision 724 by alfonx, Thu Feb 25 17:31:17 2010 UTC
# Line 62  import skrueger.swing.TranslationEditJPa Line 62  import skrueger.swing.TranslationEditJPa
62  public class SwitchLanguageDialog extends JDialog {  public class SwitchLanguageDialog extends JDialog {
63          protected Logger LOGGER = Logger.getLogger(SwitchLanguageDialog.class);          protected Logger LOGGER = Logger.getLogger(SwitchLanguageDialog.class);
64    
65          private static final long serialVersionUID = 1L;          
66    
67          private JPanel jContentPane = null;          private JPanel jContentPane = null;
68    
# Line 83  public class SwitchLanguageDialog extend Line 83  public class SwitchLanguageDialog extend
83          /**          /**
84           * A dialog to select one of the available languages. If only one language           * A dialog to select one of the available languages. If only one language
85           * is available, select it directly. Creating this object automatically           * is available, select it directly. Creating this object automatically
86           * makes it visible.           * makes it visible, unless there is only one language to choose from.. it
87           *           * that case it disposes itself automatically.
          * @param owner  
          * @param atlasConfig  
88           */           */
89          public SwitchLanguageDialog(final Component owner,          public SwitchLanguageDialog(final Component owner,
90                          final List<String> languages) {                          final List<String> languages) {
# Line 98  public class SwitchLanguageDialog extend Line 96  public class SwitchLanguageDialog extend
96                  if (languages.size() == 1) {                  if (languages.size() == 1) {
97                          LOGGER.debug("Only language '" + languages.get(0)                          LOGGER.debug("Only language '" + languages.get(0)
98                                          + "' is available. It has been selected automatically.");                                          + "' is available. It has been selected automatically.");
99    //                      dispose();
100                            setModal(false);
101                          return;                          return;
102                  }                  }
103    
# Line 111  public class SwitchLanguageDialog extend Line 111  public class SwitchLanguageDialog extend
111           */           */
112          private void initialize() {          private void initialize() {
113                  this.setContentPane(getJContentPane());                  this.setContentPane(getJContentPane());
                 setModal(true);  
                 SwingUtil.centerFrameOnScreenRandom(this);  
114    
115                  setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);                  setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
116    
117                  pack();                  pack();
118    
119                    SwingUtil.centerFrameOnScreenRandom(this);
120                    setModal(true);
121                    setVisible(true);
122          }          }
123    
124          /**          /**
# Line 213  public class SwitchLanguageDialog extend Line 215  public class SwitchLanguageDialog extend
215                          gridBagConstraints.gridy = 0;                          gridBagConstraints.gridy = 0;
216                          jLabel = new JLabel();                          jLabel = new JLabel();
217                          jLabel.setText("Select language: "); // i8n!?! Maybe replace with an                          jLabel.setText("Select language: "); // i8n!?! Maybe replace with an
218                                                                                                          // icon of an index finger                          // icon of an index finger
219                          jPanel1 = new JPanel();                          jPanel1 = new JPanel();
220                          jPanel1.setLayout(new GridBagLayout());                          jPanel1.setLayout(new GridBagLayout());
221                          jPanel1.add(jLabel, gridBagConstraints);                          jPanel1.add(jLabel, gridBagConstraints);
# Line 286  public class SwitchLanguageDialog extend Line 288  public class SwitchLanguageDialog extend
288                  return jComboBox;                  return jComboBox;
289          }          }
290    
291  } // @jve:decl-index=0:visual-constraint="0,0"  }

Legend:
Removed from v.261  
changed lines
  Added in v.724

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26