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      
57      public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
58          return new Autocompleter(stack, req, res);
59      }
60  
61      protected void populateParams() {
62          super.populateParams();
63  
64          Autocompleter autocompleter = (Autocompleter) component;
65          autocompleter.setAutoComplete(autoComplete);
66          autocompleter.setDisabled(disabled);
67          autocompleter.setForceValidOption(forceValidOption);
68          autocompleter.setHref(href);
69          autocompleter.setDelay(delay);
70          autocompleter.setSearchType(searchType);
71          autocompleter.setDropdownHeight(dropdownHeight);
72          autocompleter.setDropdownWidth(dropdownWidth);
73          autocompleter.setFormFilter(formFilter);
74          autocompleter.setFormId(formId);
75          autocompleter.setListenTopics(listenTopics);
76          autocompleter.setNotifyTopics(notifyTopics);
77          autocompleter.setIndicator(indicator);
78          autocompleter.setLoadMinimumCount(loadMinimumCount);
79          autocompleter.setLoadOnTextChange(loadOnTextChange);
80          autocompleter.setShowDownArrow(showDownArrow);
81          autocompleter.setTemplateCssPath(templateCssPath);
82          autocompleter.setIconPath(iconPath);
83          autocompleter.setKeyName(keyName);
84      }
85  
86      public void setAutoComplete(String autoComplete) {
87          this.autoComplete = autoComplete;
88      }
89  
90      public void setDisabled(String disabled) {
91          this.disabled = disabled;
92      }
93  
94      public void setForceValidOption(String forceValidOption) {
95          this.forceValidOption = forceValidOption;
96      }
97  
98      public void setHref(String href) {
99          this.href = href;
100     }
101 
102     public void setDelay(String searchDelay) {
103         this.delay = searchDelay;
104     }
105 
106     public void setSearchType(String searchType) {
107         this.searchType = searchType;
108     }
109 
110     public void setDropdownHeight(String height) {
111         this.dropdownHeight = height;
112     }
113 
114     public void setDropdownWidth(String width) {
115         this.dropdownWidth = width;
116     }
117 
118     public void setFormFilter(String formFilter) {
119       this.formFilter = formFilter;
120     }
121 
122     public void setFormId(String formId) {
123       this.formId = formId;
124     }
125 
126     public void setListenTopics(String listenTopics) {
127       this.listenTopics = listenTopics;
128     }
129 
130     public void setNotifyTopics(String onValueChangedPublishTopic) {
131       this.notifyTopics = onValueChangedPublishTopic;
132     }
133 
134     public void setIndicator(String indicator) {
135         this.indicator = indicator;
136     }
137 
138     public void setLoadMinimumCount(String loadMinimumCount) {
139         this.loadMinimumCount = loadMinimumCount;
140     }
141 
142     public String getLoadMinimumCount() {
143         return loadMinimumCount;
144     }
145 
146     public void setLoadOnTextChange(String loadOnTextChange) {
147         this.loadOnTextChange = loadOnTextChange;
148     }
149 
150     public void setShowDownArrow(String showDownArrow) {
151         this.showDownArrow = showDownArrow;
152     }
153 
154     public void setTemplateCssPath(String templateCssPath) {
155         this.templateCssPath = templateCssPath;
156     }
157     
158     public void setIconPath(String iconPath) {
159         this.iconPath = iconPath;
160     }
161 
162     public void setKeyName(String keyName) {
163         this.keyName = keyName;
164     }
165 }