- Timestamp:
- 2008-05-09T14:42:59+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/gui/FedoraLogin.java
r14975 r15374 70 70 { 71 71 72 private JPanel m_infoPane; 72 73 private JComboBox m_serverComboBox; 73 74 private JComboBox m_protocolComboBox; … … 89 90 { 90 91 super(Gatherer.g_man, "Login", true); 92 this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); 91 93 92 94 m_servers=new HashMap(); … … 136 138 new JComponent[] {m_serverComboBox, m_protocolComboBox, m_usernameComboBox, m_passwordField}, 137 139 gridBag, inputPane); 140 141 // handling Closing and cancelling events 142 this.addWindowListener(new WindowAdapter() { 143 public void windowClosing(WindowEvent e){ 144 // this is important, if we want to stop looping on displaying the dialog: 145 login_requested = false; 146 //dispose(); // defaultCloseOperation of this dialog already set to dispose it 147 } 148 }); 138 149 139 150 JButton cancelButton=new JButton(new AbstractAction() { 140 151 private static final long serialVersionUID = 1L; 141 152 public void actionPerformed(ActionEvent evt) { 153 // this is important, if we want to stop looping on displaying the dialog: 154 login_requested = false; 142 155 dispose(); 143 156 } … … 150 163 buttonPane.add(cancelButton); 151 164 Container contentPane=getContentPane(); 165 152 166 contentPane.setLayout(new BorderLayout()); 167 m_infoPane = new JPanel(); 168 contentPane.add(m_infoPane, BorderLayout.NORTH); 153 169 contentPane.add(inputPane, BorderLayout.CENTER); 154 170 contentPane.add(buttonPane, BorderLayout.SOUTH); … … 305 321 } 306 322 323 } 324 325 public void setErrorMessage(String[] errorLines) { 326 m_infoPane.removeAll(); 327 // n rows and 1 column 328 m_infoPane.setLayout(new java.awt.GridLayout(errorLines.length, 1)); 329 for(int i = 0; i < errorLines.length; i++) { 330 JLabel line = new JLabel(" " + errorLines[i] + " "); 331 m_infoPane.add(line); 332 } 333 334 // Adjust and resize this dialog to take into account the 335 // recently added components (labels) 336 m_infoPane.validate(); 337 this.pack(); 307 338 } 308 339 … … 403 434 login_requested = true; 404 435 405 m_loginDialog.dispose(); 436 // hiding it instead of disposing it on OK-press allows us to loop 437 // on displaying the dialog in case there's more checking to do 438 m_loginDialog.setVisible(false); 439 406 440 } catch (Exception e) { 407 441 //String msg = e.getMessage(); … … 413 447 } 414 448 } 415 } 416 417 449 } 418 450 } 419 451
Note:
See TracChangeset
for help on using the changeset viewer.