1 /*******************************************************************************
 
   2  * Copyright (c) 2000, 2003 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.phpdt.ui;
 
  13 import org.eclipse.core.runtime.CoreException;
 
  15 import org.eclipse.ui.IEditorInput;
 
  17 import net.sourceforge.phpdt.core.ICompilationUnit;
 
  20  * Interface for accessing working copies of <code>ICompilationUnit</code>
 
  21  * objects. The original compilation unit is only given indirectly by means
 
  22  * of an <code>IEditorInput</code>. The life cycle is as follows:
 
  24  * <li> <code>connect</code> creates and remembers a working copy of the 
 
  25  *   compilation unit which is encoded in the given editor input</li>
 
  26  * <li> <code>getWorkingCopy</code> returns the working copy remembered on 
 
  27  *   <code>connect</code></li>
 
  28  * <li> <code>disconnect</code> destroys the working copy remembered on 
 
  29  *   <code>connect</code></li>
 
  32  * This interface is not intended to be implemented by clients.
 
  35  * @see JavaUI#getWorkingCopyManager
 
  37 public interface IWorkingCopyManager {
 
  40          * Connects the given editor input to this manager. After calling
 
  41          * this method, a working copy will be available for the compilation unit encoded
 
  42          * in the given editor input (does nothing if there is no encoded compilation unit).
 
  44          * @param input the editor input
 
  45          * @exception CoreException if the working copy cannot be created for the 
 
  48         void connect(IEditorInput input) throws CoreException;
 
  51          * Disconnects the given editor input from this manager. After calling
 
  52          * this method, a working copy for the compilation unit encoded
 
  53          * in the given editor input will no longer be available. Does nothing if there
 
  54          * is no encoded compilation unit, or if there is no remembered working copy for
 
  55          * the compilation unit.
 
  57          * @param input the editor input
 
  59         void disconnect(IEditorInput input);
 
  62          * Returns the working copy remembered for the compilation unit encoded in the
 
  65          * @param input the editor input
 
  66          * @return the working copy of the compilation unit, or <code>null</code> if the
 
  67          *   input does not encode an editor input, or if there is no remembered working
 
  68          *   copy for this compilation unit
 
  70         ICompilationUnit getWorkingCopy(IEditorInput input);
 
  73          * Shuts down this working copy manager. All working copies still remembered
 
  74          * by this manager are destroyed.