public void getCaretOffset (AccessibleTextEvent e) {
e.offset = text.getCaretPosition ();
}
});
getAccessible().addAccessibleControlListener (new AccessibleControlAdapter() {
@Override
public void getChildAtPoint (AccessibleControlEvent e) {
Point testPoint = toControl (e.x, e.y);
if (getBounds ().contains (testPoint)) {
e.childID = ACC.CHILDID_SELF;
}
}
@Override
public void getLocation (AccessibleControlEvent e) {
Rectangle location = getBounds ();
Point pt = toDisplay (location.x, location.y);
e.x = pt.x;
e.y = pt.y;
e.width = location.width;
e.height = location.height;
}
@Override
public void getChildCount (AccessibleControlEvent e) {
e.detail = 0;
}
@Override
public void getRole (AccessibleControlEvent e) {
e.detail = ACC.ROLE_COMBOBOX;
}
@Override
public void getState (AccessibleControlEvent e) {
e.detail = ACC.STATE_NORMAL;
}
@Override
public void getValue (AccessibleControlEvent e) {
e.result = getText ();
}
});
text.getAccessible ().addAccessibleControlListener (new AccessibleControlAdapter () {
@Override
public void getRole (AccessibleControlEvent e) {
e.detail = text.getEditable () ? ACC.ROLE_TEXT : ACC.ROLE_LABEL;
}
});
arrow.getAccessible ().addAccessibleControlListener (new AccessibleControlAdapter() {
@Override
public void getDefaultAction (AccessibleControlEvent e) {
e.result = isDropped () ? SWT.getMessage ("SWT_Close") : SWT.getMessage ("SWT_Open"); //$NON-NLS-1$ //$NON-NLS-2$
}
});