1 import com
.sun
.star
.accessibility
.XAccessible
;
2 import com
.sun
.star
.accessibility
.AccessibleEventObject
;
3 import com
.sun
.star
.accessibility
.AccessibleEventId
;
4 import com
.sun
.star
.uno
.UnoRuntime
;
5 import com
.sun
.star
.uno
.AnyConverter
;
7 import java
.io
.PrintStream
;
9 import tools
.NameProvider
;
11 class ContextEventHandler
14 public ContextEventHandler (AccessibleEventObject aEvent
, AccessibilityTreeModel aTreeModel
)
16 super (aEvent
, aTreeModel
);
19 public void PrintOldAndNew (PrintStream out
)
23 case AccessibleEventId
.STATE_CHANGED
:
26 int nOldValue
= AnyConverter
.toInt (maEvent
.OldValue
);
27 out
.println (" turning off state " + nOldValue
+ " ("
28 + NameProvider
.getStateName (nOldValue
) + ")");
30 catch (com
.sun
.star
.lang
.IllegalArgumentException e
)
34 int nNewValue
= AnyConverter
.toInt (maEvent
.NewValue
);
35 out
.println (" turning on state " + nNewValue
+ " ("
36 + NameProvider
.getStateName (nNewValue
) + ")");
38 catch (com
.sun
.star
.lang
.IllegalArgumentException e
)
43 super.PrintOldAndNew (out
);
48 public void Process ()
50 maTreeModel
.updateNode (mxEventSource
, AccessibleContextHandler
.class);