[java-atk-wrapper] Added code to check whether accessibility technology is switched on
- From: Ke Wang <kewang src gnome org>
- To: svn-commits-list gnome org
- Subject: [java-atk-wrapper] Added code to check whether accessibility technology is switched on
- Date: Thu, 25 Jun 2009 06:56:34 +0000 (UTC)
commit 5e2905b4830392b8341b77561b0311e14a510d8f
Author: Ke Wang <ke wang sun com>
Date: Thu Jun 25 14:55:14 2009 +0800
Added code to check whether accessibility technology is switched on
wrapper/org/GNOME/Accessibility/AtkWrapper.java | 26 ++++++++++++++--------
1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/wrapper/org/GNOME/Accessibility/AtkWrapper.java b/wrapper/org/GNOME/Accessibility/AtkWrapper.java
index c6d6408..ecbd25c 100644
--- a/wrapper/org/GNOME/Accessibility/AtkWrapper.java
+++ b/wrapper/org/GNOME/Accessibility/AtkWrapper.java
@@ -27,19 +27,25 @@ import javax.accessibility.*;
public class AtkWrapper {
static {
- // Set laf to Cross platform laf because GTK laf will be the default one in some
- // environment, but GTK laf will not work well with gtk_main() started.
try {
- String lafClassName = (String)System.getProperty("swing.defaultlaf");
- if (lafClassName != null
- && lafClassName.contains("GTKLookAndFeel")) {
- javax.swing.UIManager.setLookAndFeel(
- javax.swing.UIManager.getCrossPlatformLookAndFeelClassName());
+ Process p = Runtime.getRuntime().exec ("gconftool-2 -g /desktop/gnome/interface/accessibility");
+ BufferedReader b = new BufferedReader (
+ new InputStreamReader (p.getInputStream ()));
+ String result = b.readLine();
+ if ("true".equals(result)) {
+ // Set laf to Cross platform laf because GTK laf will be the default one in some
+ // environment, but GTK laf will not work well with gtk_main() started.
+ String lafClassName = (String)System.getProperty("swing.defaultlaf");
+ if (lafClassName != null
+ && lafClassName.contains("GTKLookAndFeel")) {
+ javax.swing.UIManager.setLookAndFeel(
+ javax.swing.UIManager.getCrossPlatformLookAndFeelClassName());
+ }
+
+ System.loadLibrary("atk-wrapper");
+ AtkWrapper.initNativeLibrary();
}
} catch (Exception e) { }
-
- System.loadLibrary("atk-wrapper");
- AtkWrapper.initNativeLibrary();
}
final WindowAdapter winAdapter = new WindowAdapter() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]