View Javadoc
1   /*
2    * Copyright 2008 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.sys.document.web;
17  
18  import javax.servlet.jsp.JspException;
19  import javax.servlet.jsp.PageContext;
20  import javax.servlet.jsp.tagext.Tag;
21  
22  import org.kuali.ole.sys.document.web.renderers.StringRenderer;
23  
24  /**
25   * A renderable element which renders a literal label
26   */
27  public class LiteralHeaderLabel extends HeaderLabel {
28      private String literalLabel;
29      
30      /**
31       * Constructs a LiteralHeaderLabel, forcing the literalLabel to be passed in
32       * @param literalLabel the literal label to render
33       */
34      public LiteralHeaderLabel(String literalLabel) {
35          this.literalLabel = literalLabel;
36      }
37      
38      /**
39       * Uses StringRenderer to render the label
40       * @see org.kuali.ole.sys.document.web.RenderableElement#renderElement(javax.servlet.jsp.PageContext, javax.servlet.jsp.tagext.Tag, org.kuali.ole.sys.document.web.AccountingLineRenderingContext)
41       */
42      public void renderElement(PageContext pageContext, Tag parentTag, AccountingLineRenderingContext renderingContext) throws JspException {
43          StringRenderer renderer = new StringRenderer();
44          renderer.setStringToRender(literalLabel);
45          renderer.render(pageContext, parentTag);
46          renderer.clear();
47      }
48  
49  }