diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-21 08:24:55 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-08-28 16:15:42 +0200 |
commit | 53b80ecb0b513f6f7cea88adebb3d062efee2f96 (patch) | |
tree | d8bfc1e0f6af0f1b60657504593f826e115dce58 /accessibility/bridge | |
parent | 309b4e24d2507a93a0825dff2a6df13859e9487e (diff) |
Java cleanup - Static methods and fields should be accessed in a static way.
Change-Id: Ic9539f4c78574d995d983ab4b13b371f650e0c69
Diffstat (limited to 'accessibility/bridge')
6 files changed, 27 insertions, 15 deletions
diff --git a/accessibility/bridge/org/openoffice/accessibility/AccessBridge.java b/accessibility/bridge/org/openoffice/accessibility/AccessBridge.java index d4aff6b5dfcb..780e9aa465ec 100644 --- a/accessibility/bridge/org/openoffice/accessibility/AccessBridge.java +++ b/accessibility/bridge/org/openoffice/accessibility/AccessBridge.java @@ -34,6 +34,7 @@ import com.sun.star.uno.*; import org.openoffice.java.accessibility.*; +import java.awt.EventQueue; import java.awt.Window; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -224,7 +225,8 @@ public class AccessBridge { public void dispose() { try { - java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue().invokeAndWait( + java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue(); + EventQueue.invokeAndWait( new Runnable() { public void run() { } diff --git a/accessibility/bridge/org/openoffice/accessibility/PopupWindow.java b/accessibility/bridge/org/openoffice/accessibility/PopupWindow.java index 2e33e9b9c9b1..9f7929357da9 100644 --- a/accessibility/bridge/org/openoffice/accessibility/PopupWindow.java +++ b/accessibility/bridge/org/openoffice/accessibility/PopupWindow.java @@ -17,6 +17,8 @@ */ package org.openoffice.accessibility; +import javax.accessibility.AccessibleContext; + import org.openoffice.java.accessibility.*; @@ -103,7 +105,7 @@ public class PopupWindow extends java.awt.Window { javax.accessibility.AccessibleContext ac = layeredPane.getAccessibleContext(); if (ac != null) { - ac.firePropertyChange(ac.ACCESSIBLE_CHILD_PROPERTY, null, + ac.firePropertyChange(AccessibleContext.ACCESSIBLE_CHILD_PROPERTY, null, popupLayer.getAccessibleContext()); } } @@ -118,7 +120,7 @@ public class PopupWindow extends java.awt.Window { javax.accessibility.AccessibleContext ac = layeredPane.getAccessibleContext(); if (ac != null) { - ac.firePropertyChange(ac.ACCESSIBLE_CHILD_PROPERTY, + ac.firePropertyChange(AccessibleContext.ACCESSIBLE_CHILD_PROPERTY, popupLayer.getAccessibleContext(), null); } } diff --git a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java index 29cdfe609d04..926fea3bdc5b 100644 --- a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java +++ b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleObjectFactory.java @@ -19,6 +19,7 @@ package org.openoffice.java.accessibility; import java.awt.Component; +import java.awt.EventQueue; import java.lang.ref.WeakReference; import javax.accessibility.Accessible; import javax.accessibility.AccessibleStateSet; @@ -73,7 +74,7 @@ public class AccessibleObjectFactory { public static void invokeAndWait() { try { - theEventQueue.invokeAndWait( new java.lang.Runnable () { + EventQueue.invokeAndWait( new java.lang.Runnable () { public void run() { } }); diff --git a/accessibility/bridge/org/openoffice/java/accessibility/Component.java b/accessibility/bridge/org/openoffice/java/accessibility/Component.java index d2f7873b21bb..0f175722a277 100644 --- a/accessibility/bridge/org/openoffice/java/accessibility/Component.java +++ b/accessibility/bridge/org/openoffice/java/accessibility/Component.java @@ -18,6 +18,8 @@ package org.openoffice.java.accessibility; +import java.awt.EventQueue; + import javax.accessibility.AccessibleContext; import javax.accessibility.AccessibleState; @@ -168,7 +170,8 @@ public abstract class Component extends java.awt.Component { } protected void firePropertyChange(String property, Object oldValue, Object newValue) { - getEventQueue().invokeLater(new PropertyChangeBroadcaster(property, oldValue, newValue)); + getEventQueue(); + EventQueue.invokeLater(new PropertyChangeBroadcaster(property, oldValue, newValue)); } protected void fireStatePropertyChange(AccessibleState state, boolean set) { @@ -181,14 +184,15 @@ public abstract class Component extends java.awt.Component { if (set) { broadcaster = new PropertyChangeBroadcaster( - accessibleContext.ACCESSIBLE_STATE_PROPERTY, + AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, state); } else { broadcaster = new PropertyChangeBroadcaster( - accessibleContext.ACCESSIBLE_STATE_PROPERTY, + AccessibleContext.ACCESSIBLE_STATE_PROPERTY, state, null); } - getEventQueue().invokeLater(broadcaster); + getEventQueue(); + EventQueue.invokeLater(broadcaster); } /** @@ -292,7 +296,7 @@ public abstract class Component extends java.awt.Component { switch (event.EventId) { case AccessibleEventId.ACTION_CHANGED: - firePropertyChange(accessibleContext.ACCESSIBLE_ACTION_PROPERTY, + firePropertyChange(AccessibleContext.ACCESSIBLE_ACTION_PROPERTY, toNumber(event.OldValue), toNumber(event.NewValue)); break; case AccessibleEventId.NAME_CHANGED: @@ -331,10 +335,10 @@ public abstract class Component extends java.awt.Component { firePropertyChange(AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY, null, null); break; case AccessibleEventId.CARET_CHANGED: - firePropertyChange(accessibleContext.ACCESSIBLE_CARET_PROPERTY, toNumber(event.OldValue), toNumber(event.NewValue)); + firePropertyChange(AccessibleContext.ACCESSIBLE_CARET_PROPERTY, toNumber(event.OldValue), toNumber(event.NewValue)); break; case AccessibleEventId.VALUE_CHANGED: - firePropertyChange(accessibleContext.ACCESSIBLE_VALUE_PROPERTY, toNumber(event.OldValue), toNumber(event.NewValue)); + firePropertyChange(AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, toNumber(event.OldValue), toNumber(event.NewValue)); default: // Warn about unhandled events if(Build.DEBUG) { diff --git a/accessibility/bridge/org/openoffice/java/accessibility/Container.java b/accessibility/bridge/org/openoffice/java/accessibility/Container.java index 7b2298b46cf0..29a672a96852 100644 --- a/accessibility/bridge/org/openoffice/java/accessibility/Container.java +++ b/accessibility/bridge/org/openoffice/java/accessibility/Container.java @@ -19,6 +19,7 @@ package org.openoffice.java.accessibility; import java.awt.Component; +import java.awt.EventQueue; import javax.accessibility.AccessibleContext; import javax.accessibility.AccessibleState; @@ -173,7 +174,8 @@ public class Container extends java.awt.Container implements javax.accessibility } protected void firePropertyChange(String property, Object oldValue, Object newValue) { - getEventQueue().invokeLater(new PropertyChangeBroadcaster(property, oldValue, newValue)); + getEventQueue(); + EventQueue.invokeLater(new PropertyChangeBroadcaster(property, oldValue, newValue)); } protected void fireStatePropertyChange(AccessibleState state, boolean set) { @@ -187,7 +189,8 @@ public class Container extends java.awt.Container implements javax.accessibility AccessibleContext.ACCESSIBLE_STATE_PROPERTY, state, null); } - getEventQueue().invokeLater(broadcaster); + getEventQueue(); + EventQueue.invokeLater(broadcaster); } /** diff --git a/accessibility/bridge/org/openoffice/java/accessibility/Paragraph.java b/accessibility/bridge/org/openoffice/java/accessibility/Paragraph.java index a37831121c9e..d339d751469a 100644 --- a/accessibility/bridge/org/openoffice/java/accessibility/Paragraph.java +++ b/accessibility/bridge/org/openoffice/java/accessibility/Paragraph.java @@ -64,7 +64,7 @@ public class Paragraph extends Container implements javax.accessibility.Accessib int pos = at.getCaretPosition(); // Simulating a caret event here should help at tools // that re not aware of the paragraph approach of OOo. - firePropertyChange(ac.ACCESSIBLE_CARET_PROPERTY, + firePropertyChange(AccessibleContext.ACCESSIBLE_CARET_PROPERTY, new Integer(-1), new Integer(pos)); } } @@ -75,7 +75,7 @@ public class Paragraph extends Container implements javax.accessibility.Accessib public void notifyEvent(AccessibleEventObject event) { switch (event.EventId) { case AccessibleEventId.CARET_CHANGED: - firePropertyChange(accessibleContext.ACCESSIBLE_CARET_PROPERTY, + firePropertyChange(AccessibleContext.ACCESSIBLE_CARET_PROPERTY, Component.toNumber(event.OldValue), Component.toNumber(event.NewValue)); break; |