1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.taglib.ui;
16  
17  import com.liferay.taglib.util.IncludeTag;
18  
19  import javax.servlet.http.HttpServletRequest;
20  
21  /**
22   * <a href="InputEditorTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   */
26  public class InputEditorTag extends IncludeTag {
27  
28      public void setCssClass(String cssClass) {
29          _cssClass = cssClass;
30      }
31  
32      public void setEditorImpl(String editorImpl) {
33          _editorImpl = editorImpl;
34      }
35  
36      public void setHeight(String height) {
37          _height = height;
38      }
39  
40      public void setInitMethod(String initMethod) {
41          _initMethod = initMethod;
42      }
43  
44      public void setName(String name) {
45          _name = name;
46      }
47  
48      public void setOnChangeMethod(String onChangeMethod) {
49          _onChangeMethod = onChangeMethod;
50      }
51  
52      public void setToolbarSet(String toolbarSet) {
53          _toolbarSet = toolbarSet;
54      }
55  
56      public void setWidth(String width) {
57          _width = width;
58      }
59  
60      protected void cleanUp() {
61          _cssClass = null;
62          _editorImpl = null;
63          _height = null;
64          _initMethod = null;
65          _name = null;
66          _onChangeMethod = null;
67          _toolbarSet = null;
68          _width = null;
69      }
70  
71      protected String getPage() {
72          return _PAGE;
73      }
74  
75      protected void setAttributes(HttpServletRequest request) {
76          request.setAttribute("liferay-ui:input-editor:cssClass", _cssClass);
77          request.setAttribute("liferay-ui:input-editor:editorImpl", _editorImpl);
78          request.setAttribute("liferay-ui:input-editor:height", _height);
79          request.setAttribute("liferay-ui:input-editor:initMethod", _initMethod);
80          request.setAttribute("liferay-ui:input-editor:name", _name);
81          request.setAttribute(
82              "liferay-ui:input-editor:onChangeMethod", _onChangeMethod);
83          request.setAttribute("liferay-ui:input-editor:toolbarSet", _toolbarSet);
84          request.setAttribute("liferay-ui:input-editor:width", _width);
85      }
86  
87      private static final String _PAGE = "/html/taglib/ui/input_editor/page.jsp";
88  
89      private String _cssClass;
90      private String _editorImpl;
91      private String _height;
92      private String _initMethod;
93      private String _name;
94      private String _onChangeMethod;
95      private String _toolbarSet;
96      private String _width;
97  
98  }