1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package org.openoffice.java.accessibility; 25 26 import javax.accessibility.AccessibleState; 27 28 import com.sun.star.uno.*; 29 import com.sun.star.accessibility.*; 30 31 public class Dialog extends java.awt.Dialog implements javax.accessibility.Accessible, NativeFrame { 32 protected XAccessibleComponent unoAccessibleComponent; 33 34 boolean opened = false; 35 boolean visible = false; 36 boolean active = false; 37 38 java.awt.EventQueue eventQueue = null; 39 Dialog(java.awt.Frame owner, XAccessibleComponent xAccessibleComponent)40 protected Dialog(java.awt.Frame owner, XAccessibleComponent xAccessibleComponent) { 41 super(owner); 42 initialize(xAccessibleComponent); 43 } 44 Dialog(java.awt.Frame owner, String name, XAccessibleComponent xAccessibleComponent)45 protected Dialog(java.awt.Frame owner, String name, XAccessibleComponent xAccessibleComponent) { 46 super(owner, name); 47 initialize(xAccessibleComponent); 48 } 49 Dialog(java.awt.Frame owner, String name, boolean modal, XAccessibleComponent xAccessibleComponent)50 protected Dialog(java.awt.Frame owner, String name, boolean modal, XAccessibleComponent xAccessibleComponent) { 51 super(owner, name, modal); 52 initialize(xAccessibleComponent); 53 } 54 initialize(XAccessibleComponent xAccessibleComponent)55 private void initialize(XAccessibleComponent xAccessibleComponent) { 56 unoAccessibleComponent = xAccessibleComponent; 57 eventQueue = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue(); 58 XAccessibleEventBroadcaster broadcaster = (XAccessibleEventBroadcaster) 59 UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class, 60 xAccessibleComponent); 61 if (broadcaster != null) { 62 broadcaster.addEventListener(new AccessibleDialogListener()); 63 } 64 } 65 66 java.awt.Component initialComponent = null; 67 getInitialComponent()68 public java.awt.Component getInitialComponent() { 69 return initialComponent; 70 } 71 setInitialComponent(java.awt.Component c)72 public void setInitialComponent(java.awt.Component c) { 73 initialComponent = c; 74 } 75 getHWND()76 public Integer getHWND() { 77 return null; 78 } 79 80 /** 81 * Determines whether this <code>Component</code> is showing on screen. 82 * This means that the component must be visible, and it must be in a 83 * <code>container</code> that is visible and showing. 84 * @see #addNotify 85 * @see #removeNotify 86 * @since JDK1.0 87 */ isShowing()88 public boolean isShowing() { 89 if (isVisible()) { 90 java.awt.Container parent = getParent(); 91 return (parent == null) || parent.isShowing(); 92 } 93 return false; 94 } 95 96 /** 97 * Makes this <code>Component</code> displayable by connecting it to a 98 * native screen resource. 99 * This method is called internally by the toolkit and should 100 * not be called directly by programs. 101 * @see #isDisplayable 102 * @see #removeNotify 103 * @since JDK1.0 104 */ addNotify()105 public void addNotify() { 106 // createHierarchyEvents(0, null, null, 0, false); 107 } 108 109 /** 110 * Makes this <code>Component</code> undisplayable by destroying it native 111 * screen resource. 112 * This method is called by the toolkit internally and should 113 * not be called directly by programs. 114 * @see #isDisplayable 115 * @see #addNotify 116 * @since JDK1.0 117 */ removeNotify()118 public void removeNotify() { 119 } 120 121 /** 122 * Determines if the object is visible. Note: this means that the 123 * object intends to be visible; however, it may not in fact be 124 * showing on the screen because one of the objects that this object 125 * is contained by is not visible. To determine if an object is 126 * showing on the screen, use <code>isShowing</code>. 127 * 128 * @return true if object is visible; otherwise, false 129 */ isVisible()130 public boolean isVisible(){ 131 return visible; 132 } 133 134 /** 135 * Determines whether this component is displayable. A component is 136 * displayable when it is connected to a native screen resource. 137 * <p> 138 * A component is made displayable either when it is added to 139 * a displayable containment hierarchy or when its containment 140 * hierarchy is made displayable. 141 * A containment hierarchy is made displayable when its ancestor 142 * window is either packed or made visible. 143 * <p> 144 * A component is made undisplayable either when it is removed from 145 * a displayable containment hierarchy or when its containment hierarchy 146 * is made undisplayable. A containment hierarchy is made 147 * undisplayable when its ancestor window is disposed. 148 * 149 * @return <code>true</code> if the component is displayable 150 */ isDisplayable()151 public boolean isDisplayable() { 152 return true; 153 } 154 155 /** 156 * Shows or hides this component depending on the value of parameter 157 * <code>b</code>. 158 * @param b if <code>true</code>, shows this component; 159 * otherwise, hides this component 160 * @see #isVisible 161 * @since JDK1.1 162 */ setVisible(boolean b)163 public void setVisible(boolean b) { 164 if (visible != b){ 165 visible = b; 166 if (b) { 167 // If it is the first show, fire WINDOW_OPENED event 168 if (!opened) { 169 postWindowEvent(java.awt.event.WindowEvent.WINDOW_OPENED); 170 opened = true; 171 } 172 postComponentEvent(java.awt.event.ComponentEvent.COMPONENT_SHOWN); 173 } else { 174 postComponentEvent(java.awt.event.ComponentEvent.COMPONENT_HIDDEN); 175 } 176 } 177 } 178 dispose()179 public void dispose() { 180 setVisible(false); 181 postWindowEvent(java.awt.event.WindowEvent.WINDOW_CLOSED); 182 } 183 postWindowEvent(int i)184 protected void postWindowEvent(int i) { 185 eventQueue.postEvent(new java.awt.event.WindowEvent(this, i)); 186 } 187 postComponentEvent(int i)188 protected void postComponentEvent(int i) { 189 eventQueue.postEvent(new java.awt.event.ComponentEvent(this, i)); 190 } 191 192 /** 193 * Update the proxy objects appropriatly on property change events 194 */ 195 protected class AccessibleDialogListener implements XAccessibleEventListener { 196 AccessibleDialogListener()197 protected AccessibleDialogListener() { 198 } 199 setComponentState(short state, boolean enable)200 protected void setComponentState(short state, boolean enable) { 201 switch (state) { 202 case AccessibleStateType.ACTIVE: 203 active = enable; 204 if (enable) { 205 AccessibleObjectFactory.postWindowActivated(Dialog.this); 206 } else { 207 AccessibleObjectFactory.postWindowLostFocus(Dialog.this); 208 } 209 break; 210 case AccessibleStateType.ICONIFIED: 211 postWindowEvent(enable ? 212 java.awt.event.WindowEvent.WINDOW_ICONIFIED : 213 java.awt.event.WindowEvent.WINDOW_DEICONIFIED); 214 break; 215 case AccessibleStateType.VISIBLE: 216 Dialog.this.setVisible(enable); 217 break; 218 default: 219 if (Build.DEBUG) { 220 System.err.println("[dialog]: " + getTitle() + "unexpected state change " + state); 221 } 222 break; 223 } 224 } 225 226 /** Updates the accessible name and fires the appropriate PropertyChangedEvent */ handleNameChangedEvent(Object any)227 protected void handleNameChangedEvent(Object any) { 228 try { 229 String title = AnyConverter.toString(any); 230 setTitle(title); 231 // This causes the property change event to be fired in the VCL thread 232 // context. If this causes problems, it has to be deligated to the java 233 // dispatch thread .. 234 javax.accessibility.AccessibleContext ac = accessibleContext; 235 if (ac!= null) { 236 ac.setAccessibleName(title); 237 } 238 } catch (com.sun.star.lang.IllegalArgumentException e) { 239 } 240 } 241 242 /** Updates the accessible description and fires the appropriate PropertyChangedEvent */ handleDescriptionChangedEvent(Object any)243 protected void handleDescriptionChangedEvent(Object any) { 244 try { 245 // This causes the property change event to be fired in the VCL thread 246 // context. If this causes problems, it has to be deligated to the java 247 // dispatch thread .. 248 javax.accessibility.AccessibleContext ac = accessibleContext; 249 if (ac!= null) { 250 ac.setAccessibleDescription(AnyConverter.toString(any)); 251 } 252 } catch (com.sun.star.lang.IllegalArgumentException e) { 253 } 254 } 255 256 /** Updates the internal states and fires the appropriate PropertyChangedEvent */ handleStateChangedEvent(Object any1, Object any2)257 protected void handleStateChangedEvent(Object any1, Object any2) { 258 try { 259 if (AnyConverter.isShort(any1)) { 260 setComponentState(AnyConverter.toShort(any1), false); 261 } 262 263 if (AnyConverter.isShort(any2)) { 264 setComponentState(AnyConverter.toShort(any2), true); 265 } 266 } catch (com.sun.star.lang.IllegalArgumentException e) { 267 } 268 } 269 270 /** Fires a visible data property change event */ handleVisibleDataEvent()271 protected void handleVisibleDataEvent() { 272 javax.accessibility.AccessibleContext ac = accessibleContext; 273 if (ac != null) { 274 ac.firePropertyChange(javax.accessibility.AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY, null, null); 275 } 276 } 277 278 /** Called by OpenOffice process to notify property changes */ notifyEvent(AccessibleEventObject event)279 public void notifyEvent(AccessibleEventObject event) { 280 switch (event.EventId) { 281 case AccessibleEventId.NAME_CHANGED: 282 // Set the accessible name for the corresponding context, which will fire a property 283 // change event itself 284 handleNameChangedEvent(event.NewValue); 285 break; 286 case AccessibleEventId.DESCRIPTION_CHANGED: 287 // Set the accessible description for the corresponding context, which will fire a property 288 // change event itself - so do not set propertyName ! 289 handleDescriptionChangedEvent(event.NewValue); 290 break; 291 case AccessibleEventId.STATE_CHANGED: 292 // Update the internal state set and fire the appropriate PropertyChangedEvent 293 handleStateChangedEvent(event.OldValue, event.NewValue); 294 break; 295 case AccessibleEventId.CHILD: 296 if (AnyConverter.isObject(event.OldValue)) { 297 AccessibleObjectFactory.removeChild(Dialog.this, event.OldValue); 298 } else if (AnyConverter.isObject(event.NewValue)) { 299 AccessibleObjectFactory.addChild(Dialog.this, event.NewValue); 300 } 301 break; 302 case AccessibleEventId.VISIBLE_DATA_CHANGED: 303 case AccessibleEventId.BOUNDRECT_CHANGED: 304 handleVisibleDataEvent(); 305 break; 306 default: 307 // Warn about unhandled events 308 if(Build.DEBUG) { 309 System.out.println(this + ": unhandled accessibility event id=" + event.EventId); 310 } 311 } 312 } 313 314 /** Called by OpenOffice process to notify that the UNO component is disposing */ disposing(com.sun.star.lang.EventObject eventObject)315 public void disposing(com.sun.star.lang.EventObject eventObject) { 316 } 317 } 318 319 javax.accessibility.AccessibleContext accessibleContext = null; 320 321 /** Returns the AccessibleContext associated with this object */ getAccessibleContext()322 public javax.accessibility.AccessibleContext getAccessibleContext() { 323 if (accessibleContext == null) { 324 accessibleContext = new AccessibleDialog(); 325 accessibleContext.setAccessibleName(getTitle()); 326 } 327 return accessibleContext; 328 } 329 330 protected class AccessibleDialog extends java.awt.Dialog.AccessibleAWTDialog { AccessibleDialog()331 protected AccessibleDialog() { 332 super(); 333 } 334 335 protected java.awt.event.ComponentListener accessibleComponentHandler = null; 336 337 /** 338 * Fire PropertyChange listener, if one is registered, 339 * when shown/hidden.. 340 */ 341 protected class AccessibleComponentHandler implements java.awt.event.ComponentListener { componentHidden(java.awt.event.ComponentEvent e)342 public void componentHidden(java.awt.event.ComponentEvent e) { 343 AccessibleDialog.this.firePropertyChange( 344 javax.accessibility.AccessibleContext.ACCESSIBLE_STATE_PROPERTY, 345 javax.accessibility.AccessibleState.VISIBLE, null); 346 } 347 componentShown(java.awt.event.ComponentEvent e)348 public void componentShown(java.awt.event.ComponentEvent e) { 349 AccessibleDialog.this.firePropertyChange( 350 javax.accessibility.AccessibleContext.ACCESSIBLE_STATE_PROPERTY, 351 null, javax.accessibility.AccessibleState.VISIBLE); 352 } 353 componentMoved(java.awt.event.ComponentEvent e)354 public void componentMoved(java.awt.event.ComponentEvent e) { 355 } 356 componentResized(java.awt.event.ComponentEvent e)357 public void componentResized(java.awt.event.ComponentEvent e) { 358 } 359 } // inner class AccessibleComponentHandler 360 361 protected java.awt.event.WindowListener accessibleWindowHandler = null; 362 363 /** 364 * Fire PropertyChange listener, if one is registered, 365 * when window events happen 366 */ 367 protected class AccessibleWindowHandler implements java.awt.event.WindowListener { 368 /** Invoked when the Window is set to be the active Window. */ windowActivated(java.awt.event.WindowEvent e)369 public void windowActivated(java.awt.event.WindowEvent e) { 370 AccessibleDialog.this.firePropertyChange( 371 javax.accessibility.AccessibleContext.ACCESSIBLE_STATE_PROPERTY, 372 null, javax.accessibility.AccessibleState.ACTIVE); 373 if (Build.DEBUG) { 374 System.err.println("[Dialog] " + getTitle() + " is now active"); 375 } 376 } 377 378 /** Invoked when a window has been closed as the result of calling dispose on the window. */ windowClosed(java.awt.event.WindowEvent e)379 public void windowClosed(java.awt.event.WindowEvent e) { 380 if (Build.DEBUG) { 381 System.err.println("[Dialog] " + getTitle() + " has been closed"); 382 } 383 } 384 385 /** Invoked when the user attempts to close the window from the window's system menu. */ windowClosing(java.awt.event.WindowEvent e)386 public void windowClosing(java.awt.event.WindowEvent e) { 387 if (Build.DEBUG) { 388 System.err.println("[Dialog] " + getTitle() + " is closing"); 389 } 390 } 391 392 /** Invoked when a Window is no longer the active Window. */ windowDeactivated(java.awt.event.WindowEvent e)393 public void windowDeactivated(java.awt.event.WindowEvent e) { 394 AccessibleDialog.this.firePropertyChange( 395 javax.accessibility.AccessibleContext.ACCESSIBLE_STATE_PROPERTY, 396 javax.accessibility.AccessibleState.ACTIVE, null); 397 if (Build.DEBUG) { 398 System.err.println("[Dialog] " + getTitle() + " is no longer active"); 399 } 400 } 401 402 /** Invoked when a window is changed from a minimized to a normal state. */ windowDeiconified(java.awt.event.WindowEvent e)403 public void windowDeiconified(java.awt.event.WindowEvent e) { 404 if (Build.DEBUG) { 405 System.err.println("[Dialog] " + getTitle() + " has been deiconified"); 406 } 407 } 408 409 /** Invoked when a window is changed from a normal to a minimized state. */ windowIconified(java.awt.event.WindowEvent e)410 public void windowIconified(java.awt.event.WindowEvent e) { 411 if (Build.DEBUG) { 412 System.err.println("[Dialog] " + getTitle() + " has been iconified"); 413 } 414 } 415 416 /** Invoked the first time a window is made visible. */ windowOpened(java.awt.event.WindowEvent e)417 public void windowOpened(java.awt.event.WindowEvent e) { 418 if (Build.DEBUG) { 419 System.err.println("[Dialog] " + getTitle() + " has been opened"); 420 } 421 } 422 423 } // inner class AccessibleWindowHandler 424 425 protected java.awt.event.ContainerListener accessibleContainerHandler = null; 426 427 /** 428 * Fire PropertyChange listener, if one is registered, 429 * when children added/removed. 430 */ 431 432 protected class AccessibleContainerHandler implements java.awt.event.ContainerListener { componentAdded(java.awt.event.ContainerEvent e)433 public void componentAdded(java.awt.event.ContainerEvent e) { 434 java.awt.Component c = e.getChild(); 435 if (c != null && c instanceof javax.accessibility.Accessible) { 436 AccessibleDialog.this.firePropertyChange( 437 javax.accessibility.AccessibleContext.ACCESSIBLE_CHILD_PROPERTY, 438 null, ((javax.accessibility.Accessible) c).getAccessibleContext()); 439 } 440 } componentRemoved(java.awt.event.ContainerEvent e)441 public void componentRemoved(java.awt.event.ContainerEvent e) { 442 java.awt.Component c = e.getChild(); 443 if (c != null && c instanceof javax.accessibility.Accessible) { 444 AccessibleDialog.this.firePropertyChange( 445 javax.accessibility.AccessibleContext.ACCESSIBLE_CHILD_PROPERTY, 446 ((javax.accessibility.Accessible) c).getAccessibleContext(), null); 447 } 448 } 449 } 450 451 protected int propertyChangeListenerCount = 0; 452 453 /** 454 * Add a PropertyChangeListener to the listener list. 455 * 456 * @param listener The PropertyChangeListener to be added 457 */ addPropertyChangeListener(java.beans.PropertyChangeListener listener)458 public void addPropertyChangeListener(java.beans.PropertyChangeListener listener) { 459 if (propertyChangeListenerCount++ == 0) { 460 accessibleWindowHandler = new AccessibleWindowHandler(); 461 Dialog.this.addWindowListener(accessibleWindowHandler); 462 463 accessibleContainerHandler = new AccessibleContainerHandler(); 464 Dialog.this.addContainerListener(accessibleContainerHandler); 465 466 accessibleComponentHandler = new AccessibleComponentHandler(); 467 Dialog.this.addComponentListener(accessibleComponentHandler); 468 } 469 super.addPropertyChangeListener(listener); 470 } 471 472 /** 473 * Remove a PropertyChangeListener from the listener list. 474 * This removes a PropertyChangeListener that was registered 475 * for all properties. 476 * 477 * @param listener The PropertyChangeListener to be removed 478 */ removePropertyChangeListener(java.beans.PropertyChangeListener listener)479 public void removePropertyChangeListener(java.beans.PropertyChangeListener listener) { 480 if (--propertyChangeListenerCount == 0) { 481 Dialog.this.removeComponentListener(accessibleComponentHandler); 482 accessibleComponentHandler = null; 483 484 Dialog.this.removeContainerListener(accessibleContainerHandler); 485 accessibleContainerHandler = null; 486 487 Dialog.this.removeWindowListener(accessibleWindowHandler); 488 accessibleWindowHandler = null; 489 } 490 super.removePropertyChangeListener(listener); 491 } 492 493 /* 494 * AccessibleComponent 495 */ 496 497 /** Returns the background color of the object */ getBackground()498 public java.awt.Color getBackground() { 499 try { 500 return new java.awt.Color(unoAccessibleComponent.getBackground()); 501 } catch (com.sun.star.uno.RuntimeException e) { 502 return null; 503 } 504 } 505 setBackground(java.awt.Color c)506 public void setBackground(java.awt.Color c) { 507 // Not supported by UNO accessibility API 508 } 509 510 /** Returns the foreground color of the object */ getForeground()511 public java.awt.Color getForeground() { 512 try { 513 return new java.awt.Color(unoAccessibleComponent.getForeground()); 514 } catch (com.sun.star.uno.RuntimeException e) { 515 return null; 516 } 517 } 518 setForeground(java.awt.Color c)519 public void setForeground(java.awt.Color c) { 520 // Not supported by UNO accessibility API 521 } 522 getCursor()523 public java.awt.Cursor getCursor() { 524 // Not supported by UNO accessibility API 525 return null; 526 } 527 setCursor(java.awt.Cursor cursor)528 public void setCursor(java.awt.Cursor cursor) { 529 // Not supported by UNO accessibility API 530 } 531 getFont()532 public java.awt.Font getFont() { 533 // FIXME 534 return null; 535 } 536 setFont(java.awt.Font f)537 public void setFont(java.awt.Font f) { 538 // Not supported by UNO accessibility API 539 } 540 getFontMetrics(java.awt.Font f)541 public java.awt.FontMetrics getFontMetrics(java.awt.Font f) { 542 // FIXME 543 return null; 544 } 545 isEnabled()546 public boolean isEnabled() { 547 return Dialog.this.isEnabled(); 548 } 549 setEnabled(boolean b)550 public void setEnabled(boolean b) { 551 // Not supported by UNO accessibility API 552 } 553 isVisible()554 public boolean isVisible() { 555 return Dialog.this.isVisible(); 556 } 557 setVisible(boolean b)558 public void setVisible(boolean b) { 559 // Not supported by UNO accessibility API 560 } 561 isShowing()562 public boolean isShowing() { 563 return Dialog.this.isShowing(); 564 } 565 contains(java.awt.Point p)566 public boolean contains(java.awt.Point p) { 567 try { 568 return unoAccessibleComponent.containsPoint(new com.sun.star.awt.Point(p.x, p.y)); 569 } catch (com.sun.star.uno.RuntimeException e) { 570 return false; 571 } 572 } 573 574 /** Returns the location of the object on the screen. */ getLocationOnScreen()575 public java.awt.Point getLocationOnScreen() { 576 try { 577 com.sun.star.awt.Point unoPoint = unoAccessibleComponent.getLocationOnScreen(); 578 return new java.awt.Point(unoPoint.X, unoPoint.Y); 579 } catch (com.sun.star.uno.RuntimeException e) { 580 return null; 581 } 582 } 583 584 /** Gets the location of this component in the form of a point specifying the component's top-left corner */ getLocation()585 public java.awt.Point getLocation() { 586 try { 587 com.sun.star.awt.Point unoPoint = unoAccessibleComponent.getLocation(); 588 return new java.awt.Point( unoPoint.X, unoPoint.Y ); 589 } catch (com.sun.star.uno.RuntimeException e) { 590 return null; 591 } 592 } 593 594 /** Moves this component to a new location */ setLocation(java.awt.Point p)595 public void setLocation(java.awt.Point p) { 596 // Not supported by UNO accessibility API 597 } 598 599 /** Gets the bounds of this component in the form of a Rectangle object */ getBounds()600 public java.awt.Rectangle getBounds() { 601 try { 602 com.sun.star.awt.Rectangle unoRect = unoAccessibleComponent.getBounds(); 603 return new java.awt.Rectangle(unoRect.X, unoRect.Y, unoRect.Width, unoRect.Height); 604 } catch (com.sun.star.uno.RuntimeException e) { 605 return null; 606 } 607 } 608 609 /** Moves and resizes this component to conform to the new bounding rectangle r */ setBounds(java.awt.Rectangle r)610 public void setBounds(java.awt.Rectangle r) { 611 // Not supported by UNO accessibility API 612 } 613 614 /** Returns the size of this component in the form of a Dimension object */ getSize()615 public java.awt.Dimension getSize() { 616 try { 617 com.sun.star.awt.Size unoSize = unoAccessibleComponent.getSize(); 618 return new java.awt.Dimension(unoSize.Width, unoSize.Height); 619 } catch (com.sun.star.uno.RuntimeException e) { 620 return null; 621 } 622 } 623 624 /** Resizes this component so that it has width d.width and height d.height */ setSize(java.awt.Dimension d)625 public void setSize(java.awt.Dimension d) { 626 // Not supported by UNO accessibility API 627 } 628 629 /** Returns the Accessible child, if one exists, contained at the local coordinate Point */ getAccessibleAt(java.awt.Point p)630 public javax.accessibility.Accessible getAccessibleAt(java.awt.Point p) { 631 try { 632 java.awt.Component c = AccessibleObjectFactory.getAccessibleComponent( 633 unoAccessibleComponent.getAccessibleAtPoint(new com.sun.star.awt.Point(p.x, p.y))); 634 635 return (javax.accessibility.Accessible) c; 636 } catch (com.sun.star.uno.RuntimeException e) { 637 return null; 638 } 639 } 640 isFocusTraversable()641 public boolean isFocusTraversable() { 642 return Dialog.this.isFocusable(); 643 } 644 requestFocus()645 public void requestFocus() { 646 unoAccessibleComponent.grabFocus(); 647 } 648 } 649 } 650 651