OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 80 Rev 156
Line 22... Line 22...
22
import java.awt.event.ActionListener;
22
import java.awt.event.ActionListener;
23
 
23
 
24
import javax.swing.JButton;
24
import javax.swing.JButton;
25
import javax.swing.JFrame;
25
import javax.swing.JFrame;
26
import javax.swing.JPanel;
26
import javax.swing.JPanel;
27
import javax.swing.SwingUtilities;
-
 
28
 
27
 
29
public class ModuleFrame extends JFrame {
28
public class ModuleFrame extends JFrame {
30
 
29
 
31
    private static ModuleFrame INSTANCE = null;
30
    private final ModulePanel tab1;
32
 
-
 
33
    public static final ModuleFrame getInstance() {
-
 
34
        // no need to sync
-
 
35
        assert SwingUtilities.isEventDispatchThread();
-
 
36
        if (INSTANCE == null) {
-
 
37
            INSTANCE = new ModuleFrame(false);
-
 
38
            INSTANCE.setLocationRelativeTo(null);
-
 
39
        }
-
 
40
        return INSTANCE;
-
 
41
    }
-
 
42
 
31
 
43
    public static final ModuleFrame createInstallOnlyInstance() {
32
    public ModuleFrame(final ModuleManager mngr) {
44
        return new ModuleFrame(true);
33
        this(mngr, false);
45
    }
34
    }
46
 
35
 
47
    private final ModulePanel tab1;
-
 
48
 
-
 
49
    private ModuleFrame(final boolean onlyInstall) {
36
    public ModuleFrame(final ModuleManager mngr, final boolean onlyInstall) {
50
        this.setTitle("Modules");
37
        this.setTitle("Modules");
51
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
38
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
52
        final JPanel p = new JPanel();
39
        final JPanel p = new JPanel();
53
        p.setLayout(new GridBagLayout());
40
        p.setLayout(new GridBagLayout());
54
        final GridBagConstraints c = new DefaultGridBagConstraints();
41
        final GridBagConstraints c = new DefaultGridBagConstraints();
55
        this.tab1 = new ModulePanel(this, onlyInstall);
42
        this.tab1 = new ModulePanel(mngr, onlyInstall);
56
        c.weightx = 1;
43
        c.weightx = 1;
57
        c.weighty = 1;
44
        c.weighty = 1;
58
        c.fill = GridBagConstraints.BOTH;
45
        c.fill = GridBagConstraints.BOTH;
59
        p.add(this.tab1, c);
46
        p.add(this.tab1, c);
60
        final JButton closeButton = new JButton("Fermer");
47
        final JButton closeButton = new JButton("Fermer");