OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 132 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 132 Rev 177
Line 17... Line 17...
17
import org.openconcerto.ui.component.ITextArea;
17
import org.openconcerto.ui.component.ITextArea;
18
import org.openconcerto.utils.SystemInfo;
18
import org.openconcerto.utils.SystemInfo;
19
import org.openconcerto.utils.SystemInfo.Info;
19
import org.openconcerto.utils.SystemInfo.Info;
20
import org.openconcerto.utils.i18n.TM;
20
import org.openconcerto.utils.i18n.TM;
21
 
21
 
-
 
22
import java.util.Locale;
22
import java.util.Map;
23
import java.util.Map;
23
 
24
 
24
import javax.swing.BorderFactory;
25
import javax.swing.BorderFactory;
25
import javax.swing.JComponent;
26
import javax.swing.JComponent;
26
import javax.swing.JEditorPane;
27
import javax.swing.JEditorPane;
Line 38... Line 39...
38
public class SystemInfoPanel extends JPanel {
39
public class SystemInfoPanel extends JPanel {
39
 
40
 
40
    private final FormLayouter l;
41
    private final FormLayouter l;
41
 
42
 
42
    public SystemInfoPanel() {
43
    public SystemInfoPanel() {
-
 
44
        this(Locale.getDefault());
-
 
45
    }
-
 
46
 
-
 
47
    public SystemInfoPanel(final Locale locale) {
43
        this.l = new FormLayouter(this, 1);
48
        this.l = new FormLayouter(this, 1);
44
        this.refresh();
49
        this.refresh(locale);
45
    }
50
    }
46
 
51
 
47
    public final void refresh() {
52
    public final void refresh(final Locale locale) {
48
        this.l.clear();
53
        this.l.clear();
49
        final Map<Info, String> infos = SystemInfo.get(true);
54
        final Map<Info, String> infos = SystemInfo.get(true, locale);
50
 
55
 
51
        final JEditorPane p = new HTMLTextField(infos.get(Info.JAVA)) {
56
        final JEditorPane p = new HTMLTextField(infos.get(Info.JAVA)) {
52
 
57
 
53
            private final String getClassName(HyperlinkEvent e) {
58
            private final String getClassName(HyperlinkEvent e) {
54
                // the link is not an URL
59
                // the link is not an URL
Line 92... Line 97...
92
        };
97
        };
93
 
98
 
94
        this.l.add("Java", p);
99
        this.l.add("Java", p);
95
 
100
 
96
        // * Windows XP 5.1 (x86)
101
        // * Windows XP 5.1 (x86)
97
        this.l.add(TM.tr("os"), new JLabel("<html>" + infos.get(Info.OS) + "</html>"));
102
        this.l.add(TM.tr(locale, "os"), new JLabel("<html>" + infos.get(Info.OS) + "</html>"));
98
 
103
 
99
        // * Sylvain ; C:\Documents and Settings\Sylvain ; D:\workspace\CTech
104
        // * Sylvain ; C:\Documents and Settings\Sylvain ; D:\workspace\CTech
100
        this.l.add(TM.tr("user"), new HTMLTextField(infos.get(Info.USER)));
105
        this.l.add(TM.tr(locale, "user"), new HTMLTextField(infos.get(Info.USER)));
101
 
106
 
102
        // * eth0 192.168.28.52/24, état: inactif, nom complet: ""
107
        // * eth0 192.168.28.52/24, état: inactif, nom complet: ""
103
        this.l.add(TM.tr("network"), new HTMLTextField(infos.get(Info.NETWORK)));
108
        this.l.add(TM.tr(locale, "network"), new HTMLTextField(infos.get(Info.NETWORK)));
104
 
109
 
105
        // TODO reverse vnc
110
        // TODO reverse vnc
-
 
111
 
-
 
112
        this.l.getComponent().revalidate();
106
    }
113
    }
107
}
114
}