X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SourceType.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SourceType.java index 9af3643..4a339bb 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SourceType.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SourceType.java @@ -12,6 +12,7 @@ package net.sourceforge.phpdt.internal.core; import java.util.ArrayList; +import net.sourceforge.phpdt.core.ICompilationUnit; import net.sourceforge.phpdt.core.IField; import net.sourceforge.phpdt.core.IJavaElement; import net.sourceforge.phpdt.core.IMember; @@ -19,11 +20,15 @@ import net.sourceforge.phpdt.core.IMethod; import net.sourceforge.phpdt.core.IPackageFragment; import net.sourceforge.phpdt.core.IParent; import net.sourceforge.phpdt.core.IType; +import net.sourceforge.phpdt.core.ITypeHierarchy; +import net.sourceforge.phpdt.core.IWorkingCopy; import net.sourceforge.phpdt.core.JavaModelException; import net.sourceforge.phpdt.core.jdom.IDOMNode; import net.sourceforge.phpdt.internal.core.util.Util; import net.sourceforge.phpdt.internal.corext.Assert; +import org.eclipse.core.runtime.IProgressMonitor; + /** * Handle for a source type. Info object is a SourceTypeElementInfo. * @@ -37,7 +42,6 @@ public class SourceType extends Member implements IType { * An empty list of Strings */ protected static final String[] fgEmptyList = new String[] {}; - protected SourceType(JavaElement parent, String name) { super(parent, name); Assert.isTrue(name.indexOf('.') == -1, Util.bind("sourcetype.invalidName", name)); //$NON-NLS-1$ @@ -365,66 +369,186 @@ public class SourceType extends Member implements IType { /** * @see IType */ - //public ITypeHierarchy loadTypeHierachy(InputStream input, IProgressMonitor monitor) throws JavaModelException { - // return TypeHierarchy.load(this, input); - //} +// public ITypeHierarchy loadTypeHierachy(InputStream input, IProgressMonitor monitor) throws JavaModelException { +// return loadTypeHierachy(input, DefaultWorkingCopyOwner.PRIMARY, monitor); +// } + /** + * NOTE: This method is not part of the API has it is not clear clients would easily use it: they would need to + * first make sure all working copies for the given owner exist before calling it. This is especially har at startup + * time. + * In case clients want this API, here is how it should be specified: + *

+ * Loads a previously saved ITypeHierarchy from an input stream. A type hierarchy can + * be stored using ITypeHierachy#store(OutputStream). A compilation unit of a + * loaded type has the given owner if such a working copy exists, otherwise the type's + * compilation unit is a primary compilation unit. + * + * Only hierarchies originally created by the following methods can be loaded: + *