OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 80 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
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
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.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.erp.modules;
15
 
16
import org.openconcerto.ui.DefaultGridBagConstraints;
17
 
80 ilm 18
import java.awt.Dimension;
18 ilm 19
import java.awt.GridBagConstraints;
20
import java.awt.GridBagLayout;
21
import java.awt.event.ActionEvent;
22
import java.awt.event.ActionListener;
23
 
24
import javax.swing.JButton;
25
import javax.swing.JFrame;
26
import javax.swing.JPanel;
27
 
28
public class ModuleFrame extends JFrame {
29
 
156 ilm 30
    private final ModulePanel tab1;
80 ilm 31
 
156 ilm 32
    public ModuleFrame(final ModuleManager mngr) {
33
        this(mngr, false);
80 ilm 34
    }
35
 
156 ilm 36
    public ModuleFrame(final ModuleManager mngr, final boolean onlyInstall) {
18 ilm 37
        this.setTitle("Modules");
38
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
39
        final JPanel p = new JPanel();
40
        p.setLayout(new GridBagLayout());
41
        final GridBagConstraints c = new DefaultGridBagConstraints();
156 ilm 42
        this.tab1 = new ModulePanel(mngr, onlyInstall);
18 ilm 43
        c.weightx = 1;
44
        c.weighty = 1;
45
        c.fill = GridBagConstraints.BOTH;
80 ilm 46
        p.add(this.tab1, c);
18 ilm 47
        final JButton closeButton = new JButton("Fermer");
48
        c.gridy++;
49
        c.anchor = GridBagConstraints.SOUTHEAST;
50
        c.fill = GridBagConstraints.NONE;
51
        c.weighty = 0;
52
        p.add(closeButton, c);
53
        closeButton.addActionListener(new ActionListener() {
54
            @Override
55
            public void actionPerformed(ActionEvent e) {
56
                ModuleFrame.this.dispose();
57
            }
58
        });
59
        this.setContentPane(p);
60
 
80 ilm 61
        this.setMinimumSize(new Dimension(480, 640));
62
        this.pack();
63
 
19 ilm 64
        this.tab1.reload();
18 ilm 65
    }
66
}