01: /*
02: * Copyright 2006 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * 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, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.user.client.ui;
17:
18: /**
19: * A widget that implements this interface can receive keyboard focus.
20: */
21: public interface HasFocus extends SourcesFocusEvents,
22: SourcesKeyboardEvents {
23:
24: /**
25: * Gets the widget's position in the tab index.
26: *
27: * @return the widget's tab index
28: */
29: public int getTabIndex();
30:
31: /**
32: * Sets the widget's 'access key'. This key is used (in conjunction with a
33: * browser-specific modifier key) to automatically focus the widget.
34: *
35: * @param key the widget's access key
36: */
37: public void setAccessKey(char key);
38:
39: /**
40: * Explicitly focus/unfocus this widget. Only one widget can have focus at a
41: * time, and the widget that does will receive all keyboard events.
42: *
43: * @param focused whether this widget should take focus or release it
44: */
45: public void setFocus(boolean focused);
46:
47: /**
48: * Sets the widget's position in the tab index. If more than one widget has
49: * the same tab index, each such widget will receive focus in an arbitrary
50: * order. Setting the tab index to <code>-1</code> will cause this widget to
51: * be removed from the tab order.
52: *
53: * @param index the widget's tab index
54: */
55: public void setTabIndex(int index);
56: }
|