3m9 compatible;
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / IOpenable.java
index 9409305..b0cd469 100644 (file)
@@ -10,6 +10,9 @@
  *******************************************************************************/
 package net.sourceforge.phpdt.core;
 
+import org.eclipse.core.runtime.IProgressMonitor;
+import net.sourceforge.phpdt.core.JavaModelException;
+
 
 /**
  * Common protocol for Java elements that must be opened before they can be 
@@ -52,7 +55,7 @@ public interface IOpenable {
  *
  * @exception JavaModelException if an error occurs closing this element
  */
-//public void close() throws JavaModelException;
+public void close() throws JavaModelException;
 /**
  * Returns the buffer opened for this element, or <code>null</code>
  * if this element does not have a buffer.
@@ -82,7 +85,7 @@ public IBuffer getBuffer() throws JavaModelException;
  * element's children and has not yet destroyed
  * </ul>
  */
-//boolean hasUnsavedChanges() throws JavaModelException;
+boolean hasUnsavedChanges() throws JavaModelException;
 /**
  * Returns whether the element is consistent with its underlying resource or buffer.
  * The element is consistent when opened, and is consistent if the underlying resource
@@ -105,6 +108,22 @@ boolean isConsistent() throws JavaModelException;
  */
 boolean isOpen();
 /**
+ * Opens this element and all parent elements that are not already open.
+ * For compilation units, a buffer is opened on the contents of the underlying resource.
+ *
+ * <p>Note: although <code>open</code> is exposed in the API, clients are
+ * not expected to open and close elements - the Java model does this automatically
+ * as elements are accessed.
+ *
+ * @param progress the given progress monitor
+ * @exception JavaModelException if an error occurs accessing the contents
+ *             of its underlying resource. Reasons include:
+ * <ul>
+ *  <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
+ * </ul>
+ */
+public void open(IProgressMonitor progress) throws JavaModelException;
+/**
  * Makes this element consistent with its underlying resource or buffer 
  * by updating the element's structure and properties as necessary.
  *
@@ -116,7 +135,7 @@ boolean isOpen();
  * </ul>
  * @see IOpenable#isConsistent
  */
-//void makeConsistent(IProgressMonitor progress) throws JavaModelException;
+void makeConsistent(IProgressMonitor progress) throws JavaModelException;
 /**
  * Opens this element and all parent elements that are not already open.
  * For compilation units, a buffer is opened on the contents of the underlying resource.
@@ -163,5 +182,6 @@ boolean isOpen();
  *  <li>This Java element is read-only (READ_ONLY)</li>
  * </ul>
  */
-//public void save(IProgressMonitor progress, boolean force) throws JavaModelException;
+public void save(IProgressMonitor progress, boolean force) throws JavaModelException;
+
 }