コード例 #1
0
 protected CompoundRegion[] getOutsideRegions(IStructuredDocument model, IRegion reg) {
   CompoundRegion[] ret = new CompoundRegion[2];
   RegionIterator it = new RegionIterator(model, reg.getOffset());
   it.prev();
   if (it.hasPrev()) {
     ITextRegion textRegion = it.prev();
     IStructuredDocumentRegion documentRegion = it.getStructuredDocumentRegion();
     ret[0] = new CompoundRegion(documentRegion, textRegion);
   } else {
     ret[0] = null;
   }
   it.reset(model, reg.getOffset() + reg.getLength());
   if (it.hasNext()) {
     ITextRegion textRegion = it.next();
     IStructuredDocumentRegion documentRegion = it.getStructuredDocumentRegion();
     ret[1] = new CompoundRegion(documentRegion, textRegion);
   } else {
     ret[1] = null;
   }
   return ret;
 }
コード例 #2
0
 public RegionIterator(IStructuredDocumentRegion flatNode, ITextRegion region) {
   super();
   reset(flatNode, region);
 }
コード例 #3
0
  public RegionIterator(IStructuredDocument structuredDocument, int index) {
    super();

    reset(structuredDocument, index);
  }