01: /*
02: * $Id$ $Revision$ $Date$
03: *
04: * ==============================================================================
05: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
06: * use this file except in compliance with the License. You may obtain a copy of
07: * the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14: * License for the specific language governing permissions and limitations under
15: * the License.
16: */
17: package wicket.extensions.ajax.markup.html;
18:
19: import wicket.ajax.IAjaxIndicatorAware;
20: import wicket.ajax.markup.html.AjaxLink;
21: import wicket.model.IModel;
22:
23: /**
24: * A variant of the {@link AjaxLink} that displays a busy indicator while the
25: * ajax request is in progress.
26: *
27: * @since 1.2
28: *
29: * @author Igor Vaynberg (ivaynberg)
30: *
31: */
32: public abstract class IndicatingAjaxLink extends AjaxLink implements
33: IAjaxIndicatorAware {
34: private final WicketAjaxIndicatorAppender indicatorAppender = new WicketAjaxIndicatorAppender();
35:
36: /**
37: * Constructor
38: * @param id
39: */
40: public IndicatingAjaxLink(String id) {
41: this (id, null);
42: }
43:
44: /**
45: * Constructor
46: * @param id
47: * @param model
48: */
49: public IndicatingAjaxLink(String id, IModel model) {
50: super (id, model);
51: add(indicatorAppender);
52: }
53:
54: /**
55: * @see wicket.ajax.IAjaxIndicatorAware#getAjaxIndicatorMarkupId()
56: */
57: public String getAjaxIndicatorMarkupId() {
58: return indicatorAppender.getMarkupId();
59: }
60:
61: }
|