|
From: <ls...@us...> - 2007-11-18 10:59:43
|
Revision: 3595
http://jnode.svn.sourceforge.net/jnode/?rev=3595&view=rev
Author: lsantha
Date: 2007-11-18 02:59:24 -0800 (Sun, 18 Nov 2007)
Log Message:
-----------
OpenJDK integration.
Added Paths:
-----------
trunk/core/src/openjdk/javax/javax/accessibility/
trunk/core/src/openjdk/javax/javax/accessibility/Accessible.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleAction.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleAttributeSequence.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleBundle.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleComponent.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleContext.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleEditableText.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleExtendedComponent.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleExtendedTable.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleExtendedText.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleHyperlink.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleHypertext.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleIcon.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleKeyBinding.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleRelation.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleRelationSet.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleResourceBundle.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleRole.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleSelection.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleState.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleStateSet.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleStreamable.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleTable.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleTableModelChange.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleText.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleTextSequence.java
trunk/core/src/openjdk/javax/javax/accessibility/AccessibleValue.java
trunk/core/src/openjdk/javax/javax/accessibility/package.html
Removed Paths:
-------------
trunk/core/src/classpath/javax/javax/accessibility/
Added: trunk/core/src/openjdk/javax/javax/accessibility/Accessible.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/accessibility/Accessible.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/accessibility/Accessible.java 2007-11-18 10:59:24 UTC (rev 3595)
@@ -0,0 +1,51 @@
+/*
+ * Copyright 1997-1999 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.accessibility;
+
+/**
+ * Interface Accessible is the main interface for the accessibility package.
+ * All components that support
+ * the accessibility package must implement this interface.
+ * It contains a single method, {@link #getAccessibleContext}, which
+ * returns an instance of the class {@link AccessibleContext}.
+ *
+ * @version 1.1 11/24/97 20:34:48
+ * @author Peter Korn
+ * @author Hans Muller
+ * @author Willie Walker
+ */
+public interface Accessible {
+
+ /**
+ * Returns the AccessibleContext associated with this object. In most
+ * cases, the return value should not be null if the object implements
+ * interface Accessible. If a component developer creates a subclass
+ * of an object that implements Accessible, and that subclass
+ * is not Accessible, the developer should override the
+ * getAccessibleContext method to return null.
+ */
+ public AccessibleContext getAccessibleContext();
+}
Added: trunk/core/src/openjdk/javax/javax/accessibility/AccessibleAction.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/accessibility/AccessibleAction.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/accessibility/AccessibleAction.java 2007-11-18 10:59:24 UTC (rev 3595)
@@ -0,0 +1,114 @@
+/*
+ * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.accessibility;
+
+/**
+ * The AccessibleAction interface should be supported by any object
+ * that can perform one or more actions. This interface
+ * provides the standard mechanism for an assistive technology to determine
+ * what those actions are as well as tell the object to perform them.
+ * Any object that can be manipulated should support this
+ * interface. Applications can determine if an object supports the
+ * AccessibleAction interface by first obtaining its AccessibleContext (see
+ * {@link Accessible}) and then calling the {@link AccessibleContext#getAccessibleAction}
+ * method. If the return value is not null, the object supports this interface.
+ *
+ * @see Accessible
+ * @see Accessible#getAccessibleContext
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleAction
+ *
+ * @version 1.25 05/05/07
+ * @author Peter Korn
+ * @author Hans Muller
+ * @author Willie Walker
+ * @author Lynn Monsanto
+ */
+public interface AccessibleAction {
+
+ /**
+ * An action which causes a tree node to
+ * collapse if expanded and expand if collapsed.
+ * @since 1.5
+ */
+ public static final String TOGGLE_EXPAND =
+ new String ("toggle expand");
+
+ /**
+ * An action which increments a value.
+ * @since 1.5
+ */
+ public static final String INCREMENT =
+ new String ("increment");
+
+
+ /**
+ * An action which decrements a value.
+ * @since 1.5
+ */
+ public static final String DECREMENT =
+ new String ("decrement");
+
+ /**
+ * An action which causes a component to execute its default action.
+ * @since 1.6
+ */
+ public static final String CLICK = new String("click");
+
+ /**
+ * An action which causes a popup to become visible if it is hidden and
+ * hidden if it is visible.
+ * @since 1.6
+ */
+ public static final String TOGGLE_POPUP = new String("toggle popup");
+
+ /**
+ * Returns the number of accessible actions available in this object
+ * If there are more than one, the first one is considered the "default"
+ * action of the object.
+ *
+ * @return the zero-based number of Actions in this object
+ */
+ public int getAccessibleActionCount();
+
+ /**
+ * Returns a description of the specified action of the object.
+ *
+ * @param i zero-based index of the actions
+ * @return a String description of the action
+ * @see #getAccessibleActionCount
+ */
+ public String getAccessibleActionDescription(int i);
+
+ /**
+ * Performs the specified Action on the object
+ *
+ * @param i zero-based index of actions
+ * @return true if the action was performed; otherwise false.
+ * @see #getAccessibleActionCount
+ */
+ public boolean doAccessibleAction(int i);
+}
Added: trunk/core/src/openjdk/javax/javax/accessibility/AccessibleAttributeSequence.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/accessibility/AccessibleAttributeSequence.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/accessibility/AccessibleAttributeSequence.java 2007-11-18 10:59:24 UTC (rev 3595)
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package javax.accessibility;
+
+import javax.swing.text.AttributeSet;
+
+
+/**
+ * <P>The AccessibleAttributeSequence provides information about
+ * a contiguous sequence of text attributes
+ *
+ * @see Accessible
+ * @see Accessible#getAccessibleContext
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleText
+ * @see AccessibleTextSequence
+ *
+ * @version 1.11 05/05/07
+ * @author Lynn Monsanto
+ */
+
+/**
+ * This class collects together the span of text that share the same
+ * contiguous set of attributes, along with that set of attributes. It
+ * is used by implementors of the class <code>AccessibleContext</code> in
+ * order to generate <code>ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED</code> events.
+ *
+ * @see javax.accessibility.AccessibleContext
+ * @see javax.accessibility.AccessibleContext#ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED
+ */
+public class AccessibleAttributeSequence {
+ /** The start index of the text sequence */
+ public int startIndex;
+
+ /** The end index of the text sequence */
+ public int endIndex;
+
+ /** The text attributes */
+ public AttributeSet attributes;
+
+ /**
+ * Constructs an <code>AccessibleAttributeSequence</code> with the given
+ * parameters.
+ *
+ * @param start the beginning index of the span of text
+ * @param end the ending index of the span of text
+ * @param attr the <code>AttributeSet</code> shared by this text span
+ *
+ * @since 1.6
+ */
+ public AccessibleAttributeSequence(int start, int end, AttributeSet attr) {
+ startIndex = start;
+ endIndex = end;
+ attributes = attr;
+ }
+
+};
+
Added: trunk/core/src/openjdk/javax/javax/accessibility/AccessibleBundle.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/accessibility/AccessibleBundle.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/accessibility/AccessibleBundle.java 2007-11-18 10:59:24 UTC (rev 3595)
@@ -0,0 +1,156 @@
+/*
+ * Copyright 1997-2002 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.accessibility;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * <p>Base class used to maintain a strongly typed enumeration. This is
+ * the superclass of {@link AccessibleState} and {@link AccessibleRole}.
+ * <p>The toDisplayString method allows you to obtain the localized string
+ * for a locale independent key from a predefined ResourceBundle for the
+ * keys defined in this class. This localized string is intended to be
+ * readable by humans.
+ *
+ * @see AccessibleRole
+ * @see AccessibleState
+ *
+ * @version 1.12 10/05/99
+ * @author Willie Walker
+ * @author Peter Korn
+ * @author Lynn Monsanto
+ */
+public abstract class AccessibleBundle {
+
+ private static Hashtable table = new Hashtable();
+ private final String defaultResourceBundleName
+ = "com.sun.accessibility.internal.resources.accessibility";
+
+ public AccessibleBundle() {
+ }
+
+ /**
+ * The locale independent name of the state. This is a programmatic
+ * name that is not intended to be read by humans.
+ * @see #toDisplayString
+ */
+ protected String key = null;
+
+ /**
+ * Obtains the key as a localized string.
+ * If a localized string cannot be found for the key, the
+ * locale independent key stored in the role will be returned.
+ * This method is intended to be used only by subclasses so that they
+ * can specify their own resource bundles which contain localized
+ * strings for their keys.
+ * @param resourceBundleName the name of the resource bundle to use for
+ * lookup
+ * @param locale the locale for which to obtain a localized string
+ * @return a localized String for the key.
+ */
+ protected String toDisplayString(String resourceBundleName,
+ Locale locale) {
+
+ // loads the resource bundle if necessary
+ loadResourceBundle(resourceBundleName, locale);
+
+ // returns the localized string
+ Object o = table.get(locale);
+ if (o != null && o instanceof Hashtable) {
+ Hashtable resourceTable = (Hashtable) o;
+ o = resourceTable.get(key);
+
+ if (o != null && o instanceof String) {
+ return (String)o;
+ }
+ }
+ return key;
+ }
+
+ /**
+ * Obtains the key as a localized string.
+ * If a localized string cannot be found for the key, the
+ * locale independent key stored in the role will be returned.
+ *
+ * @param locale the locale for which to obtain a localized string
+ * @return a localized String for the key.
+ */
+ public String toDisplayString(Locale locale) {
+ return toDisplayString(defaultResourceBundleName, locale);
+ }
+
+ /**
+ * Gets localized string describing the key using the default locale.
+ * @return a localized String describing the key for the default locale
+ */
+ public String toDisplayString() {
+ return toDisplayString(Locale.getDefault());
+ }
+
+ /**
+ * Gets localized string describing the key using the default locale.
+ * @return a localized String describing the key using the default locale
+ * @see #toDisplayString
+ */
+ public String toString() {
+ return toDisplayString();
+ }
+
+ /*
+ * Loads the Accessibility resource bundle if necessary.
+ */
+ private void loadResourceBundle(String resourceBundleName,
+ Locale locale) {
+ if (! table.contains(locale)) {
+
+ try {
+ Hashtable resourceTable = new Hashtable();
+
+ ResourceBundle bundle = ResourceBundle.getBundle(resourceBundleName, locale);
+
+ Enumeration iter = bundle.getKeys();
+ while(iter.hasMoreElements()) {
+ String key = (String)iter.nextElement();
+ resourceTable.put(key, bundle.getObject(key));
+ }
+
+ table.put(locale, resourceTable);
+ }
+ catch (MissingResourceException e) {
+ System.err.println("loadResourceBundle: " + e);
+ // Just return so toDisplayString() returns the
+ // non-localized key.
+ return;
+ }
+ }
+ }
+
+}
Added: trunk/core/src/openjdk/javax/javax/accessibility/AccessibleComponent.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/accessibility/AccessibleComponent.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/accessibility/AccessibleComponent.java 2007-11-18 10:59:24 UTC (rev 3595)
@@ -0,0 +1,316 @@
+/*
+ * Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.accessibility;
+
+import java.awt.*;
+import java.awt.event.*;
+
+/**
+ * The AccessibleComponent interface should be supported by any object
+ * that is rendered on the screen. This interface provides the standard
+ * mechanism for an assistive technology to determine and set the
+ * graphical representation of an object. Applications can determine
+ * if an object supports the AccessibleComponent interface by first
+ * obtaining its AccessibleContext
+ * and then calling the
+ * {@link AccessibleContext#getAccessibleComponent} method.
+ * If the return value is not null, the object supports this interface.
+ *
+ * @see Accessible
+ * @see Accessible#getAccessibleContext
+ * @see AccessibleContext
+ * @see AccessibleContext#getAccessibleComponent
+ *
+ * @version 1.7 10/05/99 14:00:28
+ * @author Peter Korn
+ * @author Hans Muller
+ * @author Willie Walker
+ */
+public interface AccessibleComponent {
+
+ /**
+ * Gets the background color of this object.
+ *
+ * @return the background color, if supported, of the object;
+ * otherwise, null
+ * @see #setBackground
+ */
+ public Color getBackground();
+
+ /**
+ * Sets the background color of this object.
+ *
+ * @param c the new Color for the background
+ * @see #setBackground
+ */
+ public void setBackground(Color c);
+
+ /**
+ * Gets the foreground color of this object.
+ *
+ * @return the foreground color, if supported, of the object;
+ * otherwise, null
+ * @see #setForeground
+ */
+ public Color getForeground();
+
+ /**
+ * Sets the foreground color of this object.
+ *
+ * @param c the new Color for the foreground
+ * @see #getForeground
+ */
+ public void setForeground(Color c);
+
+ /**
+ * Gets the Cursor of this object.
+ *
+ * @return the Cursor, if supported, of the object; otherwise, null
+ * @see #setCursor
+ */
+ public Cursor getCursor();
+
+ /**
+ * Sets the Cursor of this object.
+ *
+ * @param cursor the new Cursor for the object
+ * @see #getCursor
+ */
+ public void setCursor(Cursor cursor);
+
+ /**
+ * Gets the Font of this object.
+ *
+ * @return the Font,if supported, for the object; otherwise, null
+ * @see #setFont
+ */
+ public Font getFont();
+
+ /**
+ * Sets the Font of this object.
+ *
+ * @param f the new Font for the object
+ * @see #getFont
+ */
+ public void setFont(Font f);
+
+ /**
+ * Gets the FontMetrics of this object.
+ *
+ * @param f the Font
+ * @return the FontMetrics, if supported, the object; otherwise, null
+ * @see #getFont
+ */
+ public FontMetrics getFontMetrics(Font f);
+
+ /**
+ * Determines if the object is enabled. Objects that are enabled
+ * will also have the AccessibleState.ENABLED state set in their
+ * AccessibleStateSets.
+ *
+ * @return true if object is enabled; otherwise, false
+ * @see #setEnabled
+ * @see AccessibleContext#getAccessibleStateSet
+ * @see AccessibleState#ENABLED
+ * @see AccessibleStateSet
+ */
+ public boolean isEnabled();
+
+ /**
+ * Sets the enabled state of the object.
+ *
+ * @param b if true, enables this object; otherwise, disables it
+ * @see #isEnabled
+ */
+ public void setEnabled(boolean b);
+
+ /**
+ * Determines if the object is visible. Note: this means that the
+ * object intends to be visible; however, it may not be
+ * showing on the screen because one of the objects that this object
+ * is contained by is currently not visible. To determine if an object is
+ * showing on the screen, use isShowing().
+ * <p>Objects that are visible will also have the
+ * AccessibleState.VISIBLE state set in their AccessibleStateSets.
+ *
+ * @return true if object is visible; otherwise, false
+ * @see #setVisible
+ * @see AccessibleContext#getAccessibleStateSet
+ * @see AccessibleState#VISIBLE
+ * @see AccessibleStateSet
+ */
+ public boolean isVisible();
+
+ /**
+ * Sets the visible state of the object.
+ *
+ * @param b if true, shows this object; otherwise, hides it
+ * @see #isVisible
+ */
+ public void setVisible(boolean b);
+
+ /**
+ * Determines if the object is showing. This is determined by checking
+ * the visibility of the object and its ancestors.
+ * Note: this
+ * will return true even if the object is obscured by another (for example,
+ * it is underneath a menu that was pulled down).
+ *
+ * @return true if object is showing; otherwise, false
+ */
+ public boolean isShowing();
+
+ /**
+ * Checks whether the specified point is within this object's bounds,
+ * where the point's x and y coordinates are defined to be relative to the
+ * coordinate system of the object.
+ *
+ * @param p the Point relative to the coordinate system of the object
+ * @return true if object contains Point; otherwise false
+ * @see #getBounds
+ */
+ public boolean contains(Point p);
+
+ /**
+ * Returns the location of the object on the screen.
+ *
+ * @return the location of the object on screen; null if this object
+ * is not on the screen
+ * @see #getBounds
+ * @see #getLocation
+ */
+ public Point getLocationOnScreen();
+
+ /**
+ * Gets the location of the object relative to the parent in the form
+ * of a point specifying the object's top-left corner in the screen's
+ * coordinate space.
+ *
+ * @return An instance of Point representing the top-left corner of the
+ * object's bounds in the coordinate space of the screen; null if
+ * this object or its parent are not on the screen
+ * @see #getBounds
+ * @see #getLocationOnScreen
+ */
+ public Point getLocation();
+
+ /**
+ * Sets the location of the object relative to the parent.
+ * @param p the new position for the top-left corner
+ * @see #getLocation
+ */
+ public void setLocation(Point p);
+
+ /**
+ * Gets the bounds of this object in the form of a Rectangle object.
+ * The bounds specify this object's width, height, and location
+ * relative to its parent.
+ *
+ * @return A rectangle indicating this component's bounds; null if
+ * this object is not on the screen.
+ * @see #contains
+ */
+ public Rectangle getBounds();
+
+ /**
+ * Sets the bounds of this object in the form of a Rectangle object.
+ * The bounds specify this object's width, height, and location
+ * relative to its parent.
+ *
+ * @param r rectangle indicating this component's bounds
+ * @see #getBounds
+ */
+ public void setBounds(Rectangle r);
+
+ /**
+ * Returns the size of this object in the form of a Dimension object.
+ * The height field of the Dimension object contains this object's
+ * height, and the width field of the Dimension object contains this
+ * object's width.
+ *
+ * @return A Dimension object that indicates the size of this component;
+ * null if this object is not on the screen
+ * @see #setSize
+ */
+ public Dimension getSize();
+
+ /**
+ * Resizes this object so that it has width and height.
+ *
+ * @param d The dimension specifying the new size of the object.
+ * @see #getSize
+ */
+ public void setSize(Dimension d);
+
+ /**
+ * Returns the Accessible child, if one exists, contained at the local
+ * coordinate Point.
+ *
+ * @param p The point relative to the coordinate system of this object.
+ * @return the Accessible, if it exists, at the specified location;
+ * otherwise null
+ */
+ public Accessible getAccessibleAt(Point p);
+
+ /**
+ * Returns whether this object can accept focus or not. Objects that
+ * can accept focus will also have the AccessibleState.FOCUSABLE state
+ * set in their AccessibleStateSets.
+ *
+ * @return true if object can accept focus; otherwise false
+ * @see AccessibleContext#getAccessibleStateSet
+ * @see AccessibleState#FOCUSABLE
+ * @see AccessibleState#FOCUSED
+ * @see AccessibleStateSet
+ */
+ public boolean isFocusTraversable();
+
+ /**
+ * Requests focus for this object. If this object cannot accept focus,
+ * nothing will happen. Otherwise, the object will attempt to take
+ * focus.
+ * @see #isFocusTraversable
+ */
+ public void requestFocus();
+
+ /**
+ * Adds the specified focus listener to receive focus events from this
+ * component.
+ *
+ * @param l the focus listener
+ * @see #removeFocusListener
+ */
+ public void addFocusListener(FocusListener l);
+
+ /**
+ * Removes the specified focus listener so it no longer receives focus
+ * events from this component.
+ *
+ * @param l the focus listener
+ * @see #addFocusListener
+ */
+ public void removeFocusListener(FocusListener l);
+}
Added: trunk/core/src/openjdk/javax/javax/accessibility/AccessibleContext.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/accessibility/AccessibleContext.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/accessibility/AccessibleContext.java 2007-11-18 10:59:24 UTC (rev 3595)
@@ -0,0 +1,750 @@
+/*
+ * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package javax.accessibility;
+
+import java.util.Locale;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.beans.PropertyChangeEvent;
+import java.awt.IllegalComponentStateException;
+
+/**
+ * AccessibleContext represents the minimum information all accessible objects
+ * return. This information includes the accessible name, description, role,
+ * and state of the object, as well as information about its parent and
+ * children. AccessibleContext also contains methods for
+ * obtaining more specific accessibility information about a component.
+ * If the component supports them, these methods will return an object that
+ * implements one or more of the following interfaces:
+ * <P><ul>
+ * <li>{@link AccessibleAction} - the object can perform one or more actions.
+ * This interface provides the standard mechanism for an assistive
+ * technology to determine what those actions are and tell the object
+ * to perform them. Any object that can be manipulated should
+ * support this interface.
+ * <li>{@link AccessibleComponent} - the object has a graphical representation.
+ * This interface provides the standard mechanism for an assistive
+ * technology to determine and set the graphical representation of the
+ * object. Any object that is rendered on the screen should support
+ * this interface.
+ * <li>{@link AccessibleSelection} - the object allows its children to be
+ * selected. This interface provides the standard mechanism for an
+ * assistive technology to determine the currently selected children of the object
+ * as well as modify its selection set. Any object that has children
+ * that can be selected should support this interface.
+ * <li>{@link AccessibleText} - the object presents editable textual information
+ * on the display. This interface provides the standard mechanism for
+ * an assistive technology to access that text via its content, attributes,
+ * and spatial location. Any object that contains editable text should
+ * support this interface.
+ * <li>{@link AccessibleValue} - the object supports a numerical value. This
+ * interface provides the standard mechanism for an assistive technology
+ * to determine and set the current value of the object, as well as obtain its
+ * minimum and maximum values. Any object that supports a numerical value
+ * should support this interface.</ul>
+ *
+ *
+ * @beaninfo
+ * attribute: isContainer false
+ * description: Minimal information that all accessible objects return
+ *
+
+ * @version 1.51 05/05/07
+ * @author Peter Korn
+ * @author Hans Muller
+ * @author Willie Walker
+ * @author Lynn Monsanto
+ */
+public abstract class AccessibleContext {
+
+ /**
+ * Constant used to determine when the accessibleName property has
+ * changed. The old value in the PropertyChangeEvent will be the old
+ * accessibleName and the new value will be the new accessibleName.
+ *
+ * @see #getAccessibleName
+ * @see #addPropertyChangeListener
+ */
+ public static final String ACCESSIBLE_NAME_PROPERTY = "AccessibleName";
+
+ /**
+ * Constant used to determine when the accessibleDescription property has
+ * changed. The old value in the PropertyChangeEvent will be the
+ * old accessibleDescription and the new value will be the new
+ * accessibleDescription.
+ *
+ * @see #getAccessibleDescription
+ * @see #addPropertyChangeListener
+ */
+ public static final String ACCESSIBLE_DESCRIPTION_PROPERTY = "AccessibleDescription";
+
+ /**
+ * Constant used to determine when the accessibleStateSet property has
+ * changed. The old value will be the old AccessibleState and the new
+ * value will be the new AccessibleState in the accessibleStateSet.
+ * For example, if a component that supports the vertical and horizontal
+ * states changes its orientation from vertical to horizontal, the old
+ * value will be AccessibleState.VERTICAL and the new value will be
+ * AccessibleState.HORIZONTAL. Please note that either value can also
+ * be null. For example, when a component changes from being enabled
+ * to disabled, the old value will be AccessibleState.ENABLED
+ * and the new value will be null.
+ *
+ * @see #getAccessibleStateSet
+ * @see AccessibleState
+ * @see AccessibleStateSet
+ * @see #addPropertyChangeListener
+ */
+ public static final String ACCESSIBLE_STATE_PROPERTY = "AccessibleState";
+
+ /**
+ * Constant used to determine when the accessibleValue property has
+ * changed. The old value in the PropertyChangeEvent will be a Number
+ * representing the old value and the new value will be a Number
+ * representing the new value
+ *
+ * @see #getAccessibleValue
+ * @see #addPropertyChangeListener
+ */
+ public static final String ACCESSIBLE_VALUE_PROPERTY = "AccessibleValue";
+
+ /**
+ * Constant used to determine when the accessibleSelection has changed.
+ * The old and new values in the PropertyChangeEvent are currently
+ * reserved for future use.
+ *
+ * @see #getAccessibleSelection
+ * @see #addPropertyChangeListener
+ */
+ public static final String ACCESSIBLE_SELECTION_PROPERTY = "AccessibleSelection";
+
+ /**
+ * Constant used to determine when the accessibleText caret has changed.
+ * The old value in the PropertyChangeEvent will be an
+ * integer representing the old caret position, and the new value will
+ * be an integer representing the new/current caret position.
+ *
+ * @see #addPropertyChangeListener
+ */
+ public static final String ACCESSIBLE_CARET_PROPERTY = "AccessibleCaret";
+
+ /**
+ * Constant used to determine when the visual appearance of the object
+ * has changed. The old and new values in the PropertyChangeEvent are
+ * currently reserved for future use.
+ *
+ * @see #addPropertyChangeListener
+ */
+ public static final String ACCESSIBLE_VISIBLE_DATA_PROPERTY = "AccessibleVisibleData";
+
+ /**
+ * Constant used to determine when Accessible children are added/removed
+ * from the object. If an Accessible child is being added, the old
+ * value will be null and the new value will be the Accessible child. If an
+ * Accessible child is being removed, the old value will be the Accessible
+ * child, and the new value will be null.
+ *
+ * @see #addPropertyChangeListener
+ */
+ public static final String ACCESSIBLE_CHILD_PROPERTY = "AccessibleChild";
+
+ /**
+ * Constant used to determine when the active descendant of a component
+ * has changed. The active descendant is used for objects such as
+ * list, tree, and table, which may have transient children. When the
+ * active descendant has changed, the old value of the property change
+ * event will be the Accessible representing the previous active child, and
+ * the new value will be the Accessible representing the current active
+ * child.
+ *
+ * @see #addPropertyChangeListener
+ */
+ public static final String ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY = "AccessibleActiveDescendant";
+
+ /**
+ * Constant used to indicate that the table caption has changed
+ * The old value in the PropertyChangeEvent will be an Accessible
+ * representing the previous table caption and the new value will
+ * be an Accessible representing the new table caption.
+ * @see Accessible
+ * @see AccessibleTable
+ */
+ public static final String ACCESSIBLE_TABLE_CAPTION_CHANGED =
+ "accessibleTableCaptionChanged";
+
+ /**
+ * Constant used to indicate that the table summary has changed
+ * The old value in the PropertyChangeEvent will be an Accessible
+ * representing the previous table summary and the new value will
+ * be an Accessible representing the new table summary.
+ * @see Accessible
+ * @see AccessibleTable
+ */
+ public static final String ACCESSIBLE_TABLE_SUMMARY_CHANGED =
+ "accessibleTableSummaryChanged";
+
+ /**
+ * Constant used to indicate that table data has changed.
+ * The old value in the PropertyChangeEvent will be null and the
+ * new value will be an AccessibleTableModelChange representing
+ * the table change.
+ * @see AccessibleTable
+ * @see AccessibleTableModelChange
+ */
+ public static final String ACCESSIBLE_TABLE_MODEL_CHANGED =
+ "accessibleTableModelChanged";
+
+ /**
+ * Constant used to indicate that the row header has changed
+ * The old value in the PropertyChangeEvent will be null and the
+ * new value will be an AccessibleTableModelChange representing
+ * the header change.
+ * @see AccessibleTable
+ * @see AccessibleTableModelChange
+ */
+ public static final String ACCESSIBLE_TABLE_ROW_HEADER_CHANGED =
+ "accessibleTableRowHeaderChanged";
+
+ /**
+ * Constant used to indicate that the row description has changed
+ * The old value in the PropertyChangeEvent will be null and the
+ * new value will be an Integer representing the row index.
+ * @see AccessibleTable
+ */
+ public static final String ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED =
+ "accessibleTableRowDescriptionChanged";
+
+ /**
+ * Constant used to indicate that the column header has changed
+ * The old value in the PropertyChangeEvent will be null and the
+ * new value will be an AccessibleTableModelChange representing
+ * the header change.
+ * @see AccessibleTable
+ * @see AccessibleTableModelChange
+ */
+ public static final String ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED =
+ "accessibleTableColumnHeaderChanged";
+
+ /**
+ * Constant used to indicate that the column description has changed
+ * The old value in the PropertyChangeEvent will be null and the
+ * new value will be an Integer representing the column index.
+ * @see AccessibleTable
+ */
+ public static final String ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED =
+ "accessibleTableColumnDescriptionChanged";
+
+ /**
+ * Constant used to indicate that the supported set of actions
+ * has changed. The old value in the PropertyChangeEvent will
+ * be an Integer representing the old number of actions supported
+ * and the new value will be an Integer representing the new
+ * number of actions supported.
+ * @see AccessibleAction
+ */
+ public static final String ACCESSIBLE_ACTION_PROPERTY =
+ "accessibleActionProperty";
+
+ /**
+ * Constant used to indicate that a hypertext element has received focus.
+ * The old value in the PropertyChangeEvent will be an Integer
+ * representing the start index in the document of the previous element
+ * that had focus and the new value will be an Integer representing
+ * the start index in the document of the current element that has
+ * focus. A value of -1 indicates that an element does not or did
+ * not have focus.
+ * @see AccessibleHyperlink
+ */
+ public static final String ACCESSIBLE_HYPERTEXT_OFFSET =
+ "AccessibleHypertextOffset";
+
+ /**
+ * PropertyChangeEvent which indicates that text has changed.
+ * <br>
+ * For text insertion, the oldValue is null and the newValue
+ * is an AccessibleTextSequence specifying the text that was
+ * inserted.
+ * <br>
+ * For text deletion, the oldValue is an AccessibleTextSequence
+ * specifying the text that was deleted and the newValue is null.
+ * <br>
+ * For text replacement, the oldValue is an AccessibleTextSequence
+ * specifying the old text and the newValue is an AccessibleTextSequence
+ * specifying the new text.
+ *
+ * @see #getAccessibleText
+ * @see #addPropertyChangeListener
+ * @see #AccessibleText.AccessibleTextSequence
+ */
+ public static final String ACCESSIBLE_TEXT_PROPERTY
+ = "AccessibleText";
+
+ /**
+ * PropertyChangeEvent which indicates that a significant change
+ * has occurred to the children of a component like a tree or text.
+ * This change notifies the event listener that it needs to
+ * reacquire the state of the subcomponents. The oldValue is
+ * null and the newValue is the component whose children have
+ * become invalid.
+ *
+ * @see #getAccessibleText
+ * @see #addPropertyChangeListener
+ * @see #AccessibleText.AccessibleTextSequence
+ *
+ * @since 1.5
+ */
+ public static final String ACCESSIBLE_INVALIDATE_CHILDREN =
+ "accessibleInvalidateChildren";
+
+ /**
+ * PropertyChangeEvent which indicates that text attributes have changed.
+ * <br>
+ * For attribute insertion, the oldValue is null and the newValue
+ * is an AccessibleAttributeSequence specifying the attributes that were
+ * inserted.
+ * <br>
+ * For attribute deletion, the oldValue is an AccessibleAttributeSequence
+ * specifying the attributes that were deleted and the newValue is null.
+ * <br>
+ * For attribute replacement, the oldValue is an AccessibleAttributeSequence
+ * specifying the old attributes and the newValue is an
+ * AccessibleAttributeSequence specifying the new attributes.
+ *
+ * @see #getAccessibleText
+ * @see #addPropertyChangeListener
+ * @see #AccessibleText.AccessibleAttributeSequence
+ *
+ * @since 1.5
+ */
+ public static final String ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED =
+ "accessibleTextAttributesChanged";
+
+ /**
+ * PropertyChangeEvent which indicates that a change has occurred
+ * in a component's bounds.
+ * The oldValue is the old component bounds and the newValue is
+ * the new component bounds.
+ *
+ * @see #addPropertyChangeListener
+ *
+ * @since 1.5
+ */
+ public static final String ACCESSIBLE_COMPONENT_BOUNDS_CHANGED =
+ "accessibleComponentBoundsChanged";
+
+ /**
+ * The accessible parent of this object.
+ *
+ * @see #getAccessibleParent
+ * @see #setAccessibleParent
+ */
+ protected Accessible accessibleParent = null;
+
+ /**
+ * A localized String containing the name of the object.
+ *
+ * @see #getAccessibleName
+ * @see #setAccessibleName
+ */
+ protected String accessibleName = null;
+
+ /**
+ * A localized String containing the description of the object.
+ *
+ * @see #getAccessibleDescription
+ * @see #setAccessibleDescription
+ */
+ protected String accessibleDescription = null;
+
+ /**
+ * Used to handle the listener list for property change events.
+ *
+ * @see #addPropertyChangeListener
+ * @see #removePropertyChangeListener
+ * @see #firePropertyChangeListener
+ */
+ private PropertyChangeSupport accessibleChangeSupport = null;
+
+ /**
+ * Used to represent the context's relation set
+ * @see #getAccessibleRelationSet
+ */
+ private AccessibleRelationSet relationSet
+ = new AccessibleRelationSet();
+
+ /**
+ * Gets the accessibleName property of this object. The accessibleName
+ * property of an object is a localized String that designates the purpose
+ * of the object. For example, the accessibleName property of a label
+ * or button might be the text of the label or button itself. In the
+ * case of an object that doesn't display its name, the accessibleName
+ * should still be set. For example, in the case of a text field used
+ * to enter the name of a city, the accessibleName for the en_US locale
+ * could be 'city.'
+ *
+ * @return the localized name of the object; null if this
+ * object does not have a name
+ *
+ * @see #setAccessibleName
+ */
+ public String getAccessibleName() {
+ return accessibleName;
+ }
+
+ /**
+ * Sets the localized accessible name of this object. Changing the
+ * name will cause a PropertyChangeEvent to be fired for the
+ * ACCESSIBLE_NAME_PROPERTY property.
+ *
+ * @param s the new localized name of the object.
+ *
+ * @see #getAccessibleName
+ * @see #addPropertyChangeListener
+ *
+ * @beaninfo
+ * preferred: true
+ * description: Sets the accessible name for the component.
+ */
+ public void setAccessibleName(String s) {
+ String oldName = accessibleName;
+ accessibleName = s;
+ firePropertyChange(ACCESSIBLE_NAME_PROPERTY,oldName,accessibleName);
+ }
+
+ /**
+ * Gets the accessibleDescription property of this object. The
+ * accessibleDescription property of this object is a short localized
+ * phrase describing the purpose of the object. For example, in the
+ * case of a 'Cancel' button, the accessibleDescription could be
+ * 'Ignore changes and close dialog box.'
+ *
+ * @return the localized description of the object; null if
+ * this object does not have a description
+ *
+ * @see #setAccessibleDescription
+ */
+ public String getAccessibleDescription() {
+ return accessibleDescription;
+ }
+
+ /**
+ * Sets the accessible description of this object. Changing the
+ * name will cause a PropertyChangeEvent to be fired for the
+ * ACCESSIBLE_DESCRIPTION_PROPERTY property.
+ *
+ * @param s the new localized description of the object
+ *
+ * @see #setAccessibleName
+ * @see #addPropertyChangeListener
+ *
+ * @beaninfo
+ * preferred: true
+ * description: Sets the accessible description for the component.
+ */
+ public void setAccessibleDescription(String s) {
+ String oldDescription = accessibleDescription;
+ accessibleDescription = s;
+ firePropertyChange(ACCESSIBLE_DESCRIPTION_PROPERTY,
+ oldDescription,accessibleDescription);
+ }
+
+ /**
+ * Gets the role of this object. The role of the object is the generic
+ * purpose or use of the class of this object. For example, the role
+ * of a push button is AccessibleRole.PUSH_BUTTON. The roles in
+ * AccessibleRole are provided so component developers can pick from
+ * a set of predefined roles. This enables assistive technologies to
+ * provide a consistent interface to various tweaked subclasses of
+ * components (e.g., use AccessibleRole.PUSH_BUTTON for all components
+ * that act like a push button) as well as distinguish between sublasses
+ * that behave differently (e.g., AccessibleRole.CHECK_BOX for check boxes
+ * and AccessibleRole.RADIO_BUTTON for radio buttons).
+ * <p>Note that the AccessibleRole class is also extensible, so
+ * custom component developers can define their own AccessibleRole's
+ * if the set of predefined roles is inadequate.
+ *
+ * @return an instance of AccessibleRole describing the role of the object
+ * @see AccessibleRole
+ */
+ public abstract AccessibleRole getAccessibleRole();
+
+ /**
+ * Gets the state set of this object. The AccessibleStateSet of an object
+ * is composed of a set of unique AccessibleStates. A change in the
+ * AccessibleStateSet of an object will cause a PropertyChangeEvent to
+ * be fired for the ACCESSIBLE_STATE_PROPERTY property.
+ *
+ * @return an instance of AccessibleStateSet containing the
+ * current state set of the object
+ * @see AccessibleStateSet
+ * @see AccessibleState
+ * @see #addPropertyChangeListener
+ */
+ public abstract AccessibleStateSet getAccessibleStateSet();
+
+ /**
+ * Gets the Accessible parent of this object.
+ *
+ * @return the Accessible parent of this object; null if this
+ * object does not have an Accessible parent
+ */
+ public Accessible getAccessibleParent() {
+ return accessibleParent;
+ }
+
+ /**
+ * Sets the Accessible parent of this object. This is meant to be used
+ * only in the situations where the actual component's parent should
+ * not be treated as the component's accessible parent and is a method
+ * that should only be called by the parent of the accessible child.
+ *
+ * @param a - Accessible to be set as the parent
+ */
+ public void setAccessibleParent(Accessible a) {
+ accessibleParent = a;
+ }
+
+ /**
+ * Gets the 0-based index of this object in its accessible parent.
+ *
+ * @return the 0-based index of this object in its parent; -1 if this
+ * object does not have an accessible parent.
+ *
+ * @see #getAccessibleParent
+ * @see #getAccessibleChildrenCount
+ * @see #getAccessibleChild
+ */
+ public abstract int getAccessibleIndexInParent();
+
+ /**
+ * Returns the number of accessible children of the object.
+ *
+ * @return the number of accessible children of the object.
+ */
+ public abstract int getAccessibleChildrenCount();
+
+ /**
+ * Returns the specified Accessible child of the object. The Accessible
+ * children of an Accessible object are zero-based, so the first child
+ * of an Accessible child is at index 0, the second child is at index 1,
+ * and so on.
+ *
+ * @param i zero-based index of child
+ * @return the Accessible child of the object
+ * @see #getAccessibleChildrenCount
+ */
+ public abstract Accessible getAccessibleChild(int i);
+
+ /**
+ * Gets the locale of the component. If the component does not have a
+ * locale, then the locale of its parent is returned.
+ *
+ * @return this component's locale. If this component does not have
+ * a locale, the locale of its parent is returned.
+ *
+ * @exception IllegalComponentStateException
+ * If the Component does not have its own locale and has not yet been
+ * added to a containment hierarchy such that the locale can be
+ * determined from the containing parent.
+ */
+ public abstract Locale getLocale() throws IllegalComponentStateException;
+
+ /**
+ * Adds a PropertyChangeListener to the listener list.
+ * The listener is registered for all Accessible properties and will
+ * be called when those properties change.
+ *
+ * @see #ACCESSIBLE_NAME_PROPERTY
+ * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
+ * @see #ACCESSIBLE_STATE_PROPERTY
+ * @see #ACCESSIBLE_VALUE_PROPERTY
+ * @see #ACCESSIBLE_SELECTION_PROPERTY
+ * @see #ACCESSIBLE_TEXT_PROPERTY
+ * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
+ *
+ * @param listener The PropertyChangeListener to be added
+ */
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ if (accessibleChangeSupport == null) {
+ accessibleChangeSupport = new PropertyChangeSupport(this);
+ }
+ accessibleChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * Removes a PropertyChangeListener from the listener list.
+ * This removes a PropertyChangeListener that was registered
+ * for all properties.
+ *
+ * @param listener The PropertyChangeListener to be removed
+ */
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ if (accessibleChangeSupport != null) {
+ accessibleChangeSupport.removePropertyChangeListener(listener);
+ }
+ }
+
+ /**
+ * Gets the AccessibleAction associated with this object that supports
+ * one or more actions.
+ *
+ * @return AccessibleAction if supported by object; else return null
+ * @see AccessibleAction
+ */
+ public AccessibleAction getAccessibleAction() {
+ return null;
+ }
+
+ /**
+ * Gets the AccessibleComponent associated with this object that has a
+ * graphical representation.
+ *
+ * @return AccessibleComponent if supported by object; else return null
+ * @see AccessibleComponent
+ */
+ public AccessibleComponent getAccessibleComponent() {
+ return null;
+ }
+
+ /**
+ * Gets the AccessibleSelection associated with this object which allows its
+ * Accessible children to be selected.
+ *
+ * @return AccessibleSelection if supported by object; else return null
+ * @see AccessibleSelection
+ */
+ public AccessibleSelection getAccessibleSelection() {
+ return null;
+ }
+
+ /**
+ * Gets the AccessibleText associated with this object presenting
+ * text on the display.
+ *
+ * @return AccessibleText if supported by object; else return null
+ * @see AccessibleText
+ */
+ public AccessibleText getAccessibleText() {
+ return null;
+ }
+
+ /**
+ * Gets the AccessibleEditableText associated with this object
+ * presenting editable text on the display.
+ *
+ * @return AccessibleEditableText if supported by object; else return null
+ * @see AccessibleEditableText
+ * @since 1.4
+ */
+ public AccessibleEditableText getAccessibleEditableText() {
+ return null;
+ }
+
+
+ /**
+ * Gets the AccessibleValue associated with this object that supports a
+ * Numerical value.
+ *
+ * @return AccessibleValue if supported by object; else return null
+ * @see AccessibleValue
+ */
+ public AccessibleValue getAccessibleValue() {
+ return null;
+ }
+
+ /**
+ * Gets the AccessibleIcons associated with an object that has
+ * one or more associated icons
+ *
+ * @return an array of AccessibleIcon if supported by object;
+ * otherwise return null
+ * @see AccessibleIcon
+ * @since 1.3
+ */
+ public AccessibleIcon [] getAccessibleIcon() {
+ return null;
+ }
+
+ /**
+ * Gets the AccessibleRelationSet associated with an object
+ *
+ * @return an AccessibleRelationSet if supported by object;
+ * otherwise return null
+ * @see AccessibleRelationSet
+ * @since 1.3
+ */
+ public AccessibleRelationSet getAccessibleRelationSet() {
+ return relationSet;
+ }
+
+ /**
+ * Gets the AccessibleTable associated with an object
+ *
+ * @return an AccessibleTable if supported by object;
+ * otherwise return null
+ * @see AccessibleTable
+ * @since 1.3
+ */
+ public AccessibleTable getAccessibleTable() {
+ return null;
+ }
+
+ /**
+ * Support for reporting bound property changes. If oldValue and
+ * newValue are not equal and the PropertyChangeEvent listener list
+ * is not empty, then fire a PropertyChange event to each listener.
+ * In general, this is for use by the Accessible objects themselves
+ * and should not be called by an application program.
+ * @param propertyName The programmatic name of the property that
+ * was changed.
+ * @param oldValue The old value of the property.
+ * @param newValue The new value of the property.
+ * @see java.beans.PropertyChangeSupport
+ * @see #addPropertyChangeListener
+ * @see #removePropertyChangeListener
+ * @see #ACCESSIBLE_NAME_PROPERTY
+ * @see #ACCESSIBLE_DESCRIPTION_PROPERTY
+ * @see #ACCESSIBLE_STATE_PROPERTY
+ * @see #ACCESSIBLE_VALUE_PROPERTY
+ * @see #ACCESSIBLE_SELECTION_PROPERTY
+ * @see #ACCESSIBLE_TEXT_PROPERTY
+ * @see #ACCESSIBLE_VISIBLE_DATA_PROPERTY
+ */
+ public void firePropertyChange(String propertyName,
+ Object oldValue,
+ Object newValue) {
+ if (accessibleChangeSupport != null) {
+ if (newValue instanceof PropertyChangeEvent) {
+ PropertyChangeEvent pce = (PropertyChangeEvent)newValue;
+ accessibleChangeSupport.firePropertyChange(pce);
+ } else {
+ accessibleChangeSupport.firePropertyChange(propertyName,
+ oldValue,
+ newValue);
+ }
+ }
+ }
+}
Added: trunk/core/src/openjdk/javax/javax/accessibility/AccessibleEditableText.java
===================================================================
--- trunk/core/src/openjdk/javax/javax/accessibility/AccessibleEditableText.java (rev 0)
+++ trunk/core/src/openjdk/javax/javax/accessibility/AccessibleEditableText.java 2007-11-18 10:59:24 UTC (rev 3595)
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4...
[truncated message content] |