93 |
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.rights;
|
|
|
15 |
|
|
|
16 |
import org.openconcerto.sql.element.SQLComponent;
|
|
|
17 |
import org.openconcerto.sql.element.SQLElement;
|
156 |
ilm |
18 |
import org.openconcerto.sql.model.DBRoot;
|
93 |
ilm |
19 |
import org.openconcerto.sql.users.rights.UserRightSQLComponent;
|
|
|
20 |
import org.openconcerto.sql.users.rights.UserRightSQLElement;
|
|
|
21 |
|
|
|
22 |
import javax.swing.JComponent;
|
|
|
23 |
|
|
|
24 |
public class UserRightGroupComptaSQLElement extends UserRightSQLElement {
|
|
|
25 |
|
156 |
ilm |
26 |
public UserRightGroupComptaSQLElement(final DBRoot r) {
|
|
|
27 |
super(r);
|
93 |
ilm |
28 |
// ((Group)GlobalMapper.getInstance().get(UserRightSQLComponent.ID)).
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
@Override
|
|
|
32 |
public SQLComponent createComponent() {
|
|
|
33 |
return new UserRightGroupComp(this);
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
public final class UserRightGroupComp extends UserRightSQLComponent {
|
|
|
37 |
|
|
|
38 |
public UserRightGroupComp(SQLElement element) {
|
|
|
39 |
super(element);
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
// @Override
|
|
|
43 |
// protected Set<String> createRequiredNames() {
|
|
|
44 |
// final Set<String> s = new HashSet<String>();
|
|
|
45 |
// s.add("NOM");
|
|
|
46 |
// s.add("ID_ADRESSE");
|
|
|
47 |
// s.add("ID_MODE_REGLEMENT");
|
|
|
48 |
// return s;
|
|
|
49 |
// }
|
|
|
50 |
|
|
|
51 |
@Override
|
|
|
52 |
public JComponent createEditor(String id) {
|
|
|
53 |
// if (id.equals("INFOS")) {
|
|
|
54 |
// return new ITextArea(4, 40);
|
|
|
55 |
// } else if (id.equals("COMMENTAIRES")) {
|
|
|
56 |
// return new ITextArea(10, 40);
|
|
|
57 |
// }
|
|
|
58 |
return super.createEditor(id);
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
// @Override
|
|
|
62 |
// protected JComponent createLabel(String id) {
|
|
|
63 |
// // TODO Auto-generated method stub
|
|
|
64 |
// if (id.equals("OBJECT")) {
|
|
|
65 |
// return GroupComboItem.getComboMenu();
|
|
|
66 |
// }
|
|
|
67 |
// return super.createLabel(id);
|
|
|
68 |
// }
|
|
|
69 |
|
|
|
70 |
@Override
|
|
|
71 |
public JComponent getLabel(String id) {
|
|
|
72 |
// if (id.equals("ID_MODE_REGLEMENT") || id.equals("INFOS") ||
|
|
|
73 |
// id.startsWith("ID_ADRESSE")) {
|
|
|
74 |
// JLabel l = (JLabel) super.getLabel(id);
|
|
|
75 |
// l.setFont(l.getFont().deriveFont(Font.BOLD));
|
|
|
76 |
// return l;
|
|
|
77 |
// }
|
|
|
78 |
// if (id.equals("customerrelationship.customer.contact")) {
|
|
|
79 |
// return new JLabelBold("Contacts");
|
|
|
80 |
// } else if (id.equals("customerrelationship.customer.payment")) {
|
|
|
81 |
// return new JLabelBold("Mode de règlement");
|
|
|
82 |
// } else
|
|
|
83 |
if (id.equals("OBJECT")) {
|
|
|
84 |
return MenuGroupComboItem.getComboMenu();
|
|
|
85 |
}
|
|
|
86 |
return super.getLabel(id);
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
// private int userID = SQLRow.NONEXISTANT_ID;
|
|
|
90 |
//
|
|
|
91 |
// private UserRightComp(SQLElement element) {
|
|
|
92 |
// super(element, 2, 1);
|
|
|
93 |
// }
|
|
|
94 |
//
|
|
|
95 |
// @Override
|
|
|
96 |
// protected Set<String> createRequiredNames() {
|
|
|
97 |
// return CollectionUtils.createSet("ID_RIGHT", "HAVE_RIGHT");
|
|
|
98 |
// }
|
|
|
99 |
//
|
|
|
100 |
// public void addViews() {
|
|
|
101 |
// final SQLRequestComboBox user = new SQLRequestComboBox();
|
|
|
102 |
// this.addView(user, "ID_USER_COMMON", "0");
|
|
|
103 |
// user.getRequest().setUndefLabel("Par défaut");
|
|
|
104 |
// final ElementComboBox right = new ElementComboBox();
|
|
|
105 |
// right.setListIconVisible(false);
|
|
|
106 |
// this.addView(right, "ID_RIGHT");
|
|
|
107 |
// this.addView("HAVE_RIGHT");
|
|
|
108 |
// this.addView("OBJECT", "0");
|
|
|
109 |
// }
|
|
|
110 |
//
|
|
|
111 |
// @Override
|
|
|
112 |
// protected SQLRowValues createDefaults() {
|
|
|
113 |
// if (this.userID >= SQLRow.MIN_VALID_ID)
|
|
|
114 |
// return new SQLRowValues(getTable()).put("ID_USER_COMMON", this.userID);
|
|
|
115 |
// else
|
|
|
116 |
// return null;
|
|
|
117 |
// }
|
|
|
118 |
//
|
|
|
119 |
// public final void setUserID(int userID) {
|
|
|
120 |
// this.userID = userID;
|
|
|
121 |
// }
|
|
|
122 |
}
|
|
|
123 |
}
|