KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > policyframework > ResourceItem


1 /*
2  */

3 package com.sslexplorer.policyframework;
4
5 import java.util.List JavaDoc;
6
7 import javax.servlet.http.HttpServletRequest JavaDoc;
8
9 import com.sslexplorer.core.CoreUtil;
10 import com.sslexplorer.table.TableItem;
11
12 /**
13  *
14  */

15 public class ResourceItem implements TableItem {
16
17     private Resource resource;
18     private List JavaDoc policies;
19     private String JavaDoc checked;
20     private String JavaDoc lastLaunchedPolicy;
21
22     public ResourceItem(Resource resource, List JavaDoc policies) {
23         this.resource = resource;
24         this.policies = policies;
25     }
26     
27     public String JavaDoc getLastLaunchedPolicy() {
28         return lastLaunchedPolicy;
29     }
30     
31     public boolean getMultiplePolicies() {
32         return policies.size() > 1;
33     }
34     
35     public String JavaDoc getFirstPolicyName() {
36         return policies.size() > 0 ? ((Policy)policies.get(0)).getResourceName() : "";
37     }
38     
39     public List JavaDoc getPolicies() {
40         return policies;
41     }
42
43     public Resource getResource() {
44         return resource;
45     }
46
47     public Object JavaDoc getColumnValue(int col) {
48         return resource.getResourceName() == null ? "<Unknown>" : resource.getResourceName();
49     }
50
51     public void setChecked(String JavaDoc checked) {
52         this.checked = checked;
53     }
54
55     public String JavaDoc getChecked() {
56         return checked;
57     }
58
59     public String JavaDoc getSmallIconPath(HttpServletRequest JavaDoc request) {
60         return CoreUtil.getThemePath(request.getSession()) + "/images/actions/resource.gif";
61     }
62
63     public String JavaDoc getLargeIconPath(HttpServletRequest JavaDoc request) {
64         return CoreUtil.getThemePath(request.getSession()) + "/images/actions/largeResource.gif";
65     }
66
67     public String JavaDoc getLargeIconAdditionalIcon(HttpServletRequest JavaDoc request) {
68         return "";
69     }
70
71     public String JavaDoc getLargeIconAdditionalText(HttpServletRequest JavaDoc request) {
72         return "";
73     }
74
75     public String JavaDoc getLink(int policy, HttpServletRequest JavaDoc request) {
76         return getLink(policy, null, request);
77     }
78
79     public String JavaDoc getLink(int policy, String JavaDoc referer, HttpServletRequest JavaDoc request) {
80         return "#";
81     }
82
83     public String JavaDoc getOnClick(int policy, HttpServletRequest JavaDoc request) {
84         return "";
85     }
86
87 }
88
Popular Tags