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 abstract class AbstractSplittedPanel extends JPanel {
10
    protected JSplitPane split;
11
    protected JComponent leftComponent;
12
    protected Extension extension;
13
 
14
    public AbstractSplittedPanel(Extension extension) {
15
        this.extension = extension;
16
        this.setLayout(new GridLayout(1, 1));
17
        this.setOpaque(false);
181 ilm 18
        this.leftComponent = createLeftComponent();
19
        this.split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.leftComponent, new JPanel());
20
        this.add(this.split);
74 ilm 21
    }
22
 
23
    public void setRightPanel(JComponent p) {
24
        this.invalidate();
181 ilm 25
        this.split.setRightComponent(p);
74 ilm 26
        this.revalidate();
27
        this.repaint();
28
    }
29
 
30
    public abstract JComponent createLeftComponent();
31
 
32
}