* Contributors:
* Christopher Lenz - initial API and implementation
*
- * $Id: SourceReference.java,v 1.1 2004-09-02 18:05:21 jsurfer Exp $
+ * $Id: SourceReference.java,v 1.2 2006-10-21 23:14:29 pombredanne Exp $
*/
package net.sourceforge.phpeclipse.core.model;
import org.eclipse.jface.text.Region;
/**
- * Default implementation of {@link ISourceReference} based on
- * {@link IDocument}.
+ * Default implementation of {@link ISourceReference} based on {@link IDocument}.
*/
public class SourceReference implements ISourceReference {
/**
* Constructor.
*
- * @param document The document that contains the source reference
+ * @param document
+ * The document that contains the source reference
*/
public SourceReference(IDocument document) {
this(document, 0, 0);
/**
* Constructor.
*
- * @param document The document that contains the source reference
+ * @param document
+ * The document that contains the source reference
*/
public SourceReference(IDocument document, int offset) {
this(document, offset, 0);
/**
* Constructor.
*
- * @param document The document that contains the source reference
+ * @param document
+ * The document that contains the source reference
*/
public SourceReference(IDocument document, int offset, int length) {
this.document = document;
*/
public String getSource() {
try {
- return document.get(sourceRegion.getOffset(),
- sourceRegion.getLength());
+ return document.get(sourceRegion.getOffset(), sourceRegion
+ .getLength());
} catch (BadLocationException e) {
throw new IllegalStateException(
- "Model not synchronized with document"); //$NON-NLS-1$
+ "Model not synchronized with document"); //$NON-NLS-1$
}
}
/**
* Sets the source region covered by the element.
*
- * @param offset the offset of the region
- * @param length the length of the region
+ * @param offset
+ * the offset of the region
+ * @param length
+ * the length of the region
*/
public final void setSourceRegion(int offset, int length) {
sourceRegion = new Region(offset, length);
/**
* Sets the source region covered by the element.
*
- * @param region the source region to set
+ * @param region
+ * the source region to set
*/
public final void setSourceRegion(IRegion region) {
setSourceRegion(region.getOffset(), region.getLength());