Ignore the bin directory
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / ICompilationUnitDocumentProvider.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation 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  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpeclipse.phpeditor;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IProgressMonitor;
15
16 import org.eclipse.jface.text.IDocument;
17 import org.eclipse.jface.text.ILineTracker;
18 import org.eclipse.jface.text.source.IAnnotationModelListener;
19
20 import org.eclipse.ui.texteditor.IDocumentProvider;
21 import org.eclipse.ui.texteditor.IDocumentProviderExtension2;
22 import org.eclipse.ui.texteditor.IDocumentProviderExtension3;
23
24 import net.sourceforge.phpdt.core.ICompilationUnit;
25
26 /**
27  * @since 3.0
28  */
29 public interface ICompilationUnitDocumentProvider extends IDocumentProvider, IDocumentProviderExtension2, IDocumentProviderExtension3 {
30                 
31         /**
32          * Shuts down this provider.
33          */
34         void shutdown();
35         
36         /**
37          * Returns the working copy for the given element.
38          * 
39          * @param element the element
40          * @return the working copy for the given element
41          */
42         ICompilationUnit getWorkingCopy(Object element);
43         
44         /**
45          * Saves the content of the given document to the given element. This method has
46          * only an effect if it is called when directly or indirectly inside <code>saveDocument</code>.
47          * 
48          * @param monitor the progress monitor
49          * @param element the element to which to save
50          * @param document the document to save
51          * @param overwrite <code>true</code> if the save should be enforced
52          */
53         void saveDocumentContent(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException;
54         
55         /**
56          * Creates a line tracker for the given element. It is of the same kind as the one that would be
57          * used for a newly created document for the given element.
58          * 
59          * @param element the element
60          * @return a line tracker for the given element
61          */
62         ILineTracker createLineTracker(Object element);
63         
64         /**
65          * Sets the document provider's save policy.
66          * 
67          * @param savePolicy the save policy
68          */
69         void setSavePolicy(ISavePolicy savePolicy);
70         
71         /**
72          * Adds a listener that reports changes from all compilation unit annotation models.
73          * 
74          * @param listener the listener
75          */
76         void addGlobalAnnotationModelListener(IAnnotationModelListener listener);
77
78         /**
79          * Removes the listener.
80          * 
81          * @param listener the listener
82          */     
83         void removeGlobalAnnotationModelListener(IAnnotationModelListener listener);
84 }