return null;
}
case AccessibleText.WORD:
try {
String s = unoObject.getText();
BreakIterator words = BreakIterator.getWordInstance(getLocale(index));
words.setText(s);
int end = words.following(index);
end = words.previous();
int start = words.previous();
if (start == BreakIterator.DONE) {
return null;
}
return s.substring(start, end);
} catch (IllegalArgumentException e) {
return null;
} catch (IndexOutOfBoundsException e) {
return null;
}
case AccessibleText.SENTENCE:
try {
String s = unoObject.getText();
BreakIterator sentence =
BreakIterator.getSentenceInstance(getLocale(index));
sentence.setText(s);
int end = sentence.following(index);
end = sentence.previous();
int start = sentence.previous();
if (start == BreakIterator.DONE) {
return null;
}
return s.substring(start, end);
} catch (IllegalArgumentException e) {