if (e.childID == ACC.CHILDID_SELF)
e.result = model.getAccessibleText();
else {
int linkCount = model.getHyperlinkCount();
if (e.childID >= 0 && e.childID < linkCount) {
IHyperlinkSegment link = model.getHyperlink(e.childID);
e.result = link.getText();
}
}
}
public void getHelp(AccessibleEvent e) {
e.result = getToolTipText();
int linkCount = model.getHyperlinkCount();
if (e.result == null && e.childID >= 0 && e.childID < linkCount) {
IHyperlinkSegment link = model.getHyperlink(e.childID);
e.result = link.getText();
}
}
});
accessible.addAccessibleControlListener(new AccessibleControlAdapter() {
public void getChildAtPoint(AccessibleControlEvent e) {
Point pt = toControl(new Point(e.x, e.y));
IHyperlinkSegment link = model.findHyperlinkAt(pt.x, pt.y);
if (link != null)
e.childID = model.indexOf(link);
else
e.childID = ACC.CHILDID_SELF;
}
public void getLocation(AccessibleControlEvent e) {
Rectangle location = null;
if (e.childID != ACC.CHILDID_SELF
&& e.childID != ACC.CHILDID_NONE) {
int index = e.childID;
IHyperlinkSegment link = model.getHyperlink(index);
if (link != null) {
location = link.getBounds();
}
}
if (location == null) {
location = getBounds();
}