1 package com.sslexplorer.security; 2 3 import javax.servlet.http.HttpServletRequest ; 4 5 import com.sslexplorer.core.CoreUtil; 6 import com.sslexplorer.table.TableItem; 7 8 9 15 public class IpRestrictionItem implements TableItem { 16 17 19 private IpRestriction ipRestriction; 20 private boolean canMoveUp, canMoveDown, canDelete; 21 22 23 31 public IpRestrictionItem(IpRestriction ipRestriction, boolean canMoveUp, boolean canMoveDown, boolean canDelete) { 32 this.ipRestriction = ipRestriction; 33 this.canMoveUp = canMoveUp; 34 this.canMoveDown = canMoveDown; 35 this.canDelete = canDelete; 36 } 37 38 44 public boolean isCanDelete() { 45 return canDelete; 46 } 47 48 54 public boolean isCanMoveUp() { 55 return canMoveUp; 56 } 57 58 64 public boolean isCanMoveDown() { 65 return canMoveDown; 66 } 67 68 73 public Object getColumnValue(int col) { 74 switch (col) { 75 case 0: 76 return ipRestriction.getAddress(); 77 default: 78 return new Boolean ("true"); 79 } 80 } 81 82 87 public IpRestriction getIpRestriction() { 88 return ipRestriction; 89 } 90 91 public String getSmallIconPath(HttpServletRequest request) { 92 if (ipRestriction.getAllowed()){ 93 return CoreUtil.getThemePath(request.getSession()) + "/images/actions/allowed.gif"; 94 } 95 else { 96 return CoreUtil.getThemePath(request.getSession()) + "/images/actions/denied.gif"; 97 } 98 } 99 100 } 101 | Popular Tags |