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