X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/JavaCore.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/JavaCore.java index ec52806..f2d1b6c 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/JavaCore.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/JavaCore.java @@ -14,7 +14,7 @@ import net.sourceforge.phpdt.internal.core.BufferManager; import net.sourceforge.phpdt.internal.core.ClasspathEntry; import net.sourceforge.phpdt.internal.core.JavaModel; import net.sourceforge.phpdt.internal.core.JavaModelManager; -import net.sourceforge.phpdt.internal.core.Region; +//import net.sourceforge.phpdt.internal.core.Region; import net.sourceforge.phpdt.internal.core.util.MementoTokenizer; //incastrix //import net.sourceforge.phpdt.internal.corext.Assert; @@ -24,16 +24,16 @@ import net.sourceforge.phpeclipse.PHPeclipsePlugin; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IMarkerDelta; +//import org.eclipse.core.resources.IMarker; +//import org.eclipse.core.resources.IMarkerDelta; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeListener; +//import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; +//import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Plugin; @@ -1614,13 +1614,13 @@ public class JavaCore { * @param element * the Java element for which the marker needs to be configured */ - public static void addJavaElementMarkerAttributes(Map attributes, - IJavaElement element) { - // if (element instanceof IMember) - // element = ((IMember) element).getClassFile(); - if (attributes != null && element != null) - attributes.put(ATT_HANDLE_ID, element.getHandleIdentifier()); - } +// public static void addJavaElementMarkerAttributes(Map attributes, +// IJavaElement element) { +// // if (element instanceof IMember) +// // element = ((IMember) element).getClassFile(); +// if (attributes != null && element != null) +// attributes.put(ATT_HANDLE_ID, element.getHandleIdentifier()); +// } /** * Adds the given listener for POST_CHANGE resource change events to the @@ -1636,11 +1636,11 @@ public class JavaCore { * @see #removePreProcessingResourceChangedListener(IResourceChangeListener) * @since 3.0 */ - public static void addPreProcessingResourceChangedListener( - IResourceChangeListener listener) { - JavaModelManager.getJavaModelManager().deltaState - .addPreResourceChangedListener(listener); - } +// public static void addPreProcessingResourceChangedListener( +// IResourceChangeListener listener) { +// JavaModelManager.getJavaModelManager().deltaState +// .addPreResourceChangedListener(listener); +// } /** * Configures the given marker for the given Java element. Used for markers, @@ -1654,13 +1654,13 @@ public class JavaCore { * if the IMarker.setAttribute on the marker * fails */ - public void configureJavaElementMarker(IMarker marker, IJavaElement element) - throws CoreException { - // if (element instanceof IMember) - // element = ((IMember) element).getClassFile(); - if (marker != null && element != null) - marker.setAttribute(ATT_HANDLE_ID, element.getHandleIdentifier()); - } +// public void configureJavaElementMarker(IMarker marker, IJavaElement element) +// throws CoreException { +// // if (element instanceof IMember) +// // element = ((IMember) element).getClassFile(); +// if (marker != null && element != null) +// marker.setAttribute(ATT_HANDLE_ID, element.getHandleIdentifier()); +// } /** * Returns the Java model element corresponding to the given handle @@ -2138,43 +2138,43 @@ public class JavaCore { * initializer or null if none was found. * @since 2.1 */ - public static ClasspathVariableInitializer getClasspathVariableInitializer( - String variable) { - - Plugin jdtCorePlugin = JavaCore.getPlugin(); - if (jdtCorePlugin == null) - return null; - - // IExtensionPoint extension = - // jdtCorePlugin.getDescriptor().getExtensionPoint(JavaModelManager.CPVARIABLE_INITIALIZER_EXTPOINT_ID); - // if (extension != null) { - // IExtension[] extensions = extension.getExtensions(); - // for(int i = 0; i < extensions.length; i++){ - // IConfigurationElement [] configElements = - // extensions[i].getConfigurationElements(); - // for(int j = 0; j < configElements.length; j++){ - // try { - // String varAttribute = configElements[j].getAttribute("variable"); - // //$NON-NLS-1$ - // if (variable.equals(varAttribute)) { - // if (JavaModelManager.CP_RESOLVE_VERBOSE) { - // System.out.println("CPVariable INIT - found initializer: "+variable+" - // --> " + - // configElements[j].getAttribute("class"));//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$ - // } - // Object execExt = - // configElements[j].createExecutableExtension("class"); //$NON-NLS-1$ - // if (execExt instanceof ClasspathVariableInitializer){ - // return (ClasspathVariableInitializer)execExt; - // } - // } - // } catch(CoreException e){ - // } - // } - // } - // } - return null; - } +// public static ClasspathVariableInitializer getClasspathVariableInitializer( +// String variable) { +// +// Plugin jdtCorePlugin = JavaCore.getPlugin(); +// if (jdtCorePlugin == null) +// return null; +// +// // IExtensionPoint extension = +// // jdtCorePlugin.getDescriptor().getExtensionPoint(JavaModelManager.CPVARIABLE_INITIALIZER_EXTPOINT_ID); +// // if (extension != null) { +// // IExtension[] extensions = extension.getExtensions(); +// // for(int i = 0; i < extensions.length; i++){ +// // IConfigurationElement [] configElements = +// // extensions[i].getConfigurationElements(); +// // for(int j = 0; j < configElements.length; j++){ +// // try { +// // String varAttribute = configElements[j].getAttribute("variable"); +// // //$NON-NLS-1$ +// // if (variable.equals(varAttribute)) { +// // if (JavaModelManager.CP_RESOLVE_VERBOSE) { +// // System.out.println("CPVariable INIT - found initializer: "+variable+" +// // --> " + +// // configElements[j].getAttribute("class"));//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$ +// // } +// // Object execExt = +// // configElements[j].createExecutableExtension("class"); //$NON-NLS-1$ +// // if (execExt instanceof ClasspathVariableInitializer){ +// // return (ClasspathVariableInitializer)execExt; +// // } +// // } +// // } catch(CoreException e){ +// // } +// // } +// // } +// // } +// return null; +// } /** * Returns the names of all known classpath variables. @@ -2689,9 +2689,9 @@ public class JavaCore { * * @return the single instance of the Java core plug-in runtime class */ - public static PHPeclipsePlugin getJavaCore() { - return (PHPeclipsePlugin) getPlugin(); - } +// public static PHPeclipsePlugin getJavaCore() { +// return (PHPeclipsePlugin) getPlugin(); +// } /** * Helper method for returning one option value only. Equivalent to @@ -3172,49 +3172,49 @@ public class JavaCore { * if the IMarker.getAttribute on the marker * fails */ - public static boolean isReferencedBy(IJavaElement element, IMarker marker) - throws CoreException { - - // only match units or classfiles - if (element instanceof IMember) { - IMember member = (IMember) element; - if (member.isBinary()) { - element = null; // member.getClassFile(); - } else { - element = member.getCompilationUnit(); - } - } - if (element == null) - return false; - if (marker == null) - return false; - - String markerHandleId = (String) marker.getAttribute(ATT_HANDLE_ID); - if (markerHandleId == null) - return false; - - IJavaElement markerElement = JavaCore.create(markerHandleId); - // while (true){ - if (element.equals(markerElement)) - return true; // external elements may still be equal with - // different - // handleIDs. - - // cycle through enclosing types in case marker is associated with a - // classfile (15568) - // if (markerElement instanceof IClassFile){ - // IType enclosingType = - // ((IClassFile)markerElement).getType().getDeclaringType(); - // if (enclosingType != null){ - // markerElement = enclosingType.getClassFile(); // retry with immediate - // enclosing classfile - // continue; - // } - // } - // break; - // } - return false; - } +// public static boolean isReferencedBy(IJavaElement element, IMarker marker) +// throws CoreException { +// +// // only match units or classfiles +// if (element instanceof IMember) { +// IMember member = (IMember) element; +// if (member.isBinary()) { +// element = null; // member.getClassFile(); +// } else { +// element = member.getCompilationUnit(); +// } +// } +// if (element == null) +// return false; +// if (marker == null) +// return false; +// +// String markerHandleId = (String) marker.getAttribute(ATT_HANDLE_ID); +// if (markerHandleId == null) +// return false; +// +// IJavaElement markerElement = JavaCore.create(markerHandleId); +// // while (true){ +// if (element.equals(markerElement)) +// return true; // external elements may still be equal with +// // different +// // handleIDs. +// +// // cycle through enclosing types in case marker is associated with a +// // classfile (15568) +// // if (markerElement instanceof IClassFile){ +// // IType enclosingType = +// // ((IClassFile)markerElement).getType().getDeclaringType(); +// // if (enclosingType != null){ +// // markerElement = enclosingType.getClassFile(); // retry with immediate +// // enclosing classfile +// // continue; +// // } +// // } +// // break; +// // } +// return false; +// } /** * Returns whether the given marker delta references the given Java element. @@ -3230,50 +3230,50 @@ public class JavaCore { * if the IMarkerDelta.getAttribute on the * marker delta fails */ - public static boolean isReferencedBy(IJavaElement element, - IMarkerDelta markerDelta) throws CoreException { - - // only match units or classfiles - if (element instanceof IMember) { - IMember member = (IMember) element; - if (member.isBinary()) { - element = null; // member.getClassFile(); - } else { - element = member.getCompilationUnit(); - } - } - if (element == null) - return false; - if (markerDelta == null) - return false; - - String markerDeltarHandleId = (String) markerDelta - .getAttribute(ATT_HANDLE_ID); - if (markerDeltarHandleId == null) - return false; - - IJavaElement markerElement = JavaCore.create(markerDeltarHandleId); - // while (true){ - if (element.equals(markerElement)) - return true; // external elements may still be equal with - // different - // handleIDs. - - // cycle through enclosing types in case marker is associated with a - // classfile (15568) - // if (markerElement instanceof IClassFile){ - // IType enclosingType = - // ((IClassFile)markerElement).getType().getDeclaringType(); - // if (enclosingType != null){ - // markerElement = enclosingType.getClassFile(); // retry with immediate - // enclosing classfile - // continue; - // } - // } - // break; - // } - return false; - } +// public static boolean isReferencedBy(IJavaElement element, +// IMarkerDelta markerDelta) throws CoreException { +// +// // only match units or classfiles +// if (element instanceof IMember) { +// IMember member = (IMember) element; +// if (member.isBinary()) { +// element = null; // member.getClassFile(); +// } else { +// element = member.getCompilationUnit(); +// } +// } +// if (element == null) +// return false; +// if (markerDelta == null) +// return false; +// +// String markerDeltarHandleId = (String) markerDelta +// .getAttribute(ATT_HANDLE_ID); +// if (markerDeltarHandleId == null) +// return false; +// +// IJavaElement markerElement = JavaCore.create(markerDeltarHandleId); +// // while (true){ +// if (element.equals(markerElement)) +// return true; // external elements may still be equal with +// // different +// // handleIDs. +// +// // cycle through enclosing types in case marker is associated with a +// // classfile (15568) +// // if (markerElement instanceof IClassFile){ +// // IType enclosingType = +// // ((IClassFile)markerElement).getType().getDeclaringType(); +// // if (enclosingType != null){ +// // markerElement = enclosingType.getClassFile(); // retry with immediate +// // enclosing classfile +// // continue; +// // } +// // } +// // break; +// // } +// return false; +// } /** * Creates and returns a new classpath entry of kind @@ -3330,10 +3330,10 @@ public class JavaCore { * @see JavaCore#newContainerEntry(IPath, boolean) * @since 2.0 */ - public static IClasspathEntry newContainerEntry(IPath containerPath) { - - return newContainerEntry(containerPath, false); - } +// public static IClasspathEntry newContainerEntry(IPath containerPath) { +// +// return newContainerEntry(containerPath, false); +// } /** * Creates and returns a new classpath entry of kind @@ -3545,9 +3545,9 @@ public class JavaCore { * * @see JavaCore#newProjectEntry(IPath, boolean) */ - public static IClasspathEntry newProjectEntry(IPath path) { - return newProjectEntry(path, false); - } +// public static IClasspathEntry newProjectEntry(IPath path) { +// return newProjectEntry(path, false); +// } /** * Creates and returns a new classpath entry of kind @@ -3592,9 +3592,9 @@ public class JavaCore { * * @return a new empty region */ - public static IRegion newRegion() { - return new Region(); - } +// public static IRegion newRegion() { +// return new Region(); +// } /** * Creates and returns a new classpath entry of kind CPE_SOURCE @@ -3643,12 +3643,12 @@ public class JavaCore { * @see #newSourceEntry(IPath, IPath[], IPath[], IPath) * @since 2.1 */ - public static IClasspathEntry newSourceEntry(IPath path, - IPath[] exclusionPatterns) { - - return newSourceEntry(path, ClasspathEntry.INCLUDE_ALL, - exclusionPatterns, null /* output location */); - } +// public static IClasspathEntry newSourceEntry(IPath path, +// IPath[] exclusionPatterns) { +// +// return newSourceEntry(path, ClasspathEntry.INCLUDE_ALL, +// exclusionPatterns, null /* output location */); +// } /** * Creates and returns a new classpath entry of kind CPE_SOURCE @@ -4276,9 +4276,9 @@ public class JavaCore { * (non-Javadoc) Method declared on IExecutableExtension. Record any * necessary initialization data from the plugin. */ - public void setInitializationData(IConfigurationElement cfig, - String propertyName, Object data) throws CoreException { - } +// public void setInitializationData(IConfigurationElement cfig, +// String propertyName, Object data) throws CoreException { +// } /** * Sets the current table of options. All and only the options explicitly