OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev Author Line No. Line
74 ilm 1
package org.openconcerto.modules.extensionbuilder;
2
 
3
import java.awt.GridLayout;
4
 
5
import javax.swing.JComponent;
6
import javax.swing.JPanel;
7
import javax.swing.JSplitPane;
8
 
9
public class ExtensionListPanel extends JPanel {
10
    private JPanel rPanel = new JPanel();
11
    private JSplitPane split;
12
    private ExtensionBuilderModule extensionBuilderModule;
13
    final ExtensionMainListPanel newLeftComponent;
14
 
15
    public ExtensionListPanel(ExtensionBuilderModule extensionBuilderModule) {
16
        if (extensionBuilderModule == null) {
17
            throw new IllegalArgumentException("null ExtensionBuilderModule");
18
        }
19
        this.extensionBuilderModule = extensionBuilderModule;
20
        this.setLayout(new GridLayout(1, 1));
181 ilm 21
        this.newLeftComponent = new ExtensionMainListPanel(this);
22
        this.split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.newLeftComponent, this.rPanel);
74 ilm 23
        this.add(this.split);
181 ilm 24
        this.newLeftComponent.fill();
74 ilm 25
    }
26
 
27
    public void setRightPanel(JComponent p) {
28
        this.invalidate();
29
        this.split.setRightComponent(p);
30
        this.revalidate();
31
        this.repaint();
32
    }
33
 
34
    public ExtensionBuilderModule getExtensionBuilderModule() {
181 ilm 35
        return this.extensionBuilderModule;
74 ilm 36
    }
37
 
38
    public void modelChanged() {
181 ilm 39
        this.newLeftComponent.modelChanged();
74 ilm 40
    }
41
 
42
}