BrightSide Workbench Full Report + Source Code
RequiredAptitudeListbox.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Affero General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
14
*
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
package
org.turro.erp.resource;
19
20
import
org.turro.elephant.context.Application;
21
import
org.turro.elephant.util.DecimalFormats;
22
import
org.turro.erp.entity.AptitudeDegree;
23
import
org.turro.erp.entity.Resource;
24
import
org.turro.zkoss.input.CollectionListbox;
25
import
org.turro.zkoss.layout.ListheaderAdapter;
26
import
org.turro.zkoss.layout.ListheaderRightAdapter;
27
import
org.zkoss.zul.Listhead;
28
33
public
class
RequiredAptitudeListbox
extends
CollectionListbox
<AptitudeDegree> {
34
35
private
Resource
resource;
36
37
public
Resource
getResource
() {
38
return
resource;
39
}
40
41
public
void
setResource
(
Resource
resource) {
42
this.resource = resource;
43
setCollection
(resource.
getAptitudeDegrees
());
44
}
45
46
@Override
47
protected
String
convertToString
(
AptitudeDegree
v) {
48
return
v.
getFullName
() +
ITEM_SEPARATOR
+
49
DecimalFormats
.
format
(v.
getCost
()) +
ITEM_SEPARATOR
+
50
DecimalFormats
.
format
(v.
getPrice
());
51
}
52
53
@Override
54
public
void
afterCompose
() {
55
addHeaders();
56
super.afterCompose();
57
}
58
59
private
void
addHeaders() {
60
if
(getListhead() !=
null
)
return
;
61
Listhead lh =
new
Listhead();
62
lh.setSizable(
true
);
63
lh.appendChild(
new
ListheaderAdapter
(
Application
.
getString
(
"lAptitude"
),
"3"
));
64
lh.appendChild(
new
ListheaderRightAdapter
(
Application
.
getString
(
"lCost"
),
"1"
));
65
lh.appendChild(
new
ListheaderRightAdapter
(
Application
.
getString
(
"lPrice"
),
"1"
));
66
appendChild(lh);
67
}
68
69
}
70
org.turro.elephant.context.Application
Definition:
Application.java:49
org.turro.elephant.context.Application.getString
static String getString(String key)
Definition:
Application.java:302
org.turro.elephant.util.DecimalFormats
Definition:
DecimalFormats.java:28
org.turro.elephant.util.DecimalFormats.format
static String format(Number value, String pattern)
Definition:
DecimalFormats.java:30
org.turro.erp.entity.AptitudeDegree
Definition:
AptitudeDegree.java:31
org.turro.erp.entity.AptitudeDegree.getCost
double getCost()
Definition:
AptitudeDegree.java:47
org.turro.erp.entity.AptitudeDegree.getFullName
String getFullName()
Definition:
AptitudeDegree.java:119
org.turro.erp.entity.AptitudeDegree.getPrice
double getPrice()
Definition:
AptitudeDegree.java:95
org.turro.erp.entity.Resource
Definition:
Resource.java:31
org.turro.erp.entity.Resource.getAptitudeDegrees
Set< AptitudeDegree > getAptitudeDegrees()
Definition:
Resource.java:98
org.turro.erp.resource.RequiredAptitudeListbox
Definition:
RequiredAptitudeListbox.java:33
org.turro.erp.resource.RequiredAptitudeListbox.setResource
void setResource(Resource resource)
Definition:
RequiredAptitudeListbox.java:41
org.turro.erp.resource.RequiredAptitudeListbox.convertToString
String convertToString(AptitudeDegree v)
Definition:
RequiredAptitudeListbox.java:47
org.turro.erp.resource.RequiredAptitudeListbox.afterCompose
void afterCompose()
Definition:
RequiredAptitudeListbox.java:54
org.turro.erp.resource.RequiredAptitudeListbox.getResource
Resource getResource()
Definition:
RequiredAptitudeListbox.java:37
org.turro.zkoss.input.CollectionListbox
Definition:
CollectionListbox.java:32
org.turro.zkoss.input.CollectionListbox.setCollection
void setCollection(Collection< V > collection)
Definition:
CollectionListbox.java:74
org.turro.zkoss.input.CollectionListbox.ITEM_SEPARATOR
static final String ITEM_SEPARATOR
Definition:
CollectionListbox.java:34
org.turro.zkoss.layout.ListheaderAdapter
Definition:
ListheaderAdapter.java:26
org.turro.zkoss.layout.ListheaderRightAdapter
Definition:
ListheaderRightAdapter.java:24
TurroProjects
Public
BrightSide
bserp-www
src
main
java
org
turro
erp
resource
RequiredAptitudeListbox.java
Generated on Tue Mar 12 2024 07:01:20 for BrightSide by
1.9.1