1 19 20 package com.sslexplorer.core; 21 22 import javax.servlet.jsp.PageContext ; 23 24 import org.apache.struts.taglib.tiles.ComponentConstants; 25 import org.apache.struts.tiles.ComponentContext; 26 27 32 public abstract class AbstractPanel implements Panel { 33 34 private int placement; 36 private int weight; 37 private String id; 38 private String includePath; 39 private String includeAttribute; 40 private String bundle; 41 private boolean closeable; 42 private boolean minimizable; 43 private boolean dragable; 44 private boolean dropable; 45 private String defaultFrameState = FRAME_NORMAL; 46 47 62 public AbstractPanel(String id, int placement, int weight, String includePath, String includeAttribute, String bundle, boolean minimizable, boolean closeable, boolean dragable, boolean dropable) { 63 super(); 64 this.id = id; 65 this.placement = placement; 66 this.weight = weight; 67 this.includePath = includePath; 68 this.includeAttribute = includeAttribute; 69 this.bundle = bundle; 70 this.minimizable = minimizable; 71 this.closeable = closeable; 72 this.dragable = dragable; 73 this.dropable = dropable; 74 defaultFrameState = FRAME_NORMAL; 75 } 76 77 80 public boolean isDropable() { 81 return dropable; 82 } 83 84 87 public boolean isDragable() { 88 return dragable; 89 } 90 91 94 public int getPlacement() { 95 return placement; 96 } 97 98 101 public int getWeight() { 102 return weight; 103 } 104 105 108 public String getId() { 109 return id; 110 } 111 112 115 public String getBundle() { 116 return bundle; 117 } 118 119 122 public String getTileIncludePath(PageContext pageContext) { 123 if(includePath != null) { 124 return includePath; 125 } 126 ComponentContext cc = ((ComponentContext) pageContext.getAttribute( 127 ComponentConstants.COMPONENT_CONTEXT, 128 PageContext.REQUEST_SCOPE)); 129 return (String )cc.getAttribute(includeAttribute); 130 } 131 132 135 public boolean isCloseable() { 136 return closeable; 137 } 138 139 142 public String getDefaultFrameState() { 143 return defaultFrameState; 144 } 145 146 151 public void setDefaultFrameState(String defaultFrameState) { 152 this.defaultFrameState = defaultFrameState; 153 } 154 157 public void setDragable(boolean dragable) { 158 this.dragable = dragable; 159 160 } 161 164 public void setDropable(boolean dropable) { 165 this.dropable = dropable; 166 } 167 168 171 public boolean isMinimizable() { 172 return minimizable; 173 } 174 175 178 public void setMinimizable(boolean minimizable) { 179 this.minimizable = minimizable; 180 } 181 182 } 183 | Popular Tags |