diff options
Diffstat (limited to 'libjava/java/awt/ScrollPane.java')
-rw-r--r-- | libjava/java/awt/ScrollPane.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libjava/java/awt/ScrollPane.java b/libjava/java/awt/ScrollPane.java index abd5514d8e3..c38feb339c5 100644 --- a/libjava/java/awt/ScrollPane.java +++ b/libjava/java/awt/ScrollPane.java @@ -43,6 +43,8 @@ import java.awt.peer.ComponentPeer; import java.awt.peer.ScrollPanePeer; import javax.accessibility.Accessible; +import javax.accessibility.AccessibleContext; +import javax.accessibility.AccessibleRole; /** * This widget provides a scrollable region that allows a single @@ -587,5 +589,27 @@ paramString() { wheelScrollingEnabled = enable; } + + protected class AccessibleAWTScrollPane extends AccessibleAWTContainer + { + public AccessibleRole getAccessibleRole() + { + return AccessibleRole.SCROLL_PANE; + } + } + + /** + * Gets the AccessibleContext associated with this <code>ScrollPane</code>. + * The context is created, if necessary. + * + * @return the associated context + */ + public AccessibleContext getAccessibleContext() + { + /* Create the context if this is the first request */ + if (accessibleContext == null) + accessibleContext = new AccessibleAWTScrollPane(); + return accessibleContext; + } } // class ScrollPane |