[java-atk-wrapper] Fixed bug 592987 - Java Combobox is not accessible
- From: Ke Wang <kewang src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [java-atk-wrapper] Fixed bug 592987 - Java Combobox is not accessible
- Date: Wed, 26 Aug 2009 03:30:21 +0000 (UTC)
commit 4ebe0720fbe969402d1180a9deb1fdb5dbf2713a
Author: Ke Wang <ke wang sun com>
Date: Wed Aug 26 11:28:30 2009 +0800
Fixed bug 592987 - Java Combobox is not accessible
jni/src/AtkWrapper.c | 6 +++---
jni/src/jawobject.c | 11 +++++++++++
jni/src/jawutil.c | 2 +-
3 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/jni/src/AtkWrapper.c b/jni/src/AtkWrapper.c
index 3d3d75e..ee0b80c 100644
--- a/jni/src/AtkWrapper.c
+++ b/jni/src/AtkWrapper.c
@@ -223,7 +223,7 @@ focus_notify_handler (gpointer p)
jobject global_ac = para->global_ac;
JNIEnv *jniEnv = jaw_util_get_jni_env();
- JawImpl* jaw_impl = jaw_impl_find_instance(jniEnv, global_ac);
+ JawImpl* jaw_impl = jaw_impl_get_instance(jniEnv, global_ac);
if (jaw_impl == NULL) {
free_callback_para(para);
@@ -505,7 +505,7 @@ window_state_change_handler (gpointer p)
jobject global_ac = para->global_ac;
JNIEnv *jniEnv = jaw_util_get_jni_env();
- JawImpl* jaw_impl = jaw_impl_find_instance(jniEnv, global_ac);
+ JawImpl* jaw_impl = jaw_impl_get_instance(jniEnv, global_ac);
if (jaw_impl == NULL) {
free_callback_para(para);
@@ -833,7 +833,7 @@ object_state_change_handler (gpointer p)
jobject global_ac = para->global_ac;
JNIEnv *jniEnv = jaw_util_get_jni_env();
- JawImpl* jaw_impl = jaw_impl_find_instance(jniEnv, global_ac);
+ JawImpl* jaw_impl = jaw_impl_get_instance(jniEnv, global_ac);
if (jaw_impl == NULL) {
free_callback_para(para);
diff --git a/jni/src/jawobject.c b/jni/src/jawobject.c
index 2649b69..95e320a 100644
--- a/jni/src/jawobject.c
+++ b/jni/src/jawobject.c
@@ -224,6 +224,17 @@ jaw_object_get_name (AtkObject *atk_obj)
JawObject *jaw_obj = JAW_OBJECT(atk_obj);
jobject ac = jaw_obj->acc_context;
JNIEnv *jniEnv = jaw_util_get_jni_env();
+
+ if (atk_object_get_role(atk_obj) == ATK_ROLE_COMBO_BOX
+ && atk_object_get_n_accessible_children(atk_obj) == 1) {
+ AtkSelection *selection = ATK_SELECTION(atk_obj);
+ if (selection != NULL) {
+ AtkObject *child = atk_selection_ref_selection(selection, 0);
+ if (child != NULL) {
+ return atk_object_get_name(child);
+ }
+ }
+ }
jclass classAccessibleContext = (*jniEnv)->FindClass( jniEnv, "javax/accessibility/AccessibleContext" );
jmethodID jmid = (*jniEnv)->GetMethodID( jniEnv, classAccessibleContext, "getAccessibleName", "()Ljava/lang/String;" );
diff --git a/jni/src/jawutil.c b/jni/src/jawutil.c
index e2047b2..407e96e 100644
--- a/jni/src/jawutil.c
+++ b/jni/src/jawutil.c
@@ -757,7 +757,7 @@ jaw_util_get_atk_state_type_from_java_state (JNIEnv *jniEnv,
}
if (is_same_java_state( jniEnv, jobj, "COLLAPSED" )) {
- return ATK_STATE_DEFUNCT;
+ return ATK_STATE_EXPANDED;
}
if (is_same_java_state( jniEnv, jobj, "EDITABLE" )) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]