intial source from ttp://www.sf.net/projects/wdte
[phpeclipse.git] / net.sourceforge.phpeclipse.core / src / net / sourceforge / phpeclipse / core / model / ISourceReference.java
1 /*
2  * Copyright (c) 2003-2004 Christopher Lenz and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     Christopher Lenz - initial API
10  * 
11  * $Id: ISourceReference.java,v 1.1 2004-09-02 18:05:21 jsurfer Exp $
12  */
13
14 package net.sourceforge.phpeclipse.core.model;
15
16 import org.eclipse.jface.text.IRegion;
17
18 /**
19  * Common protocol for model elements that have associated source code.
20  */
21 public interface ISourceReference {
22
23         /**
24          * Returns the source code associated with this model element.
25          * 
26          * <p>
27          *   This method extracts the substring from the source buffer containing
28          *   this source element. This corresponds to the source regione that would
29          *   be returned by {@link ISourceReference#getSourceRegion()}</code>.
30          * </p>
31          * 
32          * @return The source code, or <code>null</code> if this element has no 
33          *         associated source code
34          */
35         String getSource();
36
37         /**
38          * Returns the source range associated with this element.
39          * 
40          * @return The source region, or <code>null</code> if this element has no 
41          *         associated source code
42          */
43         IRegion getSourceRegion();
44
45 }