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.preferences;
|
|
|
15 |
|
|
|
16 |
import org.openconcerto.erp.config.ComptaPropsConfiguration;
|
|
|
17 |
import org.openconcerto.sql.Configuration;
|
|
|
18 |
import org.openconcerto.sql.element.SQLComponent;
|
|
|
19 |
import org.openconcerto.sql.model.SQLTable;
|
|
|
20 |
import org.openconcerto.ui.DefaultGridBagConstraints;
|
|
|
21 |
import org.openconcerto.ui.preferences.DefaultPreferencePanel;
|
|
|
22 |
|
|
|
23 |
import java.awt.GridBagConstraints;
|
|
|
24 |
import java.awt.GridBagLayout;
|
|
|
25 |
|
|
|
26 |
public class SocietePreferencePanel extends DefaultPreferencePanel {
|
|
|
27 |
|
|
|
28 |
private SQLComponent sc;
|
|
|
29 |
|
|
|
30 |
public SocietePreferencePanel() {
|
|
|
31 |
this.setLayout(new GridBagLayout());
|
|
|
32 |
final GridBagConstraints c = new DefaultGridBagConstraints();
|
|
|
33 |
c.weightx = 1;
|
|
|
34 |
c.weighty = 1;
|
|
|
35 |
c.fill = GridBagConstraints.BOTH;
|
|
|
36 |
c.anchor = GridBagConstraints.NORTHWEST;
|
|
|
37 |
|
|
|
38 |
final SQLTable tableSociete = Configuration.getInstance().getBase().getTable("SOCIETE_COMMON");
|
27 |
ilm |
39 |
this.sc = Configuration.getInstance().getDirectory().getElement(tableSociete).createDefaultComponent();
|
18 |
ilm |
40 |
this.sc.uiInit();
|
|
|
41 |
this.sc.select(((ComptaPropsConfiguration) Configuration.getInstance()).getSocieteID());
|
|
|
42 |
this.add(this.sc, c);
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
public String getTitleName() {
|
|
|
46 |
return "Société";
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
public void storeValues() {
|
|
|
50 |
this.sc.update();
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
public void restoreToDefaults() {
|
|
|
54 |
|
|
|
55 |
}
|
|
|
56 |
}
|