1 25 26 29 30 package net.killingar.forum.tags; 31 32 import net.killingar.forum.internal.managers.ForumManager; 33 import net.killingar.forum.internal.managers.OptionsManager; 34 35 import javax.servlet.jsp.JspException ; 36 import javax.servlet.jsp.JspTagException ; 37 38 public class IndentTag extends webwork.view.taglib.WebWorkTagSupport 39 { 40 protected String valueAttr = "indent"; 42 44 public void setValue(String in) { valueAttr = in; } 46 48 public int doStartTag() throws JspException 50 { 51 try 52 { 53 Integer value = (Integer )findValue(valueAttr); 54 55 if (value == null) 56 { 57 return SKIP_BODY; 58 } 59 else 60 { 61 ForumManager manager = (ForumManager)pageContext.getSession().getAttribute("manager"); 62 String s = ((OptionsManager)manager.getManager(OptionsManager.class.getName())).get("area indent size", "20"); 63 64 int indentSize = Integer.parseInt(s); 65 pageContext.getOut().print(indentSize*value.intValue()); 66 67 } 70 } 71 catch (Exception e) 72 { 73 e.printStackTrace(); 74 throw new JspTagException ("Could not show value " + valueAttr + ":" + e); 75 } 76 77 return SKIP_BODY; 78 } 79 } | Popular Tags |