コード例 #1
0
 /** @see ISourceReference */
 @Override
 public String getSource() throws ModelException {
   IOpenable openable = this.parent.getOpenableParent();
   IBuffer buffer = openable.getBuffer();
   if (buffer == null) {
     return null;
   }
   ISourceRange range = getSourceRange();
   int offset = range.getOffset();
   int length = range.getLength();
   if (offset == -1 || length == 0) {
     return null;
   }
   try {
     return buffer.getText(offset, length);
   } catch (RuntimeException e) {
     return null;
   }
 }