001: /*
002: * $Id: TreeTag.java 471756 2006-11-06 15:01:43Z husted $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.struts2.views.jsp.ui;
022:
023: import javax.servlet.http.HttpServletRequest;
024: import javax.servlet.http.HttpServletResponse;
025:
026: import org.apache.struts2.components.Component;
027: import org.apache.struts2.components.Tree;
028:
029: import com.opensymphony.xwork2.util.ValueStack;
030:
031: /**
032: * @see Tree
033: */
034: public class TreeTag extends AbstractClosingTag {
035:
036: private static final long serialVersionUID = 2735218501058548013L;
037:
038: private String toggle;
039: private String treeSelectedTopic;
040: private String treeExpandedTopic;
041: private String treeCollapsedTopic;
042: private String rootNode;
043: private String childCollectionProperty;
044: private String nodeTitleProperty;
045: private String nodeIdProperty;
046: private String showRootGrid;
047:
048: private String showGrid;
049: private String blankIconSrc;
050: private String gridIconSrcL;
051: private String gridIconSrcV;
052: private String gridIconSrcP;
053: private String gridIconSrcC;
054: private String gridIconSrcX;
055: private String gridIconSrcY;
056: private String expandIconSrcPlus;
057: private String expandIconSrcMinus;
058: private String iconWidth;
059: private String iconHeight;
060: private String toggleDuration;
061: private String templateCssPath;
062:
063: public Component getBean(ValueStack stack, HttpServletRequest req,
064: HttpServletResponse res) {
065: return new Tree(stack, req, res);
066: }
067:
068: protected void populateParams() {
069: super .populateParams();
070:
071: Tree tree = (Tree) component;
072: if (childCollectionProperty != null)
073: tree.setChildCollectionProperty(childCollectionProperty);
074: if (nodeIdProperty != null)
075: tree.setNodeIdProperty(nodeIdProperty);
076: if (nodeTitleProperty != null)
077: tree.setNodeTitleProperty(nodeTitleProperty);
078: if (rootNode != null)
079: tree.setRootNode(rootNode);
080: if (toggle != null)
081: tree.setToggle(toggle);
082: if (treeCollapsedTopic != null)
083: tree.setTreeCollapsedTopic(treeCollapsedTopic);
084: if (treeExpandedTopic != null)
085: tree.setTreeExpandedTopic(treeExpandedTopic);
086: if (treeSelectedTopic != null)
087: tree.setTreeSelectedTopic(treeSelectedTopic);
088: if (showRootGrid != null)
089: tree.setShowRootGrid(showRootGrid);
090:
091: if (showGrid != null)
092: tree.setShowGrid(showGrid);
093: if (blankIconSrc != null)
094: tree.setBlankIconSrc(blankIconSrc);
095: if (gridIconSrcL != null)
096: tree.setGridIconSrcL(gridIconSrcC);
097: if (gridIconSrcV != null)
098: tree.setGridIconSrcV(gridIconSrcV);
099: if (gridIconSrcP != null)
100: tree.setGridIconSrcP(gridIconSrcP);
101: if (gridIconSrcC != null)
102: tree.setGridIconSrcC(gridIconSrcC);
103: if (gridIconSrcX != null)
104: tree.setGridIconSrcX(gridIconSrcX);
105: if (gridIconSrcY != null)
106: tree.setGridIconSrcY(gridIconSrcY);
107: if (expandIconSrcPlus != null)
108: tree.setExpandIconSrcPlus(expandIconSrcPlus);
109: if (expandIconSrcMinus != null)
110: tree.setExpandIconSrcMinus(expandIconSrcMinus);
111: if (iconWidth != null)
112: tree.setIconWidth(iconWidth);
113: if (iconHeight != null)
114: tree.setIconHeight(iconHeight);
115: if (toggleDuration != null)
116: tree.setToggleDuration(toggleDuration);
117: if (templateCssPath != null)
118: tree.setTemplateCssPath(templateCssPath);
119: }
120:
121: public String getToggle() {
122: return toggle;
123: }
124:
125: public void setToggle(String toggle) {
126: this .toggle = toggle;
127: }
128:
129: public String getTreeSelectedTopic() {
130: return treeSelectedTopic;
131: }
132:
133: public void setTreeSelectedTopic(String treeSelectedTopic) {
134: this .treeSelectedTopic = treeSelectedTopic;
135: }
136:
137: public String getTreeExpandedTopic() {
138: return treeExpandedTopic;
139: }
140:
141: public void setTreeExpandedTopic(String treeExpandedTopic) {
142: this .treeExpandedTopic = treeExpandedTopic;
143: }
144:
145: public String getTreeCollapsedTopic() {
146: return treeCollapsedTopic;
147: }
148:
149: public void setTreeCollapsedTopic(String treeCollapsedTopic) {
150: this .treeCollapsedTopic = treeCollapsedTopic;
151: }
152:
153: public String getRootNode() {
154: return rootNode;
155: }
156:
157: public void setRootNode(String rootNode) {
158: this .rootNode = rootNode;
159: }
160:
161: public String getChildCollectionProperty() {
162: return childCollectionProperty;
163: }
164:
165: public void setChildCollectionProperty(
166: String childCollectionProperty) {
167: this .childCollectionProperty = childCollectionProperty;
168: }
169:
170: public String getNodeTitleProperty() {
171: return nodeTitleProperty;
172: }
173:
174: public void setNodeTitleProperty(String nodeTitleProperty) {
175: this .nodeTitleProperty = nodeTitleProperty;
176: }
177:
178: public String getNodeIdProperty() {
179: return nodeIdProperty;
180: }
181:
182: public void setNodeIdProperty(String nodeIdProperty) {
183: this .nodeIdProperty = nodeIdProperty;
184: }
185:
186: public String getShowRootGrid() {
187: return showRootGrid;
188: }
189:
190: public void setShowRootGrid(String showRootGrid) {
191: this .showRootGrid = showRootGrid;
192: }
193:
194: public String getBlankIconSrc() {
195: return blankIconSrc;
196: }
197:
198: public void setBlankIconSrc(String blankIconSrc) {
199: this .blankIconSrc = blankIconSrc;
200: }
201:
202: public String getExpandIconSrcMinus() {
203: return expandIconSrcMinus;
204: }
205:
206: public void setExpandIconSrcMinus(String expandIconSrcMinus) {
207: this .expandIconSrcMinus = expandIconSrcMinus;
208: }
209:
210: public String getExpandIconSrcPlus() {
211: return expandIconSrcPlus;
212: }
213:
214: public void setExpandIconSrcPlus(String expandIconSrcPlus) {
215: this .expandIconSrcPlus = expandIconSrcPlus;
216: }
217:
218: public String getGridIconSrcC() {
219: return gridIconSrcC;
220: }
221:
222: public void setGridIconSrcC(String gridIconSrcC) {
223: this .gridIconSrcC = gridIconSrcC;
224: }
225:
226: public String getGridIconSrcL() {
227: return gridIconSrcL;
228: }
229:
230: public void setGridIconSrcL(String gridIconSrcL) {
231: this .gridIconSrcL = gridIconSrcL;
232: }
233:
234: public String getGridIconSrcP() {
235: return gridIconSrcP;
236: }
237:
238: public void setGridIconSrcP(String gridIconSrcP) {
239: this .gridIconSrcP = gridIconSrcP;
240: }
241:
242: public String getGridIconSrcV() {
243: return gridIconSrcV;
244: }
245:
246: public void setGridIconSrcV(String gridIconSrcV) {
247: this .gridIconSrcV = gridIconSrcV;
248: }
249:
250: public String getGridIconSrcX() {
251: return gridIconSrcX;
252: }
253:
254: public void setGridIconSrcX(String gridIconSrcX) {
255: this .gridIconSrcX = gridIconSrcX;
256: }
257:
258: public String getGridIconSrcY() {
259: return gridIconSrcY;
260: }
261:
262: public void setGridIconSrcY(String gridIconSrcY) {
263: this .gridIconSrcY = gridIconSrcY;
264: }
265:
266: public String getIconHeight() {
267: return iconHeight;
268: }
269:
270: public void setIconHeight(String iconHeight) {
271: this .iconHeight = iconHeight;
272: }
273:
274: public String getIconWidth() {
275: return iconWidth;
276: }
277:
278: public void setIconWidth(String iconWidth) {
279: this .iconWidth = iconWidth;
280: }
281:
282: public String getTemplateCssPath() {
283: return templateCssPath;
284: }
285:
286: public void setTemplateCssPath(String templateCssPath) {
287: this .templateCssPath = templateCssPath;
288: }
289:
290: public String getToggleDuration() {
291: return toggleDuration;
292: }
293:
294: public void setToggleDuration(String toggleDuration) {
295: this .toggleDuration = toggleDuration;
296: }
297:
298: public String getShowGrid() {
299: return showGrid;
300: }
301:
302: public void setShowGrid(String showGrid) {
303: this.showGrid = showGrid;
304: }
305: }
|