1*8622218dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*8622218dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*8622218dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*8622218dSAndrew Rist  * distributed with this work for additional information
6*8622218dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*8622218dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*8622218dSAndrew Rist  * "License"); you may not use this file except in compliance
9*8622218dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*8622218dSAndrew Rist  *
11*8622218dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*8622218dSAndrew Rist  *
13*8622218dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*8622218dSAndrew Rist  * software distributed under the License is distributed on an
15*8622218dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*8622218dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*8622218dSAndrew Rist  * specific language governing permissions and limitations
18*8622218dSAndrew Rist  * under the License.
19*8622218dSAndrew Rist  *
20*8622218dSAndrew Rist  *************************************************************/
21*8622218dSAndrew Rist 
22*8622218dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir package org.openoffice.java.accessibility;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import com.sun.star.accessibility.XAccessibleAction;
27cdf0e10cSrcweir 
28cdf0e10cSrcweir /** The AccessibleActionWrapper maps the calls to the java AccessibleAction interface
29cdf0e10cSrcweir  *  to the corresponding methods of the UNO XAccessibleAction interface.
30cdf0e10cSrcweir  */
31cdf0e10cSrcweir public class AccessibleActionImpl implements javax.accessibility.AccessibleAction {
32cdf0e10cSrcweir 
33cdf0e10cSrcweir     protected XAccessibleAction unoObject;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir     /** Creates new AccessibleActionWrapper */
AccessibleActionImpl(XAccessibleAction xAccessibleAction)36cdf0e10cSrcweir     public AccessibleActionImpl(XAccessibleAction xAccessibleAction) {
37cdf0e10cSrcweir         unoObject = xAccessibleAction;
38cdf0e10cSrcweir     }
39cdf0e10cSrcweir 
doAccessibleAction(int param)40cdf0e10cSrcweir     public boolean doAccessibleAction(int param) {
41cdf0e10cSrcweir         try {
42cdf0e10cSrcweir             return unoObject.doAccessibleAction(param);
43cdf0e10cSrcweir         } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
44cdf0e10cSrcweir             return false;
45cdf0e10cSrcweir         } catch (com.sun.star.uno.RuntimeException e) {
46cdf0e10cSrcweir             return false;
47cdf0e10cSrcweir         }
48cdf0e10cSrcweir     }
49cdf0e10cSrcweir 
getAccessibleActionDescription(int param)50cdf0e10cSrcweir     public java.lang.String getAccessibleActionDescription(int param) {
51cdf0e10cSrcweir         try {
52cdf0e10cSrcweir             return unoObject.getAccessibleActionDescription(param);
53cdf0e10cSrcweir         } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
54cdf0e10cSrcweir             return null;
55cdf0e10cSrcweir         } catch (com.sun.star.uno.RuntimeException e) {
56cdf0e10cSrcweir             return null;
57cdf0e10cSrcweir         }
58cdf0e10cSrcweir     }
59cdf0e10cSrcweir 
getAccessibleActionCount()60cdf0e10cSrcweir     public int getAccessibleActionCount() {
61cdf0e10cSrcweir         try {
62cdf0e10cSrcweir             return unoObject.getAccessibleActionCount();
63cdf0e10cSrcweir         } catch (com.sun.star.uno.RuntimeException e) {
64cdf0e10cSrcweir             return 0;
65cdf0e10cSrcweir         }
66cdf0e10cSrcweir     }
67cdf0e10cSrcweir }
68