< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/JavaTextAccessibility.m

Print this page

        

*** 121,141 **** // cmcnote: inefficient to make three distinct JNI calls. Coalesce. radr://3951923 jobject axText = JNFCallStaticObjectMethod(env, sjm_getAccessibleText, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) if (axText == NULL) return nil; (*env)->DeleteLocalRef(env, axText); ! jobject axEditableText = JNFCallStaticObjectMethod(env, sjm_getAccessibleEditableText, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) if (axEditableText == NULL) return nil; static JNF_STATIC_MEMBER_CACHE(jm_getTextRange, sjc_CAccessibleText, "getTextRange", "(Ljavax/accessibility/AccessibleEditableText;IILjava/awt/Component;)Ljava/lang/String;"); jobject jrange = JNFCallStaticObjectMethod(env, jm_getTextRange, axEditableText, 0, getAxTextCharCount(env, axEditableText, fComponent), fComponent); NSString *string = JNFJavaToNSString(env, jrange); // AWT_THREADING Safe (AWTRunLoop) (*env)->DeleteLocalRef(env, jrange); (*env)->DeleteLocalRef(env, axEditableText); ! if (string == nil) string = @""; return string; } - (BOOL)accessibilityIsValueAttributeSettable --- 121,141 ---- // cmcnote: inefficient to make three distinct JNI calls. Coalesce. radr://3951923 jobject axText = JNFCallStaticObjectMethod(env, sjm_getAccessibleText, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) if (axText == NULL) return nil; (*env)->DeleteLocalRef(env, axText); ! jobject axEditableText = JNFCallStaticObjectMethod(env, sjm_getAccessibleEditableText, fAccessible, fComponent); // AWT_THREADING Safe (AWTRunLoop) if (axEditableText == NULL) return nil; static JNF_STATIC_MEMBER_CACHE(jm_getTextRange, sjc_CAccessibleText, "getTextRange", "(Ljavax/accessibility/AccessibleEditableText;IILjava/awt/Component;)Ljava/lang/String;"); jobject jrange = JNFCallStaticObjectMethod(env, jm_getTextRange, axEditableText, 0, getAxTextCharCount(env, axEditableText, fComponent), fComponent); NSString *string = JNFJavaToNSString(env, jrange); // AWT_THREADING Safe (AWTRunLoop) (*env)->DeleteLocalRef(env, jrange); (*env)->DeleteLocalRef(env, axEditableText); ! if (string == nil) string = @""; return string; } - (BOOL)accessibilityIsValueAttributeSettable
*** 303,313 **** // We cheat because we know that the array is 4 elements long (x, y, width, height) jdouble *values = (*env)->GetDoubleArrayElements(env, axBounds, 0); if (values == NULL) { // Note: Java will not be on the stack here so a java exception can't happen and no need to call ExceptionCheck. ! NSLog(@"%s failed calling GetDoubleArrayElements", __FUNCTION__); return nil; }; NSRect bounds; bounds.origin.x = values[0]; bounds.origin.y = [[[[self view] window] screen] frame].size.height - values[1] - values[3]; //values[1] is y-coord from top-left of screen. Flip. Account for the height (values[3]) when flipping --- 303,313 ---- // We cheat because we know that the array is 4 elements long (x, y, width, height) jdouble *values = (*env)->GetDoubleArrayElements(env, axBounds, 0); if (values == NULL) { // Note: Java will not be on the stack here so a java exception can't happen and no need to call ExceptionCheck. ! NSLog(@"%s failed calling GetDoubleArrayElements", __FUNCTION__); return nil; }; NSRect bounds; bounds.origin.x = values[0]; bounds.origin.y = [[[[self view] window] screen] frame].size.height - values[1] - values[3]; //values[1] is y-coord from top-left of screen. Flip. Account for the height (values[3]) when flipping
*** 425,435 **** if (axTextRange == NULL) return nil; return javaIntArrayToNSRangeValue(env, axTextRange); } ! /* * - (NSDictionary *)getActions:(JNIEnv *)env { ... } * * In the future, possibly add support: Editable text has AXShowMenu. * Textfields have AXConfirm. * --- 425,435 ---- if (axTextRange == NULL) return nil; return javaIntArrayToNSRangeValue(env, axTextRange); } ! /* * - (NSDictionary *)getActions:(JNIEnv *)env { ... } * * In the future, possibly add support: Editable text has AXShowMenu. * Textfields have AXConfirm. *
< prev index next >