01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.http;
16:
17: import java.io.Serializable;
18:
19: /**
20: * Filter that takes care of saving and restoring the browser window scroll position
21: * between requests.
22: *
23: * @author Taimo Peelo (taimo@araneaframework.org)
24: */
25: public interface WindowScrollPositionContext extends Serializable {
26: public static final String WINDOW_SCROLL_X_KEY = "windowScrollX";
27: public static final String WINDOW_SCROLL_Y_KEY = "windowScrollY";
28:
29: /** Resets all remembered the scroll coordinates.
30: * ({@link WindowScrollPositionContext#pop()} will not have any further effect). */
31: void reset();
32:
33: /**
34: * Resets currently active scroll coordinates.
35: * @since 1.1
36: */
37: void resetCurrent();
38:
39: /**
40: * Resets the current scroll coordinates, which can be restored with {@link WindowScrollPositionContext#pop}.
41: * @since 1.1
42: */
43: void push();
44:
45: /**
46: * Restores the previously pushed scroll coordinates.
47: * @since 1.1
48: * */
49: void pop();
50:
51: /** Returns the current horizontal scroll coordinate. */
52: public String getX();
53:
54: /** Returns the current vertical scroll coordinate. */
55: public String getY();
56:
57: /**
58: * Sets new horizontal and vertical scroll coordinates.
59: * @param x horizontal scroll coordinate
60: * @param y vertical scroll coordinate
61: */
62: public void scrollTo(String x, String y);
63: }
|