View Javadoc

1   /*
2    * $Id$
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  package org.apache.struts2.views.jsp.ui;
22  
23  import javax.servlet.http.HttpServletRequest;
24  import javax.servlet.http.HttpServletResponse;
25  
26  import org.apache.struts2.components.Autocompleter;
27  import org.apache.struts2.components.Component;
28  
29  import com.opensymphony.xwork2.util.ValueStack;
30  
31  /***
32   * @see Autocompleter
33   */
34  public class AutocompleterTag extends ComboBoxTag {
35      private static final long serialVersionUID = -1112470447573172581L;
36  
37      protected String forceValidOption;
38      protected String searchType;
39      protected String autoComplete;
40      protected String delay;
41      protected String disabled;
42      protected String href;
43      protected String dropdownWidth;
44      protected String dropdownHeight;
45      protected String formId;
46      protected String formFilter;
47      protected String listenTopics;
48      protected String notifyTopics;
49      protected String indicator;
50      protected String loadOnTextChange;
51      protected String loadMinimumCount;
52      protected String showDownArrow;
53      protected String templateCssPath;
54      protected String iconPath;
55      protected String keyName;
56      protected String dataFieldName;
57      protected String resultsLimit;
58      
59      public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
60          return new Autocompleter(stack, req, res);
61      }
62  
63      protected void populateParams() {
64          super.populateParams();
65  
66          Autocompleter autocompleter = (Autocompleter) component;
67          autocompleter.setAutoComplete(autoComplete);
68          autocompleter.setDisabled(disabled);
69          autocompleter.setForceValidOption(forceValidOption);
70          autocompleter.setHref(href);
71          autocompleter.setDelay(delay);
72          autocompleter.setSearchType(searchType);
73          autocompleter.setDropdownHeight(dropdownHeight);
74          autocompleter.setDropdownWidth(dropdownWidth);
75          autocompleter.setFormFilter(formFilter);
76          autocompleter.setFormId(formId);
77          autocompleter.setListenTopics(listenTopics);
78          autocompleter.setNotifyTopics(notifyTopics);
79          autocompleter.setIndicator(indicator);
80          autocompleter.setLoadMinimumCount(loadMinimumCount);
81          autocompleter.setLoadOnTextChange(loadOnTextChange);
82          autocompleter.setShowDownArrow(showDownArrow);
83          autocompleter.setTemplateCssPath(templateCssPath);
84          autocompleter.setIconPath(iconPath);
85          autocompleter.setKeyName(keyName);
86          autocompleter.setDataFieldName(dataFieldName);
87          autocompleter.setResultsLimit(resultsLimit);
88      }
89  
90      public void setAutoComplete(String autoComplete) {
91          this.autoComplete = autoComplete;
92      }
93  
94      public void setDisabled(String disabled) {
95          this.disabled = disabled;
96      }
97  
98      public void setForceValidOption(String forceValidOption) {
99          this.forceValidOption = forceValidOption;
100     }
101 
102     public void setHref(String href) {
103         this.href = href;
104     }
105 
106     public void setDelay(String searchDelay) {
107         this.delay = searchDelay;
108     }
109 
110     public void setSearchType(String searchType) {
111         this.searchType = searchType;
112     }
113 
114     public void setDropdownHeight(String height) {
115         this.dropdownHeight = height;
116     }
117 
118     public void setDropdownWidth(String width) {
119         this.dropdownWidth = width;
120     }
121 
122     public void setFormFilter(String formFilter) {
123       this.formFilter = formFilter;
124     }
125 
126     public void setFormId(String formId) {
127       this.formId = formId;
128     }
129 
130     public void setListenTopics(String listenTopics) {
131       this.listenTopics = listenTopics;
132     }
133 
134     public void setNotifyTopics(String onValueChangedPublishTopic) {
135       this.notifyTopics = onValueChangedPublishTopic;
136     }
137 
138     public void setIndicator(String indicator) {
139         this.indicator = indicator;
140     }
141 
142     public void setLoadMinimumCount(String loadMinimumCount) {
143         this.loadMinimumCount = loadMinimumCount;
144     }
145 
146     public String getLoadMinimumCount() {
147         return loadMinimumCount;
148     }
149 
150     public void setLoadOnTextChange(String loadOnTextChange) {
151         this.loadOnTextChange = loadOnTextChange;
152     }
153 
154     public void setShowDownArrow(String showDownArrow) {
155         this.showDownArrow = showDownArrow;
156     }
157 
158     public void setTemplateCssPath(String templateCssPath) {
159         this.templateCssPath = templateCssPath;
160     }
161     
162     public void setIconPath(String iconPath) {
163         this.iconPath = iconPath;
164     }
165 
166     public void setKeyName(String keyName) {
167         this.keyName = keyName;
168     }
169 
170     public void setDataFieldName(String dataFieldName) {
171         this.dataFieldName = dataFieldName;
172     }
173 
174     public void setResultsLimit(String resultsLimit) {
175         this.resultsLimit = resultsLimit;
176     }
177 }