Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2010-01-21 17:02:07 +0000
committerSilenio Quarti2010-01-21 17:02:07 +0000
commitee2ee4f57237cb3ce85ff8152c3e5c98d417dfff (patch)
tree718b023b3881ba0164c25a6510f38e5a7ab861d7
parenta7a7ebce671c8dd67c7583413df01cfa0e136761 (diff)
downloadeclipse.platform.swt-ee2ee4f57237cb3ce85ff8152c3e5c98d417dfff.tar.gz
eclipse.platform.swt-ee2ee4f57237cb3ce85ff8152c3e5c98d417dfff.tar.xz
eclipse.platform.swt-ee2ee4f57237cb3ce85ff8152c3e5c98d417dfff.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java95
1 files changed, 37 insertions, 58 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
index 5410828d22..db3800c63f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/Accessible.java
@@ -76,7 +76,8 @@ public class Accessible {
* @since 3.6
*/
public Accessible(Accessible parent) {
- this.parent = parent;
+ this.parent = checkNull(parent);
+ this.control = parent.control;
//TODO: (platform-specific?) code to add this accessible to the parent's children
}
@@ -86,6 +87,11 @@ public class Accessible {
protected Accessible() {
}
+ static Accessible checkNull (Accessible parent) {
+ if (parent == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ return parent;
+ }
+
Accessible (Control control) {
super ();
this.control = control;
@@ -177,7 +183,11 @@ public class Accessible {
public void addAccessibleTextListener (AccessibleTextListener listener) {
checkWidget ();
if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- accessibleTextListeners.addElement (listener);
+ if (listener instanceof AccessibleTextExtendedListener) {
+ accessibleTextExtendedListeners.addElement (listener);
+ } else {
+ accessibleTextListeners.addElement (listener);
+ }
}
/**
@@ -291,33 +301,6 @@ public class Accessible {
/**
* Adds the listener to the collection of listeners that will be
* notified when an accessible client asks for any of the properties
- * defined in the <code>AccessibleTextExtended</code> interface.
- *
- * @param listener the listener that should be notified when the receiver
- * is asked for <code>AccessibleTextExtended</code> interface properties
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- *
- * @see AccessibleTextExtendedListener
- * @see #removeAccessibleTextExtendedListener
- *
- * @since 3.6
- */
- public void addAccessibleTextExtendedListener(AccessibleTextExtendedListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- accessibleTextExtendedListeners.addElement(listener);
- }
-
- /**
- * Adds the listener to the collection of listeners that will be
- * notified when an accessible client asks for any of the properties
* defined in the <code>AccessibleValue</code> interface.
*
* @param listener the listener that should be notified when the receiver
@@ -432,7 +415,6 @@ public class Accessible {
* </p>
*/
public void dispose () {
- if (control != null) return;
// TODO: platform-specific code to dispose a lightweight accessible
}
@@ -559,7 +541,11 @@ public class Accessible {
public void removeAccessibleTextListener (AccessibleTextListener listener) {
checkWidget ();
if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- accessibleTextListeners.removeElement (listener);
+ if (listener instanceof AccessibleTextExtendedListener) {
+ accessibleTextExtendedListeners.removeElement (listener);
+ } else {
+ accessibleTextListeners.removeElement (listener);
+ }
}
/**
@@ -673,33 +659,6 @@ public class Accessible {
/**
* Removes the listener from the collection of listeners that will be
* notified when an accessible client asks for any of the properties
- * defined in the <code>AccessibleTextExtended</code> interface.
- *
- * @param listener the listener that should no longer be notified when the receiver
- * is asked for <code>AccessibleTextExtended</code> interface properties
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
- * </ul>
- *
- * @see AccessibleTextExtendedListener
- * @see #addAccessibleTextExtendedListener
- *
- * @since 3.6
- */
- public void removeAccessibleTextExtendedListener(AccessibleTextExtendedListener listener) {
- checkWidget();
- if (listener == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
- accessibleTextExtendedListeners.removeElement(listener);
- }
-
- /**
- * Removes the listener from the collection of listeners that will be
- * notified when an accessible client asks for any of the properties
* defined in the <code>AccessibleValue</code> interface.
*
* @param listener the listener that should no longer be notified when the receiver
@@ -822,6 +781,26 @@ public class Accessible {
}
/**
+ * Sends a message with event-specific data to accessible clients
+ * indicating that something has changed within a custom control.
+ *
+ * @param event an <code>ACC</code> constant beginning with EVENT_* indicating the message to send
+ * @param childID an identifier specifying a child of the control or the control itself
+ * @param eventData an object containing event-specific data
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver's control has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver's control</li>
+ * </ul>
+ *
+ * @since 3.6
+ */
+ public void sendEvent(int event, int childID, Object eventData) {
+ checkWidget();
+ //TODO: send platform-specific event (i.e. WinEvent with EVENT_OBJECT_* or IA2_EVENT_* on Win, Signal on ATK, Notification on Mac)
+ }
+
+ /**
* Sends a message to accessible clients that the child selection
* within a custom container control has changed.
*

Back to the top