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.portal.kernel.dao.search.DisplayTerms;
18  import com.liferay.taglib.util.IncludeTag;
19  
20  import javax.servlet.http.HttpServletRequest;
21  
22  /**
23   * <a href="SearchToggleTag.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public class SearchToggleTag extends IncludeTag {
28  
29      public void setButtonLabel(String buttonLabel) {
30          _buttonLabel = buttonLabel;
31      }
32  
33      public void setDisplayTerms(DisplayTerms displayTerms) {
34          _displayTerms = displayTerms;
35      }
36  
37      public void setId(String id) {
38          _id = id;
39      }
40  
41      protected void cleanUp() {
42          _buttonLabel = null;
43          _displayTerms = null;
44          _id = null;
45      }
46  
47      protected String getEndPage() {
48          return _END_PAGE;
49      }
50  
51      protected String getStartPage() {
52          return _START_PAGE;
53      }
54  
55      protected void setAttributes(HttpServletRequest request) {
56          request.setAttribute(
57              "liferay-ui:search-toggle:buttonLabel", _buttonLabel);
58          request.setAttribute(
59              "liferay-ui:search-toggle:displayTerms", _displayTerms);
60          request.setAttribute("liferay-ui:search-toggle:id", _id);
61      }
62  
63      private static final String _END_PAGE =
64          "/html/taglib/ui/search_toggle/end.jsp";
65  
66      private static final String _START_PAGE =
67          "/html/taglib/ui/search_toggle/start.jsp";
68  
69      private String _buttonLabel;
70      private DisplayTerms _displayTerms;
71      private String _id;
72  
73  }