* implementors of IndexedRegion
*/
public Object[] getElements(IStructuredModel model, int start, int end) {
Object[] localSelectedStructures = null;
if (model != null) {
IndexedRegion region = model.getIndexedRegion(start);
if (region != null) {
if (end <= region.getEndOffset()) {
// single selection
localSelectedStructures = new Object[1];
localSelectedStructures[0] = region;
}
else {
// multiple selection
int maxLength = model.getStructuredDocument().getLength();
List structures = new ArrayList(2);
while (region != null && region.getEndOffset() <= end && region.getEndOffset() < maxLength) {
structures.add(region);
region = model.getIndexedRegion(region.getEndOffset() + 1);
}
localSelectedStructures = structures.toArray();
}
}
}