01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of 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,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * @author Dennis Ushakov
20: * @version $Revision$
21: */package javax.accessibility;
22:
23: public class AccessibleRelation extends AccessibleBundle {
24: public static final String LABEL_FOR = "labelFor"; //$NON-NLS-1$
25: public static final String LABELED_BY = "labeledBy"; //$NON-NLS-1$
26: public static final String MEMBER_OF = "memberOf"; //$NON-NLS-1$
27: public static final String CONTROLLER_FOR = "controllerFor"; //$NON-NLS-1$
28: public static final String CONTROLLED_BY = "controlledBy"; //$NON-NLS-1$
29: public static final String FLOWS_TO = "flowsTo"; //$NON-NLS-1$
30: public static final String FLOWS_FROM = "flowsFrom"; //$NON-NLS-1$
31: public static final String SUBWINDOW_OF = "subwindowOf"; //$NON-NLS-1$
32: public static final String PARENT_WINDOW_OF = "parentWindowOf"; //$NON-NLS-1$
33: public static final String EMBEDS = "embeds"; //$NON-NLS-1$
34: public static final String EMBEDDED_BY = "embeddedBy"; //$NON-NLS-1$
35: public static final String CHILD_NODE_OF = "childNodeOf"; //$NON-NLS-1$
36: public static final String LABEL_FOR_PROPERTY = "labelForProperty"; //$NON-NLS-1$
37: public static final String LABELED_BY_PROPERTY = "labeledByProperty"; //$NON-NLS-1$
38: public static final String MEMBER_OF_PROPERTY = "memberOfProperty"; //$NON-NLS-1$
39: public static final String CONTROLLER_FOR_PROPERTY = "controllerForProperty"; //$NON-NLS-1$
40: public static final String CONTROLLED_BY_PROPERTY = "controlledByProperty"; //$NON-NLS-1$
41: public static final String FLOWS_TO_PROPERTY = "flowsToProperty"; //$NON-NLS-1$
42: public static final String FLOWS_FROM_PROPERTY = "flowsFromProperty"; //$NON-NLS-1$
43: public static final String SUBWINDOW_OF_PROPERTY = "subwindowOfProperty"; //$NON-NLS-1$
44: public static final String PARENT_WINDOW_OF_PROPERTY = "parentWindowOfProperty"; //$NON-NLS-1$
45: public static final String EMBEDS_PROPERTY = "embedsProperty"; //$NON-NLS-1$
46: public static final String EMBEDDED_BY_PROPERTY = "embeddedByProperty"; //$NON-NLS-1$
47: public static final String CHILD_NODE_OF_PROPERTY = "childNodeOfProperty"; //$NON-NLS-1$
48:
49: private Object[] targets;
50:
51: public AccessibleRelation(final String key) {
52: this .key = key;
53: targets = new Object[0];
54: }
55:
56: public AccessibleRelation(final String key, final Object target) {
57: this .key = key;
58: setTarget(target);
59: }
60:
61: public AccessibleRelation(final String key, final Object[] target) {
62: this .key = key;
63: setTarget(target);
64: }
65:
66: public String getKey() {
67: return key;
68: }
69:
70: public Object[] getTarget() {
71: return targets.clone();
72: }
73:
74: public void setTarget(final Object target) {
75: targets = new Object[] { target };
76: }
77:
78: public void setTarget(final Object[] target) {
79: targets = target != null ? (Object[]) target.clone()
80: : new Object[0];
81: }
82: }
|