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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpeclipse.phpeditor;
13 import net.sourceforge.phpdt.core.ICompilationUnit;
15 import org.eclipse.core.runtime.CoreException;
16 import org.eclipse.core.runtime.IProgressMonitor;
17 import org.eclipse.jface.text.IDocument;
18 import org.eclipse.jface.text.ILineTracker;
19 import org.eclipse.jface.text.source.IAnnotationModelListener;
20 import org.eclipse.ui.texteditor.IDocumentProvider;
21 import org.eclipse.ui.texteditor.IDocumentProviderExtension2;
22 import org.eclipse.ui.texteditor.IDocumentProviderExtension3;
27 public interface ICompilationUnitDocumentProvider extends IDocumentProvider,
28 IDocumentProviderExtension2, IDocumentProviderExtension3 {
31 * Shuts down this provider.
36 * Returns the working copy for the given element.
40 * @return the working copy for the given element
42 ICompilationUnit getWorkingCopy(Object element);
45 * Saves the content of the given document to the given element. This method
46 * has only an effect if it is called when directly or indirectly inside
47 * <code>saveDocument</code>.
50 * the progress monitor
52 * the element to which to save
54 * the document to save
56 * <code>true</code> if the save should be enforced
58 void saveDocumentContent(IProgressMonitor monitor, Object element,
59 IDocument document, boolean overwrite) throws CoreException;
62 * Creates a line tracker for the given element. It is of the same kind as
63 * the one that would be used for a newly created document for the given
68 * @return a line tracker for the given element
70 ILineTracker createLineTracker(Object element);
73 * Sets the document provider's save policy.
78 void setSavePolicy(ISavePolicy savePolicy);
81 * Adds a listener that reports changes from all compilation unit annotation
87 void addGlobalAnnotationModelListener(IAnnotationModelListener listener);
90 * Removes the listener.
95 void removeGlobalAnnotationModelListener(IAnnotationModelListener listener);