001: /*
002: * $Id$
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.struts2.views.jsp.ui;
022:
023: import javax.servlet.http.HttpServletRequest;
024: import javax.servlet.http.HttpServletResponse;
025:
026: import org.apache.struts2.components.Autocompleter;
027: import org.apache.struts2.components.Component;
028:
029: import com.opensymphony.xwork2.util.ValueStack;
030:
031: /**
032: * @see Autocompleter
033: */
034: public class AutocompleterTag extends ComboBoxTag {
035: private static final long serialVersionUID = -1112470447573172581L;
036:
037: protected String forceValidOption;
038: protected String searchType;
039: protected String autoComplete;
040: protected String delay;
041: protected String disabled;
042: protected String href;
043: protected String dropdownWidth;
044: protected String dropdownHeight;
045: protected String formId;
046: protected String formFilter;
047: protected String listenTopics;
048: protected String notifyTopics;
049: protected String indicator;
050: protected String loadOnTextChange;
051: protected String loadMinimumCount;
052: protected String showDownArrow;
053: protected String templateCssPath;
054: protected String iconPath;
055: protected String keyName;
056: protected String dataFieldName;
057: protected String resultsLimit;
058:
059: public Component getBean(ValueStack stack, HttpServletRequest req,
060: HttpServletResponse res) {
061: return new Autocompleter(stack, req, res);
062: }
063:
064: protected void populateParams() {
065: super .populateParams();
066:
067: Autocompleter autocompleter = (Autocompleter) component;
068: autocompleter.setAutoComplete(autoComplete);
069: autocompleter.setDisabled(disabled);
070: autocompleter.setForceValidOption(forceValidOption);
071: autocompleter.setHref(href);
072: autocompleter.setDelay(delay);
073: autocompleter.setSearchType(searchType);
074: autocompleter.setDropdownHeight(dropdownHeight);
075: autocompleter.setDropdownWidth(dropdownWidth);
076: autocompleter.setFormFilter(formFilter);
077: autocompleter.setFormId(formId);
078: autocompleter.setListenTopics(listenTopics);
079: autocompleter.setNotifyTopics(notifyTopics);
080: autocompleter.setIndicator(indicator);
081: autocompleter.setLoadMinimumCount(loadMinimumCount);
082: autocompleter.setLoadOnTextChange(loadOnTextChange);
083: autocompleter.setShowDownArrow(showDownArrow);
084: autocompleter.setTemplateCssPath(templateCssPath);
085: autocompleter.setIconPath(iconPath);
086: autocompleter.setKeyName(keyName);
087: autocompleter.setDataFieldName(dataFieldName);
088: autocompleter.setResultsLimit(resultsLimit);
089: }
090:
091: public void setAutoComplete(String autoComplete) {
092: this .autoComplete = autoComplete;
093: }
094:
095: public void setDisabled(String disabled) {
096: this .disabled = disabled;
097: }
098:
099: public void setForceValidOption(String forceValidOption) {
100: this .forceValidOption = forceValidOption;
101: }
102:
103: public void setHref(String href) {
104: this .href = href;
105: }
106:
107: public void setDelay(String searchDelay) {
108: this .delay = searchDelay;
109: }
110:
111: public void setSearchType(String searchType) {
112: this .searchType = searchType;
113: }
114:
115: public void setDropdownHeight(String height) {
116: this .dropdownHeight = height;
117: }
118:
119: public void setDropdownWidth(String width) {
120: this .dropdownWidth = width;
121: }
122:
123: public void setFormFilter(String formFilter) {
124: this .formFilter = formFilter;
125: }
126:
127: public void setFormId(String formId) {
128: this .formId = formId;
129: }
130:
131: public void setListenTopics(String listenTopics) {
132: this .listenTopics = listenTopics;
133: }
134:
135: public void setNotifyTopics(String onValueChangedPublishTopic) {
136: this .notifyTopics = onValueChangedPublishTopic;
137: }
138:
139: public void setIndicator(String indicator) {
140: this .indicator = indicator;
141: }
142:
143: public void setLoadMinimumCount(String loadMinimumCount) {
144: this .loadMinimumCount = loadMinimumCount;
145: }
146:
147: public String getLoadMinimumCount() {
148: return loadMinimumCount;
149: }
150:
151: public void setLoadOnTextChange(String loadOnTextChange) {
152: this .loadOnTextChange = loadOnTextChange;
153: }
154:
155: public void setShowDownArrow(String showDownArrow) {
156: this .showDownArrow = showDownArrow;
157: }
158:
159: public void setTemplateCssPath(String templateCssPath) {
160: this .templateCssPath = templateCssPath;
161: }
162:
163: public void setIconPath(String iconPath) {
164: this .iconPath = iconPath;
165: }
166:
167: public void setKeyName(String keyName) {
168: this .keyName = keyName;
169: }
170:
171: public void setDataFieldName(String dataFieldName) {
172: this .dataFieldName = dataFieldName;
173: }
174:
175: public void setResultsLimit(String resultsLimit) {
176: this.resultsLimit = resultsLimit;
177: }
178: }
|