Line 1... |
Line 1... |
1 |
/*
|
1 |
/*
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
3 |
*
|
3 |
*
|
4 |
* Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
|
4 |
* Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
|
5 |
*
|
5 |
*
|
6 |
* The contents of this file are subject to the terms of the GNU General Public License Version 3
|
6 |
* The contents of this file are subject to the terms of the GNU General Public License Version 3
|
7 |
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
|
7 |
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
|
8 |
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
|
8 |
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
|
9 |
* language governing permissions and limitations under the License.
|
9 |
* language governing permissions and limitations under the License.
|
Line 45... |
Line 45... |
45 |
import java.awt.Insets;
|
45 |
import java.awt.Insets;
|
46 |
import java.awt.event.ActionEvent;
|
46 |
import java.awt.event.ActionEvent;
|
47 |
import java.awt.event.ActionListener;
|
47 |
import java.awt.event.ActionListener;
|
48 |
import java.beans.PropertyChangeEvent;
|
48 |
import java.beans.PropertyChangeEvent;
|
49 |
import java.beans.PropertyChangeListener;
|
49 |
import java.beans.PropertyChangeListener;
|
- |
|
50 |
import java.text.DateFormat;
|
50 |
import java.util.ArrayList;
|
51 |
import java.util.ArrayList;
|
51 |
import java.util.Arrays;
|
52 |
import java.util.Arrays;
|
- |
|
53 |
import java.util.Date;
|
52 |
import java.util.List;
|
54 |
import java.util.List;
|
53 |
import java.util.Locale;
|
55 |
import java.util.Locale;
|
54 |
import java.util.ResourceBundle;
|
56 |
import java.util.ResourceBundle;
|
55 |
|
57 |
|
56 |
import javax.swing.BorderFactory;
|
58 |
import javax.swing.BorderFactory;
|
Line 317... |
Line 319... |
317 |
@Override
|
319 |
@Override
|
318 |
public void actionPerformed(ActionEvent e) {
|
320 |
public void actionPerformed(ActionEvent e) {
|
319 |
final JPopupMenu menu = new JPopupMenu();
|
321 |
final JPopupMenu menu = new JPopupMenu();
|
320 |
final Locale locale = UserProps.getInstance().getLocale();
|
322 |
final Locale locale = UserProps.getInstance().getLocale();
|
321 |
for (final Locale l : ConnexionPanel.this.localesToDisplay) {
|
323 |
for (final Locale l : ConnexionPanel.this.localesToDisplay) {
|
- |
|
324 |
System.err.println("ConnexionPanel.ConnexionPanel(...).new ActionListener() {...}.actionPerformed()" + l);
|
322 |
final JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(l.getDisplayName(l));
|
325 |
final JCheckBoxMenuItem menuItem = new JCheckBoxMenuItem(l.getDisplayName(l));
|
323 |
if (l.equals(locale)) {
|
326 |
if (l.equals(locale)) {
|
324 |
menuItem.setSelected(true);
|
327 |
menuItem.setSelected(true);
|
325 |
}
|
328 |
}
|
326 |
menu.add(menuItem);
|
329 |
menu.add(menuItem);
|
Line 504... |
Line 507... |
504 |
public int getSelectedSociete() {
|
507 |
public int getSelectedSociete() {
|
505 |
return this.comboSociete.getSelectedId();
|
508 |
return this.comboSociete.getSelectedId();
|
506 |
}
|
509 |
}
|
507 |
|
510 |
|
508 |
protected void setUILanguage(Locale locale) {
|
511 |
protected void setUILanguage(Locale locale) {
|
- |
|
512 |
|
- |
|
513 |
System.err.println("ConnexionPanel.setUILanguage()" + locale + " : " + locale.getDisplayName());
|
509 |
final ResourceBundle bundle = ResourceBundle.getBundle(this.localeBaseName, locale, TranslationManager.getControl());
|
514 |
final ResourceBundle bundle = ResourceBundle.getBundle(this.localeBaseName, locale, TranslationManager.getControl());
|
510 |
this.adminLogin = bundle.getString("adminLogin");
|
515 |
this.adminLogin = bundle.getString("adminLogin");
|
511 |
this.loginLabel.setText(bundle.getString("loginLabel"));
|
516 |
this.loginLabel.setText(bundle.getString("loginLabel"));
|
512 |
this.passwordLabel.setText(bundle.getString("passwordLabel"));
|
517 |
this.passwordLabel.setText(bundle.getString("passwordLabel"));
|
513 |
this.companyLabel.setText(bundle.getString("companyLabel"));
|
518 |
this.companyLabel.setText(bundle.getString("companyLabel"));
|
Line 526... |
Line 531... |
526 |
// locale-sensitive code"
|
531 |
// locale-sensitive code"
|
527 |
JComponent.setDefaultLocale(locale);
|
532 |
JComponent.setDefaultLocale(locale);
|
528 |
// throw RuntimeException like ResourceBundle.getBundle() at the beginning of this
|
533 |
// throw RuntimeException like ResourceBundle.getBundle() at the beginning of this
|
529 |
// method
|
534 |
// method
|
530 |
TranslationManager.createDefaultInstance();
|
535 |
TranslationManager.createDefaultInstance();
|
- |
|
536 |
DateFormat df = DateFormat.getDateInstance();
|
- |
|
537 |
System.err.println("ConnexionPanel.setUILanguage() Date :" + Locale.getDefault() + " : " + new Date() + ": format: " + df.format(new Date()));
|
- |
|
538 |
System.err.println("ConnexionPanel.setUILanguage() Category :" + Locale.getDefault(Locale.Category.FORMAT));
|
531 |
}
|
539 |
}
|
532 |
}
|
540 |
}
|