/**
* Returns the length of the source string.
*/
- public int getSourceLength() {
- return sourceLength;
- }
+// public int getSourceLength() {
+// return sourceLength;
+// }
protected ISourceRange getSourceRange() {
return new SourceRange(0, sourceLength);
* When executed, this operation will copy the given elements to the given
* container.
*/
- public CopyElementsOperation(IJavaElement[] elementsToCopy,
- IJavaElement destContainer, boolean force) {
- this(elementsToCopy, new IJavaElement[] { destContainer }, force);
- }
+// public CopyElementsOperation(IJavaElement[] elementsToCopy,
+// IJavaElement destContainer, boolean force) {
+// this(elementsToCopy, new IJavaElement[] { destContainer }, force);
+// }
/**
* Returns the <code>String</code> to use as the main task name for
* When executed, this operation will copy the given resources to the given
* container.
*/
- public CopyResourceElementsOperation(IJavaElement[] resourcesToCopy,
- IJavaElement destContainer, boolean force) {
- this(resourcesToCopy, new IJavaElement[] { destContainer }, force);
- }
+// public CopyResourceElementsOperation(IJavaElement[] resourcesToCopy,
+// IJavaElement destContainer, boolean force) {
+// this(resourcesToCopy, new IJavaElement[] { destContainer }, force);
+// }
/**
* Returns the children of <code>source</code> which are affected by this
* is reacting to some notification iteration by adding/changing/removing
* any of the other (for example, if it deregisters itself).
*/
- public void addElementChangedListener(IElementChangedListener listener,
- int eventMask) {
- for (int i = 0; i < this.elementChangedListenerCount; i++) {
- if (this.elementChangedListeners[i].equals(listener)) {
-
- // only clone the masks, since we could be in the middle of
- // notifications and one listener decide to change
- // any event mask of another listeners (yet not notified).
- int cloneLength = this.elementChangedListenerMasks.length;
- System
- .arraycopy(
- this.elementChangedListenerMasks,
- 0,
- this.elementChangedListenerMasks = new int[cloneLength],
- 0, cloneLength);
- this.elementChangedListenerMasks[i] = eventMask; // could be
- // different
- return;
- }
- }
- // may need to grow, no need to clone, since iterators will have cached
- // original arrays and max boundary and we only add to the end.
- int length;
- if ((length = this.elementChangedListeners.length) == this.elementChangedListenerCount) {
- System
- .arraycopy(
- this.elementChangedListeners,
- 0,
- this.elementChangedListeners = new IElementChangedListener[length * 2],
- 0, length);
- System.arraycopy(this.elementChangedListenerMasks, 0,
- this.elementChangedListenerMasks = new int[length * 2], 0,
- length);
- }
- this.elementChangedListeners[this.elementChangedListenerCount] = listener;
- this.elementChangedListenerMasks[this.elementChangedListenerCount] = eventMask;
- this.elementChangedListenerCount++;
- }
+// public void addElementChangedListener(IElementChangedListener listener,
+// int eventMask) {
+// for (int i = 0; i < this.elementChangedListenerCount; i++) {
+// if (this.elementChangedListeners[i].equals(listener)) {
+//
+// // only clone the masks, since we could be in the middle of
+// // notifications and one listener decide to change
+// // any event mask of another listeners (yet not notified).
+// int cloneLength = this.elementChangedListenerMasks.length;
+// System
+// .arraycopy(
+// this.elementChangedListenerMasks,
+// 0,
+// this.elementChangedListenerMasks = new int[cloneLength],
+// 0, cloneLength);
+// this.elementChangedListenerMasks[i] = eventMask; // could be
+// // different
+// return;
+// }
+// }
+// // may need to grow, no need to clone, since iterators will have cached
+// // original arrays and max boundary and we only add to the end.
+// int length;
+// if ((length = this.elementChangedListeners.length) == this.elementChangedListenerCount) {
+// System
+// .arraycopy(
+// this.elementChangedListeners,
+// 0,
+// this.elementChangedListeners = new IElementChangedListener[length * 2],
+// 0, length);
+// System.arraycopy(this.elementChangedListenerMasks, 0,
+// this.elementChangedListenerMasks = new int[length * 2], 0,
+// length);
+// }
+// this.elementChangedListeners[this.elementChangedListenerCount] = listener;
+// this.elementChangedListenerMasks[this.elementChangedListenerCount] = eventMask;
+// this.elementChangedListenerCount++;
+// }
public void addPreResourceChangedListener(IResourceChangeListener listener) {
for (int i = 0; i < this.preResourceChangeListenerCount; i++) {
return deltaProcessor;
}
- public void performClasspathResourceChange(JavaProject project,
- IClasspathEntry[] oldResolvedPath,
- IClasspathEntry[] newResolvedPath, IClasspathEntry[] newRawPath,
- boolean canChangeResources) throws JavaModelException {
- ProjectUpdateInfo info = new ProjectUpdateInfo();
- info.project = project;
- info.oldResolvedPath = oldResolvedPath;
- info.newResolvedPath = newResolvedPath;
- info.newRawPath = newRawPath;
- if (canChangeResources) {
- this.projectUpdates.remove(project); // remove possibly awaiting
- // one
- info.updateProjectReferencesIfNecessary();
- return;
- }
- this.recordProjectUpdate(info);
- }
+// public void performClasspathResourceChange(JavaProject project,
+// IClasspathEntry[] oldResolvedPath,
+// IClasspathEntry[] newResolvedPath, IClasspathEntry[] newRawPath,
+// boolean canChangeResources) throws JavaModelException {
+// ProjectUpdateInfo info = new ProjectUpdateInfo();
+// info.project = project;
+// info.oldResolvedPath = oldResolvedPath;
+// info.newResolvedPath = newResolvedPath;
+// info.newRawPath = newRawPath;
+// if (canChangeResources) {
+// this.projectUpdates.remove(project); // remove possibly awaiting
+// // one
+// info.updateProjectReferencesIfNecessary();
+// return;
+// }
+// this.recordProjectUpdate(info);
+// }
public void initializeRoots() {
}
}
- public synchronized void recordProjectUpdate(ProjectUpdateInfo newInfo) {
-
- JavaProject project = newInfo.project;
- ProjectUpdateInfo oldInfo = (ProjectUpdateInfo) this.projectUpdates
- .get(project);
- if (oldInfo != null) { // refresh new classpath information
- oldInfo.newRawPath = newInfo.newRawPath;
- oldInfo.newResolvedPath = newInfo.newResolvedPath;
- } else {
- this.projectUpdates.put(project, newInfo);
- }
- }
+// public synchronized void recordProjectUpdate(ProjectUpdateInfo newInfo) {
+//
+// JavaProject project = newInfo.project;
+// ProjectUpdateInfo oldInfo = (ProjectUpdateInfo) this.projectUpdates
+// .get(project);
+// if (oldInfo != null) { // refresh new classpath information
+// oldInfo.newRawPath = newInfo.newRawPath;
+// oldInfo.newResolvedPath = newInfo.newResolvedPath;
+// } else {
+// this.projectUpdates.put(project, newInfo);
+// }
+// }
public synchronized ProjectUpdateInfo[] removeAllProjectUpdates() {
int length = this.projectUpdates.size();
return updates;
}
- public void removeElementChangedListener(IElementChangedListener listener) {
-
- for (int i = 0; i < this.elementChangedListenerCount; i++) {
-
- if (this.elementChangedListeners[i].equals(listener)) {
-
- // need to clone defensively since we might be in the middle of
- // listener notifications (#fire)
- int length = this.elementChangedListeners.length;
- IElementChangedListener[] newListeners = new IElementChangedListener[length];
- System.arraycopy(this.elementChangedListeners, 0, newListeners,
- 0, i);
- int[] newMasks = new int[length];
- System.arraycopy(this.elementChangedListenerMasks, 0, newMasks,
- 0, i);
-
- // copy trailing listeners
- int trailingLength = this.elementChangedListenerCount - i - 1;
- if (trailingLength > 0) {
- System.arraycopy(this.elementChangedListeners, i + 1,
- newListeners, i, trailingLength);
- System.arraycopy(this.elementChangedListenerMasks, i + 1,
- newMasks, i, trailingLength);
- }
-
- // update manager listener state (#fire need to iterate over
- // original listeners through a local variable to hold onto
- // the original ones)
- this.elementChangedListeners = newListeners;
- this.elementChangedListenerMasks = newMasks;
- this.elementChangedListenerCount--;
- return;
- }
- }
- }
-
- public void removePreResourceChangedListener(
- IResourceChangeListener listener) {
-
- for (int i = 0; i < this.preResourceChangeListenerCount; i++) {
-
- if (this.preResourceChangeListeners[i].equals(listener)) {
-
- // need to clone defensively since we might be in the middle of
- // listener notifications (#fire)
- int length = this.preResourceChangeListeners.length;
- IResourceChangeListener[] newListeners = new IResourceChangeListener[length];
- System.arraycopy(this.preResourceChangeListeners, 0,
- newListeners, 0, i);
-
- // copy trailing listeners
- int trailingLength = this.preResourceChangeListenerCount - i
- - 1;
- if (trailingLength > 0) {
- System.arraycopy(this.preResourceChangeListeners, i + 1,
- newListeners, i, trailingLength);
- }
-
- // update manager listener state (#fire need to iterate over
- // original listeners through a local variable to hold onto
- // the original ones)
- this.preResourceChangeListeners = newListeners;
- this.preResourceChangeListenerCount--;
- return;
- }
- }
- }
+// public void removeElementChangedListener(IElementChangedListener listener) {
+//
+// for (int i = 0; i < this.elementChangedListenerCount; i++) {
+//
+// if (this.elementChangedListeners[i].equals(listener)) {
+//
+// // need to clone defensively since we might be in the middle of
+// // listener notifications (#fire)
+// int length = this.elementChangedListeners.length;
+// IElementChangedListener[] newListeners = new IElementChangedListener[length];
+// System.arraycopy(this.elementChangedListeners, 0, newListeners,
+// 0, i);
+// int[] newMasks = new int[length];
+// System.arraycopy(this.elementChangedListenerMasks, 0, newMasks,
+// 0, i);
+//
+// // copy trailing listeners
+// int trailingLength = this.elementChangedListenerCount - i - 1;
+// if (trailingLength > 0) {
+// System.arraycopy(this.elementChangedListeners, i + 1,
+// newListeners, i, trailingLength);
+// System.arraycopy(this.elementChangedListenerMasks, i + 1,
+// newMasks, i, trailingLength);
+// }
+//
+// // update manager listener state (#fire need to iterate over
+// // original listeners through a local variable to hold onto
+// // the original ones)
+// this.elementChangedListeners = newListeners;
+// this.elementChangedListenerMasks = newMasks;
+// this.elementChangedListenerCount--;
+// return;
+// }
+// }
+// }
+
+// public void removePreResourceChangedListener(
+// IResourceChangeListener listener) {
+//
+// for (int i = 0; i < this.preResourceChangeListenerCount; i++) {
+//
+// if (this.preResourceChangeListeners[i].equals(listener)) {
+//
+// // need to clone defensively since we might be in the middle of
+// // listener notifications (#fire)
+// int length = this.preResourceChangeListeners.length;
+// IResourceChangeListener[] newListeners = new IResourceChangeListener[length];
+// System.arraycopy(this.preResourceChangeListeners, 0,
+// newListeners, 0, i);
+//
+// // copy trailing listeners
+// int trailingLength = this.preResourceChangeListenerCount - i
+// - 1;
+// if (trailingLength > 0) {
+// System.arraycopy(this.preResourceChangeListeners, i + 1,
+// newListeners, i, trailingLength);
+// }
+//
+// // update manager listener state (#fire need to iterate over
+// // original listeners through a local variable to hold onto
+// // the original ones)
+// this.preResourceChangeListeners = newListeners;
+// this.preResourceChangeListenerCount--;
+// return;
+// }
+// }
+// }
public void resourceChanged(final IResourceChangeEvent event) {
boolean isPostChange = event.getType() == IResourceChangeEvent.POST_CHANGE;
*******************************************************************************/
package net.sourceforge.phpdt.internal.core;
-import java.io.File;
+//import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import net.sourceforge.phpdt.core.ElementChangedEvent;
-import net.sourceforge.phpdt.core.IClasspathEntry;
+//import net.sourceforge.phpdt.core.IClasspathEntry;
import net.sourceforge.phpdt.core.IElementChangedListener;
import net.sourceforge.phpdt.core.IJavaElement;
import net.sourceforge.phpdt.core.IJavaElementDelta;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
+//import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.ISafeRunnable;
//import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.QualifiedName;
+//import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.SafeRunner;
/**
* Adds the given project and its dependents to the list of the projects to
* update.
*/
- void addToProjectsToUpdateWithDependents(IProject project) {
- this.projectsToUpdate.add(JavaCore.create(project));
- // this.addDependentProjects(project.getFullPath(),
- // this.projectsToUpdate);
- }
+// void addToProjectsToUpdateWithDependents(IProject project) {
+// this.projectsToUpdate.add(JavaCore.create(project));
+// // this.addDependentProjects(project.getFullPath(),
+// // this.projectsToUpdate);
+// }
/**
* Adds the given child handle to its parent's cache of children.
*/
- protected void addToParentInfo(Openable child) {
-
- Openable parent = (Openable) child.getParent();
- if (parent != null && parent.isOpen()) {
- try {
- JavaElementInfo info = (JavaElementInfo) parent
- .getElementInfo();
- info.addChild(child);
- } catch (JavaModelException e) {
- // do nothing - we already checked if open
- }
- }
- }
+// protected void addToParentInfo(Openable child) {
+//
+// Openable parent = (Openable) child.getParent();
+// if (parent != null && parent.isOpen()) {
+// try {
+// JavaElementInfo info = (JavaElementInfo) parent
+// .getElementInfo();
+// info.addChild(child);
+// } catch (JavaModelException e) {
+// // do nothing - we already checked if open
+// }
+// }
+// }
/**
* Check all external archive (referenced by given roots, projects or model)
* Answer a combination of the lastModified stamp and the size. Used for
* detecting external JAR changes
*/
- public static long getTimeStamp(File file) {
- return file.lastModified() + file.length();
- }
-
- public void initializeRoots() {
- // remember roots infos as old roots infos
- this.oldRoots = this.roots == null ? new HashMap() : this.roots;
- this.oldOtherRoots = this.otherRoots == null ? new HashMap()
- : this.otherRoots;
-
- // recompute root infos only if necessary
- if (!rootsAreStale)
- return;
-
- this.roots = new HashMap();
- this.otherRoots = new HashMap();
- this.sourceAttachments = new HashMap();
-
- IJavaModel model = this.manager.getJavaModel();
- IJavaProject[] projects;
- try {
- projects = model.getJavaProjects();
- } catch (JavaModelException e) {
- // nothing can be done
- return;
- }
- for (int i = 0, length = projects.length; i < length; i++) {
- IJavaProject project = projects[i];
- IClasspathEntry[] classpath;
- try {
- classpath = project.getResolvedClasspath(true);
- } catch (JavaModelException e) {
- // continue with next project
- continue;
- }
- for (int j = 0, classpathLength = classpath.length; j < classpathLength; j++) {
- IClasspathEntry entry = classpath[j];
- if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT)
- continue;
-
- // root path
- IPath path = entry.getPath();
- if (this.roots.get(path) == null) {
- this.roots.put(path, new RootInfo(project, path,
- ((ClasspathEntry) entry)
- .fullExclusionPatternChars()));
- } else {
- ArrayList rootList = (ArrayList) this.otherRoots.get(path);
- if (rootList == null) {
- rootList = new ArrayList();
- this.otherRoots.put(path, rootList);
- }
- rootList.add(new RootInfo(project, path,
- ((ClasspathEntry) entry)
- .fullExclusionPatternChars()));
- }
+// public static long getTimeStamp(File file) {
+// return file.lastModified() + file.length();
+// }
- // source attachment path
- if (entry.getEntryKind() != IClasspathEntry.CPE_LIBRARY)
- continue;
- QualifiedName qName = new QualifiedName(JavaCore.PLUGIN_ID,
- "sourceattachment: " + path.toOSString()); //$NON-NLS-1$;
- String propertyString = null;
- try {
- propertyString = ResourcesPlugin.getWorkspace().getRoot()
- .getPersistentProperty(qName);
- } catch (CoreException e) {
- continue;
- }
- IPath sourceAttachmentPath;
- // if (propertyString != null) {
- // int index=
- // propertyString.lastIndexOf(JarPackageFragmentRoot.ATTACHMENT_PROPERTY_DELIMITER);
- // sourceAttachmentPath = (index < 0) ? new Path(propertyString)
- // : new Path(propertyString.substring(0, index));
- // } else {
- sourceAttachmentPath = entry.getSourceAttachmentPath();
- // }
- if (sourceAttachmentPath != null) {
- this.sourceAttachments.put(sourceAttachmentPath, path);
- }
- }
- }
- this.rootsAreStale = false;
- }
+// public void initializeRoots() {
+// // remember roots infos as old roots infos
+// this.oldRoots = this.roots == null ? new HashMap() : this.roots;
+// this.oldOtherRoots = this.otherRoots == null ? new HashMap()
+// : this.otherRoots;
+//
+// // recompute root infos only if necessary
+// if (!rootsAreStale)
+// return;
+//
+// this.roots = new HashMap();
+// this.otherRoots = new HashMap();
+// this.sourceAttachments = new HashMap();
+//
+// IJavaModel model = this.manager.getJavaModel();
+// IJavaProject[] projects;
+// try {
+// projects = model.getJavaProjects();
+// } catch (JavaModelException e) {
+// // nothing can be done
+// return;
+// }
+// for (int i = 0, length = projects.length; i < length; i++) {
+// IJavaProject project = projects[i];
+// IClasspathEntry[] classpath;
+// try {
+// classpath = project.getResolvedClasspath(true);
+// } catch (JavaModelException e) {
+// // continue with next project
+// continue;
+// }
+// for (int j = 0, classpathLength = classpath.length; j < classpathLength; j++) {
+// IClasspathEntry entry = classpath[j];
+// if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT)
+// continue;
+//
+// // root path
+// IPath path = entry.getPath();
+// if (this.roots.get(path) == null) {
+// this.roots.put(path, new RootInfo(project, path,
+// ((ClasspathEntry) entry)
+// .fullExclusionPatternChars()));
+// } else {
+// ArrayList rootList = (ArrayList) this.otherRoots.get(path);
+// if (rootList == null) {
+// rootList = new ArrayList();
+// this.otherRoots.put(path, rootList);
+// }
+// rootList.add(new RootInfo(project, path,
+// ((ClasspathEntry) entry)
+// .fullExclusionPatternChars()));
+// }
+//
+// // source attachment path
+// if (entry.getEntryKind() != IClasspathEntry.CPE_LIBRARY)
+// continue;
+// QualifiedName qName = new QualifiedName(JavaCore.PLUGIN_ID,
+// "sourceattachment: " + path.toOSString()); //$NON-NLS-1$;
+// String propertyString = null;
+// try {
+// propertyString = ResourcesPlugin.getWorkspace().getRoot()
+// .getPersistentProperty(qName);
+// } catch (CoreException e) {
+// continue;
+// }
+// IPath sourceAttachmentPath;
+// // if (propertyString != null) {
+// // int index=
+// // propertyString.lastIndexOf(JarPackageFragmentRoot.ATTACHMENT_PROPERTY_DELIMITER);
+// // sourceAttachmentPath = (index < 0) ? new Path(propertyString)
+// // : new Path(propertyString.substring(0, index));
+// // } else {
+// sourceAttachmentPath = entry.getSourceAttachmentPath();
+// // }
+// if (sourceAttachmentPath != null) {
+// this.sourceAttachments.put(sourceAttachmentPath, path);
+// }
+// }
+// }
+// this.rootsAreStale = false;
+// }
/*
* Returns whether a given delta contains some information relevant to the
if (rootDelta != null) {
// use local exception to quickly escape from delta traversal
class FoundRelevantDeltaException extends RuntimeException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7732598607464929404L;
}
try {
rootDelta.accept(new IResourceDeltaVisitor() {
/*
* Finds the root info this path is included in. Returns null if not found.
*/
- RootInfo enclosingRootInfo(IPath path, int kind) {
- while (path != null && path.segmentCount() > 0) {
- RootInfo rootInfo = this.rootInfo(path, kind);
- if (rootInfo != null)
- return rootInfo;
- path = path.removeLastSegments(1);
- }
- return null;
- }
+// RootInfo enclosingRootInfo(IPath path, int kind) {
+// while (path != null && path.segmentCount() > 0) {
+// RootInfo rootInfo = this.rootInfo(path, kind);
+// if (rootInfo != null)
+// return rootInfo;
+// path = path.removeLastSegments(1);
+// }
+// return null;
+// }
/*
* Fire Java Model delta, flushing them after the fact after post_change
* Returns the root info for the given path. Look in the old roots table if
* kind is REMOVED.
*/
- RootInfo rootInfo(IPath path, int kind) {
- if (kind == IResourceDelta.REMOVED) {
- return (RootInfo) this.oldRoots.get(path);
- } else {
- return (RootInfo) this.roots.get(path);
- }
- }
+// RootInfo rootInfo(IPath path, int kind) {
+// if (kind == IResourceDelta.REMOVED) {
+// return (RootInfo) this.oldRoots.get(path);
+// } else {
+// return (RootInfo) this.roots.get(path);
+// }
+// }
/*
* Returns the other root infos for the given path. Look in the old other
* roots table if kind is REMOVED.
*/
- ArrayList otherRootsInfo(IPath path, int kind) {
- if (kind == IResourceDelta.REMOVED) {
- return (ArrayList) this.oldOtherRoots.get(path);
- } else {
- return (ArrayList) this.otherRoots.get(path);
- }
- }
+// ArrayList otherRootsInfo(IPath path, int kind) {
+// if (kind == IResourceDelta.REMOVED) {
+// return (ArrayList) this.oldOtherRoots.get(path);
+// } else {
+// return (ArrayList) this.otherRoots.get(path);
+// }
+// }
/**
* Converts an <code>IResourceDelta</code> and its children into the
/**
* Creates the nested deltas for a closed element.
*/
- public void closed(IJavaElement element) {
- JavaElementDelta delta = new JavaElementDelta(element);
- delta.fKind = CHANGED;
- delta.fChangeFlags |= F_CLOSED;
- insertDeltaTree(element, delta);
- }
+// public void closed(IJavaElement element) {
+// JavaElementDelta delta = new JavaElementDelta(element);
+// delta.fKind = CHANGED;
+// delta.fChangeFlags |= F_CLOSED;
+// insertDeltaTree(element, delta);
+// }
/**
* Creates the nested delta deltas based on the affected element its delta,
/**
* Creates the nested deltas for an opened element.
*/
- public void opened(IJavaElement element) {
- JavaElementDelta delta = new JavaElementDelta(element);
- delta.fKind = CHANGED;
- delta.fChangeFlags |= F_OPENED;
- insertDeltaTree(element, delta);
- }
+// public void opened(IJavaElement element) {
+// JavaElementDelta delta = new JavaElementDelta(element);
+// delta.fKind = CHANGED;
+// delta.fChangeFlags |= F_OPENED;
+// insertDeltaTree(element, delta);
+// }
/**
* Removes the child delta from the collection of affected children.
* create the root delta and then a change operation should call this
* method.
*/
- public void sourceAttached(IJavaElement element) {
- JavaElementDelta attachedDelta = new JavaElementDelta(element);
- attachedDelta.fKind = CHANGED;
- attachedDelta.fChangeFlags |= F_SOURCEATTACHED;
- insertDeltaTree(element, attachedDelta);
- }
+// public void sourceAttached(IJavaElement element) {
+// JavaElementDelta attachedDelta = new JavaElementDelta(element);
+// attachedDelta.fKind = CHANGED;
+// attachedDelta.fChangeFlags |= F_SOURCEATTACHED;
+// insertDeltaTree(element, attachedDelta);
+// }
/**
* Creates the nested deltas resulting from a change operation. Convenience
* create the root delta and then a change operation should call this
* method.
*/
- public void sourceDetached(IJavaElement element) {
- JavaElementDelta detachedDelta = new JavaElementDelta(element);
- detachedDelta.fKind = CHANGED;
- detachedDelta.fChangeFlags |= F_SOURCEDETACHED;
- insertDeltaTree(element, detachedDelta);
- }
+// public void sourceDetached(IJavaElement element) {
+// JavaElementDelta detachedDelta = new JavaElementDelta(element);
+// detachedDelta.fKind = CHANGED;
+// detachedDelta.fChangeFlags |= F_SOURCEDETACHED;
+// insertDeltaTree(element, detachedDelta);
+// }
/**
* Returns a string representation of this delta's structure suitable for
* Creates a java element comparator on a java element looking only
* 'maxDepth' levels deep.
*/
- public JavaElementDeltaBuilder(IJavaElement javaElement, int maxDepth) {
- this.javaElement = javaElement;
- this.maxDepth = maxDepth;
- this.initialize();
- this.recordElementInfo(javaElement, (JavaModel) this.javaElement
- .getJavaModel(), 0);
- }
+// public JavaElementDeltaBuilder(IJavaElement javaElement, int maxDepth) {
+// this.javaElement = javaElement;
+// this.maxDepth = maxDepth;
+// this.initialize();
+// this.recordElementInfo(javaElement, (JavaModel) this.javaElement
+// .getJavaModel(), 0);
+// }
/**
* Repairs the positioning information after an element has been added
/**
* @see IJavaElementRequestor
*/
- public IField[] getFields() {
- if (fFields == null) {
- return fgEmptyFieldArray;
- }
- int size = fFields.size();
- IField[] results = new IField[size];
- fFields.toArray(results);
- return results;
- }
+// public IField[] getFields() {
+// if (fFields == null) {
+// return fgEmptyFieldArray;
+// }
+// int size = fFields.size();
+// IField[] results = new IField[size];
+// fFields.toArray(results);
+// return results;
+// }
/**
* @see IJavaElementRequestor
/**
* @see IJavaElementRequestor
*/
- public IType[] getMemberTypes() {
- if (fMemberTypes == null) {
- return fgEmptyTypeArray;
- }
- int size = fMemberTypes.size();
- IType[] results = new IType[size];
- fMemberTypes.toArray(results);
- return results;
- }
+// public IType[] getMemberTypes() {
+// if (fMemberTypes == null) {
+// return fgEmptyTypeArray;
+// }
+// int size = fMemberTypes.size();
+// IType[] results = new IType[size];
+// fMemberTypes.toArray(results);
+// return results;
+// }
/**
* @see IJavaElementRequestor
*/
- public IMethod[] getMethods() {
- if (fMethods == null) {
- return fgEmptyMethodArray;
- }
- int size = fMethods.size();
- IMethod[] results = new IMethod[size];
- fMethods.toArray(results);
- return results;
- }
+// public IMethod[] getMethods() {
+// if (fMethods == null) {
+// return fgEmptyMethodArray;
+// }
+// int size = fMethods.size();
+// IMethod[] results = new IMethod[size];
+// fMethods.toArray(results);
+// return results;
+// }
/**
* @see IJavaElementRequestor
/**
* @see IJavaElementRequestor
*/
- public IType[] getTypes() {
- if (fTypes == null) {
- return fgEmptyTypeArray;
- }
- int size = fTypes.size();
- IType[] results = new IType[size];
- fTypes.toArray(results);
- return results;
- }
+// public IType[] getTypes() {
+// if (fTypes == null) {
+// return fgEmptyTypeArray;
+// }
+// int size = fTypes.size();
+// IType[] results = new IType[size];
+// fTypes.toArray(results);
+// return results;
+// }
/**
* @see IJavaElementRequestor
/**
*/
- protected boolean generateInfos(OpenableElementInfo info,
- IProgressMonitor pm, Map newElements, IResource underlyingResource)
- throws JavaModelException {
-
- JavaModelManager.getJavaModelManager().putInfo(this, info);
- // determine my children
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
- .getProjects();
- for (int i = 0, max = projects.length; i < max; i++) {
- IProject project = projects[i];
- if (JavaProject.hasJavaNature(project)) {
- info.addChild(getJavaProject(project));
- }
- }
- return true;
- }
+// protected boolean generateInfos(OpenableElementInfo info,
+// IProgressMonitor pm, Map newElements, IResource underlyingResource)
+// throws JavaModelException {
+//
+// JavaModelManager.getJavaModelManager().putInfo(this, info);
+// // determine my children
+// IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
+// .getProjects();
+// for (int i = 0, max = projects.length; i < max; i++) {
+// IProject project = projects[i];
+// if (JavaProject.hasJavaNature(project)) {
+// info.addChild(getJavaProject(project));
+// }
+// }
+// return true;
+// }
/**
* Returns the <code>IJavaElement</code> represented by the
import net.sourceforge.phpdt.core.IJavaModel;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
+//import org.eclipse.core.resources.IProject;
+//import org.eclipse.core.resources.ResourcesPlugin;
/**
* Implementation of IJavaModel. A Java Model is specific to a workspace.
/**
* Compute the non-java resources contained in this java project.
*/
- private Object[] computeNonJavaResources() {
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
- .getProjects();
- int length = projects.length;
- Object[] nonJavaResources = null;
- int index = 0;
- for (int i = 0; i < length; i++) {
- IProject project = projects[i];
- if (!JavaProject.hasJavaNature(project)) {
- if (nonJavaResources == null) {
- nonJavaResources = new Object[length];
- }
- nonJavaResources[index++] = project;
- }
- }
- if (index == 0)
- return NO_NON_JAVA_RESOURCES;
- if (index < length) {
- System.arraycopy(nonJavaResources, 0,
- nonJavaResources = new Object[index], 0, index);
- }
- return nonJavaResources;
- }
+// private Object[] computeNonJavaResources() {
+// IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
+// .getProjects();
+// int length = projects.length;
+// Object[] nonJavaResources = null;
+// int index = 0;
+// for (int i = 0; i < length; i++) {
+// IProject project = projects[i];
+// if (!JavaProject.hasJavaNature(project)) {
+// if (nonJavaResources == null) {
+// nonJavaResources = new Object[length];
+// }
+// nonJavaResources[index++] = project;
+// }
+// }
+// if (index == 0)
+// return NO_NON_JAVA_RESOURCES;
+// if (index < length) {
+// System.arraycopy(nonJavaResources, 0,
+// nonJavaResources = new Object[index], 0, index);
+// }
+// return nonJavaResources;
+// }
/**
* Returns an array of non-java resources contained in the receiver.
*/
- Object[] getNonJavaResources() {
-
- Object[] nonJavaResources = this.nonJavaResources;
- if (nonJavaResources == null) {
- nonJavaResources = computeNonJavaResources();
- this.nonJavaResources = nonJavaResources;
- }
- return nonJavaResources;
- }
+// Object[] getNonJavaResources() {
+//
+// Object[] nonJavaResources = this.nonJavaResources;
+// if (nonJavaResources == null) {
+// nonJavaResources = computeNonJavaResources();
+// this.nonJavaResources = nonJavaResources;
+// }
+// return nonJavaResources;
+// }
}
import java.util.Iterator;
import java.util.Map;
import java.util.WeakHashMap;
-import java.util.zip.ZipFile;
+//import java.util.zip.ZipFile;
import net.sourceforge.phpdt.core.ElementChangedEvent;
import net.sourceforge.phpdt.core.IClasspathEntry;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.ISaveContext;
import org.eclipse.core.resources.ISaveParticipant;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceDescription;
+//import org.eclipse.core.resources.IWorkspace;
+//import org.eclipse.core.resources.IWorkspaceDescription;
import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
+//import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
+//import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
// public String toString() { return getDescription(); }
// };
- private static final String INDEX_MANAGER_DEBUG = PHPeclipsePlugin.PLUGIN_ID
- + "/debug/indexmanager"; //$NON-NLS-1$
+// private static final String INDEX_MANAGER_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+// + "/debug/indexmanager"; //$NON-NLS-1$
- private static final String COMPILER_DEBUG = PHPeclipsePlugin.PLUGIN_ID
- + "/debug/compiler"; //$NON-NLS-1$
+// private static final String COMPILER_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+// + "/debug/compiler"; //$NON-NLS-1$
private static final String JAVAMODEL_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+ "/debug/javamodel"; //$NON-NLS-1$
private static final String DELTA_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+ "/debug/javadelta"; //$NON-NLS-1$
- private static final String HIERARCHY_DEBUG = PHPeclipsePlugin.PLUGIN_ID
- + "/debug/hierarchy"; //$NON-NLS-1$
+// private static final String HIERARCHY_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+// + "/debug/hierarchy"; //$NON-NLS-1$
private static final String POST_ACTION_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+ "/debug/postaction"; //$NON-NLS-1$
private static final String BUILDER_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+ "/debug/builder"; //$NON-NLS-1$
- private static final String COMPLETION_DEBUG = PHPeclipsePlugin.PLUGIN_ID
- + "/debug/completion"; //$NON-NLS-1$
+// private static final String COMPLETION_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+// + "/debug/completion"; //$NON-NLS-1$
- private static final String SELECTION_DEBUG = PHPeclipsePlugin.PLUGIN_ID
- + "/debug/selection"; //$NON-NLS-1$
-
- private static final String SHARED_WC_DEBUG = PHPeclipsePlugin.PLUGIN_ID
- + "/debug/sharedworkingcopy"; //$NON-NLS-1$
-
- private static final String SEARCH_DEBUG = PHPeclipsePlugin.PLUGIN_ID
- + "/debug/search"; //$NON-NLS-1$
+// private static final String SELECTION_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+// + "/debug/selection"; //$NON-NLS-1$
+//
+// private static final String SHARED_WC_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+// + "/debug/sharedworkingcopy"; //$NON-NLS-1$
+//
+// private static final String SEARCH_DEBUG = PHPeclipsePlugin.PLUGIN_ID
+// + "/debug/search"; //$NON-NLS-1$
public final static IWorkingCopy[] NoWorkingCopy = new IWorkingCopy[0];
* to java.io.ZipFile) NOTE: this object itself is used as a lock to
* synchronize creation/removal of entries
*/
- private HashMap zipFiles = new HashMap();
+ //private HashMap zipFiles = new HashMap();
/**
* Update the classpath variable cache
/**
* @deprecated - discard once debug has converted to not using it
*/
- public void addElementChangedListener(IElementChangedListener listener) {
- this.addElementChangedListener(listener,
- ElementChangedEvent.POST_CHANGE
- | ElementChangedEvent.POST_RECONCILE);
- }
+// public void addElementChangedListener(IElementChangedListener listener) {
+// this.addElementChangedListener(listener,
+// ElementChangedEvent.POST_CHANGE
+// | ElementChangedEvent.POST_RECONCILE);
+// }
/**
* addElementChangedListener method comment. Need to clone defensively the
/**
* Starts caching ZipFiles. Ignores if there are already clients.
*/
- public void cacheZipFiles() {
- synchronized (this.zipFiles) {
- Thread currentThread = Thread.currentThread();
- if (this.zipFiles.get(currentThread) != null)
- return;
- this.zipFiles.put(currentThread, new HashMap());
- }
- }
-
- public void closeZipFile(ZipFile zipFile) {
- if (zipFile == null)
- return;
- synchronized (this.zipFiles) {
- if (this.zipFiles.get(Thread.currentThread()) != null) {
- return; // zip file will be closed by call to flushZipFiles
- }
- try {
- if (JavaModelManager.ZIP_ACCESS_VERBOSE) {
- System.out
- .println("(" + Thread.currentThread() + ") [JavaModelManager.closeZipFile(ZipFile)] Closing ZipFile on " + zipFile.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- zipFile.close();
- } catch (IOException e) {
- }
- }
- }
+// public void cacheZipFiles() {
+// synchronized (this.zipFiles) {
+// Thread currentThread = Thread.currentThread();
+// if (this.zipFiles.get(currentThread) != null)
+// return;
+// this.zipFiles.put(currentThread, new HashMap());
+// }
+// }
+
+// public void closeZipFile(ZipFile zipFile) {
+// if (zipFile == null)
+// return;
+// synchronized (this.zipFiles) {
+// if (this.zipFiles.get(Thread.currentThread()) != null) {
+// return; // zip file will be closed by call to flushZipFiles
+// }
+// try {
+// if (JavaModelManager.ZIP_ACCESS_VERBOSE) {
+// System.out
+// .println("(" + Thread.currentThread() + ") [JavaModelManager.closeZipFile(ZipFile)] Closing ZipFile on " + zipFile.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+// zipFile.close();
+// } catch (IOException e) {
+// }
+// }
+// }
/**
* Configure the plugin with respect to option settings defined in
/**
* Flushes ZipFiles cache if there are no more clients.
*/
- public void flushZipFiles() {
- synchronized (this.zipFiles) {
- Thread currentThread = Thread.currentThread();
- HashMap map = (HashMap) this.zipFiles.remove(currentThread);
- if (map == null)
- return;
- Iterator iterator = map.values().iterator();
- while (iterator.hasNext()) {
- try {
- ZipFile zipFile = (ZipFile) iterator.next();
- if (JavaModelManager.ZIP_ACCESS_VERBOSE) {
- System.out
- .println("(" + currentThread + ") [JavaModelManager.flushZipFiles()] Closing ZipFile on " + zipFile.getName()); //$NON-NLS-1$//$NON-NLS-2$
- }
- zipFile.close();
- } catch (IOException e) {
- }
- }
- }
- }
+// public void flushZipFiles() {
+// synchronized (this.zipFiles) {
+// Thread currentThread = Thread.currentThread();
+// HashMap map = (HashMap) this.zipFiles.remove(currentThread);
+// if (map == null)
+// return;
+// Iterator iterator = map.values().iterator();
+// while (iterator.hasNext()) {
+// try {
+// ZipFile zipFile = (ZipFile) iterator.next();
+// if (JavaModelManager.ZIP_ACCESS_VERBOSE) {
+// System.out
+// .println("(" + currentThread + ") [JavaModelManager.flushZipFiles()] Closing ZipFile on " + zipFile.getName()); //$NON-NLS-1$//$NON-NLS-2$
+// }
+// zipFile.close();
+// } catch (IOException e) {
+// }
+// }
+// }
+// }
public DeltaProcessor getDeltaProcessor() {
return this.deltaState.getDeltaProcessor();
* Returns the name of the variables for which an CP variable initializer is
* registered through an extension point
*/
- public static String[] getRegisteredVariableNames() {
-
- Plugin jdtCorePlugin = JavaCore.getPlugin();
- if (jdtCorePlugin == null)
- return null;
-
- ArrayList variableList = new ArrayList(5);
- // 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++){
- // String varAttribute = configElements[j].getAttribute("variable");
- // //$NON-NLS-1$
- // if (varAttribute != null) variableList.add(varAttribute);
- // }
- // }
- // }
- String[] variableNames = new String[variableList.size()];
- variableList.toArray(variableNames);
- return variableNames;
- }
+// public static String[] getRegisteredVariableNames() {
+//
+// Plugin jdtCorePlugin = JavaCore.getPlugin();
+// if (jdtCorePlugin == null)
+// return null;
+//
+// ArrayList variableList = new ArrayList(5);
+// // 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++){
+// // String varAttribute = configElements[j].getAttribute("variable");
+// // //$NON-NLS-1$
+// // if (varAttribute != null) variableList.add(varAttribute);
+// // }
+// // }
+// // }
+// String[] variableNames = new String[variableList.size()];
+// variableList.toArray(variableNames);
+// return variableNames;
+// }
/**
* Returns the name of the container IDs for which an CP container
* @exception CoreException
* If unable to create/open the ZipFile
*/
- public ZipFile getZipFile(IPath path) throws CoreException {
-
- synchronized (this.zipFiles) { // TODO: use PeThreadObject which does
- // synchronization
- Thread currentThread = Thread.currentThread();
- HashMap map = null;
- ZipFile zipFile;
- if ((map = (HashMap) this.zipFiles.get(currentThread)) != null
- && (zipFile = (ZipFile) map.get(path)) != null) {
-
- return zipFile;
- }
- String fileSystemPath = null;
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IResource file = root.findMember(path);
- if (path.isAbsolute() && file != null) {
- if (file == null) { // external file
- fileSystemPath = path.toOSString();
- } else { // internal resource (not an IFile or not existing)
- IPath location;
- if (file.getType() != IResource.FILE
- || (location = file.getFullPath()) == null) {
- throw new CoreException(
- new Status(
- IStatus.ERROR,
- JavaCore.PLUGIN_ID,
- -1,
- Util
- .bind(
- "file.notFound", path.toString()), null)); //$NON-NLS-1$
- }
- fileSystemPath = location.toOSString();
- }
- } else if (!path.isAbsolute()) {
- file = root.getFile(path);
- if (file == null || file.getType() != IResource.FILE) {
- throw new CoreException(new Status(IStatus.ERROR,
- JavaCore.PLUGIN_ID, -1, Util.bind(
- "file.notFound", path.toString()), null)); //$NON-NLS-1$
- }
- IPath location = file.getFullPath();
- if (location == null) {
- throw new CoreException(new Status(IStatus.ERROR,
- JavaCore.PLUGIN_ID, -1, Util.bind(
- "file.notFound", path.toString()), null)); //$NON-NLS-1$
- }
- fileSystemPath = location.toOSString();
- } else {
- fileSystemPath = path.toOSString();
- }
-
- try {
- if (ZIP_ACCESS_VERBOSE) {
- System.out
- .println("(" + currentThread + ") [JavaModelManager.getZipFile(IPath)] Creating ZipFile on " + fileSystemPath); //$NON-NLS-1$ //$NON-NLS-2$
- }
- zipFile = new ZipFile(fileSystemPath);
- if (map != null) {
- map.put(path, zipFile);
- }
- return zipFile;
- } catch (IOException e) {
- throw new CoreException(new Status(Status.ERROR,
- JavaCore.PLUGIN_ID, -1,
- Util.bind("status.IOException"), e)); //$NON-NLS-1$
- }
- }
- }
+// public ZipFile getZipFile(IPath path) throws CoreException {
+//
+// synchronized (this.zipFiles) { // TODO: use PeThreadObject which does
+// // synchronization
+// Thread currentThread = Thread.currentThread();
+// HashMap map = null;
+// ZipFile zipFile;
+// if ((map = (HashMap) this.zipFiles.get(currentThread)) != null
+// && (zipFile = (ZipFile) map.get(path)) != null) {
+//
+// return zipFile;
+// }
+// String fileSystemPath = null;
+// IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+// IResource file = root.findMember(path);
+// if (path.isAbsolute() && file != null) {
+// if (file == null) { // external file
+// fileSystemPath = path.toOSString();
+// } else { // internal resource (not an IFile or not existing)
+// IPath location;
+// if (file.getType() != IResource.FILE
+// || (location = file.getFullPath()) == null) {
+// throw new CoreException(
+// new Status(
+// IStatus.ERROR,
+// JavaCore.PLUGIN_ID,
+// -1,
+// Util
+// .bind(
+// "file.notFound", path.toString()), null)); //$NON-NLS-1$
+// }
+// fileSystemPath = location.toOSString();
+// }
+// } else if (!path.isAbsolute()) {
+// file = root.getFile(path);
+// if (file == null || file.getType() != IResource.FILE) {
+// throw new CoreException(new Status(IStatus.ERROR,
+// JavaCore.PLUGIN_ID, -1, Util.bind(
+// "file.notFound", path.toString()), null)); //$NON-NLS-1$
+// }
+// IPath location = file.getFullPath();
+// if (location == null) {
+// throw new CoreException(new Status(IStatus.ERROR,
+// JavaCore.PLUGIN_ID, -1, Util.bind(
+// "file.notFound", path.toString()), null)); //$NON-NLS-1$
+// }
+// fileSystemPath = location.toOSString();
+// } else {
+// fileSystemPath = path.toOSString();
+// }
+//
+// try {
+// if (ZIP_ACCESS_VERBOSE) {
+// System.out
+// .println("(" + currentThread + ") [JavaModelManager.getZipFile(IPath)] Creating ZipFile on " + fileSystemPath); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+// zipFile = new ZipFile(fileSystemPath);
+// if (map != null) {
+// map.put(path, zipFile);
+// }
+// return zipFile;
+// } catch (IOException e) {
+// throw new CoreException(new Status(Status.ERROR,
+// JavaCore.PLUGIN_ID, -1,
+// Util.bind("status.IOException"), e)); //$NON-NLS-1$
+// }
+// }
+// }
/*
* Returns whether there is a temporary cache for the current thread.
public void prepareToSave(ISaveContext context) throws CoreException {
}
- protected void putInfo(IJavaElement element, Object info) {
- this.cache.putInfo(element, info);
- }
+// protected void putInfo(IJavaElement element, Object info) {
+// this.cache.putInfo(element, info);
+// }
/*
* Puts the infos in the given map (keys are IJavaElements and values are
* Record the order in which to build the java projects (batch build). This
* order is based on the projects classpath settings.
*/
- protected void setBuildOrder(String[] javaBuildOrder)
- throws JavaModelException {
-
- // optional behaviour
- // possible value of index 0 is Compute
- if (!JavaCore.COMPUTE.equals(JavaCore
- .getOption(JavaCore.CORE_JAVA_BUILD_ORDER)))
- return; // cannot be customized at project level
-
- if (javaBuildOrder == null || javaBuildOrder.length <= 1)
- return;
-
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceDescription description = workspace.getDescription();
- String[] wksBuildOrder = description.getBuildOrder();
-
- String[] newOrder;
- if (wksBuildOrder == null) {
- newOrder = javaBuildOrder;
- } else {
- // remove projects which are already mentionned in java builder
- // order
- int javaCount = javaBuildOrder.length;
- HashMap newSet = new HashMap(javaCount); // create a set for fast
- // check
- for (int i = 0; i < javaCount; i++) {
- newSet.put(javaBuildOrder[i], javaBuildOrder[i]);
- }
- int removed = 0;
- int oldCount = wksBuildOrder.length;
- for (int i = 0; i < oldCount; i++) {
- if (newSet.containsKey(wksBuildOrder[i])) {
- wksBuildOrder[i] = null;
- removed++;
- }
- }
- // add Java ones first
- newOrder = new String[oldCount - removed + javaCount];
- System.arraycopy(javaBuildOrder, 0, newOrder, 0, javaCount); // java
- // projects
- // are
- // built
- // first
-
- // copy previous items in their respective order
- int index = javaCount;
- for (int i = 0; i < oldCount; i++) {
- if (wksBuildOrder[i] != null) {
- newOrder[index++] = wksBuildOrder[i];
- }
- }
- }
- // commit the new build order out
- description.setBuildOrder(newOrder);
- try {
- workspace.setDescription(description);
- } catch (CoreException e) {
- throw new JavaModelException(e);
- }
- }
+// protected void setBuildOrder(String[] javaBuildOrder)
+// throws JavaModelException {
+//
+// // optional behaviour
+// // possible value of index 0 is Compute
+// if (!JavaCore.COMPUTE.equals(JavaCore
+// .getOption(JavaCore.CORE_JAVA_BUILD_ORDER)))
+// return; // cannot be customized at project level
+//
+// if (javaBuildOrder == null || javaBuildOrder.length <= 1)
+// return;
+//
+// IWorkspace workspace = ResourcesPlugin.getWorkspace();
+// IWorkspaceDescription description = workspace.getDescription();
+// String[] wksBuildOrder = description.getBuildOrder();
+//
+// String[] newOrder;
+// if (wksBuildOrder == null) {
+// newOrder = javaBuildOrder;
+// } else {
+// // remove projects which are already mentionned in java builder
+// // order
+// int javaCount = javaBuildOrder.length;
+// HashMap newSet = new HashMap(javaCount); // create a set for fast
+// // check
+// for (int i = 0; i < javaCount; i++) {
+// newSet.put(javaBuildOrder[i], javaBuildOrder[i]);
+// }
+// int removed = 0;
+// int oldCount = wksBuildOrder.length;
+// for (int i = 0; i < oldCount; i++) {
+// if (newSet.containsKey(wksBuildOrder[i])) {
+// wksBuildOrder[i] = null;
+// removed++;
+// }
+// }
+// // add Java ones first
+// newOrder = new String[oldCount - removed + javaCount];
+// System.arraycopy(javaBuildOrder, 0, newOrder, 0, javaCount); // java
+// // projects
+// // are
+// // built
+// // first
+//
+// // copy previous items in their respective order
+// int index = javaCount;
+// for (int i = 0; i < oldCount; i++) {
+// if (wksBuildOrder[i] != null) {
+// newOrder[index++] = wksBuildOrder[i];
+// }
+// }
+// }
+// // commit the new build order out
+// description.setBuildOrder(newOrder);
+// try {
+// workspace.setDescription(description);
+// } catch (CoreException e) {
+// throw new JavaModelException(e);
+// }
+// }
/**
* Sets the last built state for the given project, or null to reset it.
* Turns the firing mode to on. That is, deltas that are/have been
* registered will be fired.
*/
- public void startDeltas() {
- this.isFiring = true;
- }
+// public void startDeltas() {
+// this.isFiring = true;
+// }
/**
* Turns the firing mode to off. That is, deltas that are/have been
* registered will not be fired until deltas are started again.
*/
- public void stopDeltas() {
- this.isFiring = false;
- }
+// public void stopDeltas() {
+// this.isFiring = false;
+// }
/**
* Update Java Model given some delta
return (IPath) Variables.get(variableName);
}
- public static String[] variableNames() {
- int length = Variables.size();
- String[] result = new String[length];
- Iterator vars = Variables.keySet().iterator();
- int index = 0;
- while (vars.hasNext()) {
- result[index++] = (String) vars.next();
- }
- return result;
- }
-
- public static void variablePut(String variableName, IPath variablePath) {
-
- // update cache - do not only rely on listener refresh
- if (variablePath == null) {
- Variables.remove(variableName);
- PreviousSessionVariables.remove(variableName);
- } else {
- Variables.put(variableName, variablePath);
- }
-
- // do not write out intermediate initialization value
- if (variablePath == JavaModelManager.VariableInitializationInProgress) {
- return;
- }
- Preferences preferences = JavaCore.getPlugin().getPluginPreferences();
- String variableKey = CP_VARIABLE_PREFERENCES_PREFIX + variableName;
- String variableString = variablePath == null ? CP_ENTRY_IGNORE
- : variablePath.toString();
- preferences.setDefault(variableKey, CP_ENTRY_IGNORE); // use this
- // default to
- // get rid of
- // removed ones
- preferences.setValue(variableKey, variableString);
- JavaCore.getPlugin().savePluginPreferences();
- }
+// public static String[] variableNames() {
+// int length = Variables.size();
+// String[] result = new String[length];
+// Iterator vars = Variables.keySet().iterator();
+// int index = 0;
+// while (vars.hasNext()) {
+// result[index++] = (String) vars.next();
+// }
+// return result;
+// }
+
+// public static void variablePut(String variableName, IPath variablePath) {
+//
+// // update cache - do not only rely on listener refresh
+// if (variablePath == null) {
+// Variables.remove(variableName);
+// PreviousSessionVariables.remove(variableName);
+// } else {
+// Variables.put(variableName, variablePath);
+// }
+//
+// // do not write out intermediate initialization value
+// if (variablePath == JavaModelManager.VariableInitializationInProgress) {
+// return;
+// }
+// Preferences preferences = JavaCore.getPlugin().getPluginPreferences();
+// String variableKey = CP_VARIABLE_PREFERENCES_PREFIX + variableName;
+// String variableString = variablePath == null ? CP_ENTRY_IGNORE
+// : variablePath.toString();
+// preferences.setDefault(variableKey, CP_ENTRY_IGNORE); // use this
+// // default to
+// // get rid of
+// // removed ones
+// preferences.setValue(variableKey, variableString);
+// JavaCore.getPlugin().savePluginPreferences();
+// }
/*
* Returns all the working copies which have the given owner. Adds the
*******************************************************************************/
package net.sourceforge.phpdt.internal.core;
-import java.io.InputStream;
+//import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import net.sourceforge.phpdt.internal.core.util.Util;
import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
+//import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceStatus;
/**
* Common constructor for all Java Model operations.
*/
- protected JavaModelOperation(IJavaElement element) {
- fElementsToProcess = new IJavaElement[] { element };
- }
+// protected JavaModelOperation(IJavaElement element) {
+// fElementsToProcess = new IJavaElement[] { element };
+// }
/**
* A common constructor for all Java Model operations.
*/
- protected JavaModelOperation(IJavaElement element, boolean force) {
- fElementsToProcess = new IJavaElement[] { element };
- this.force = force;
- }
+// protected JavaModelOperation(IJavaElement element, boolean force) {
+// fElementsToProcess = new IJavaElement[] { element };
+// this.force = force;
+// }
/*
* Registers the given action at the end of the list of actions to run.
/**
* Convenience method to create a file
*/
- protected void createFile(IContainer folder, String name,
- InputStream contents, boolean force) throws JavaModelException {
- IFile file = folder.getFile(new Path(name));
- try {
- file.create(contents, force ? IResource.FORCE
- | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,
- getSubProgressMonitor(1));
- this.setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE);
- } catch (CoreException e) {
- throw new JavaModelException(e);
- }
- }
+// protected void createFile(IContainer folder, String name,
+// InputStream contents, boolean force) throws JavaModelException {
+// IFile file = folder.getFile(new Path(name));
+// try {
+// file.create(contents, force ? IResource.FORCE
+// | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,
+// getSubProgressMonitor(1));
+// this.setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE);
+// } catch (CoreException e) {
+// throw new JavaModelException(e);
+// }
+// }
/**
* Convenience method to create a folder
/*
* Returns whether the given path is equals to one of the given other paths.
*/
- protected boolean equalsOneOf(IPath path, IPath[] otherPaths) {
- for (int i = 0, length = otherPaths.length; i < length; i++) {
- if (path.equals(otherPaths[i])) {
- return true;
- }
- }
- return false;
- }
+// protected boolean equalsOneOf(IPath path, IPath[] otherPaths) {
+// for (int i = 0, length = otherPaths.length; i < length; i++) {
+// if (path.equals(otherPaths[i])) {
+// return true;
+// }
+// }
+// return false;
+// }
/**
* Verifies the operation can proceed and executes the operation. Subclasses
* Returns the parent elements to which this operation applies, or
* <code>null</code> if not applicable.
*/
- protected IJavaElement[] getParentElements() {
- return fParentElements;
- }
+// protected IJavaElement[] getParentElements() {
+// return fParentElements;
+// }
/**
* Returns the elements created by this operation.
*/
- public IJavaElement[] getResultElements() {
- return resultElements;
- }
+// public IJavaElement[] getResultElements() {
+// return resultElements;
+// }
/*
* Returns the scheduling rule for this operation (i.e. the resource that
* Returns whether the given path is the prefix of one of the given other
* paths.
*/
- protected boolean prefixesOneOf(IPath path, IPath[] otherPaths) {
- for (int i = 0, length = otherPaths.length; i < length; i++) {
- if (path.isPrefixOf(otherPaths[i])) {
- return true;
- }
- }
- return false;
- }
+// protected boolean prefixesOneOf(IPath path, IPath[] otherPaths) {
+// for (int i = 0, length = otherPaths.length; i < length; i++) {
+// if (path.isPrefixOf(otherPaths[i])) {
+// return true;
+// }
+// }
+// return false;
+// }
/*
* Pushes the given operation on the stack of operations currently running
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.QualifiedName;
+//import org.eclipse.core.runtime.QualifiedName;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* Adds a builder to the build spec for the given project.
*/
- protected void addToBuildSpec(String builderID) throws CoreException {
-
- IProjectDescription description = getProject().getDescription();
- ICommand javaCommand = getJavaCommand(description);
-
- if (javaCommand == null) {
-
- // Add a Java command to the build spec
- ICommand command = description.newCommand();
- command.setBuilderName(builderID);
- setJavaCommand(description, command);
- }
- }
+// protected void addToBuildSpec(String builderID) throws CoreException {
+//
+// IProjectDescription description = getProject().getDescription();
+// ICommand javaCommand = getJavaCommand(description);
+//
+// if (javaCommand == null) {
+//
+// // Add a Java command to the build spec
+// ICommand command = description.newCommand();
+// command.setBuilderName(builderID);
+// setJavaCommand(description, command);
+// }
+// }
/**
* @see Openable
/**
* Compute the file name to use for a given shared property
*/
- public String computeSharedPropertyFileName(QualifiedName qName) {
-
- return '.' + qName.getLocalName();
- }
+// public String computeSharedPropertyFileName(QualifiedName qName) {
+//
+// return '.' + qName.getLocalName();
+// }
/*
* Returns whether the given resource is accessible through the children or
String typeName = path.lastSegment();
typeName = typeName.substring(0, typeName.length()
- extension.length() - 1);
- String qualifiedName = null;
- if (packageName.length() > 0) {
- qualifiedName = packageName + "." + typeName; //$NON-NLS-1$
- } else {
- qualifiedName = typeName;
- }
+ //String qualifiedName = null;
+// if (packageName.length() > 0) {
+// qualifiedName = packageName + "." + typeName; //$NON-NLS-1$
+// } else {
+// qualifiedName = typeName;
+// }
// IType type =
// getNameLookup().findType(
// qualifiedName,
* Find the specific Java command amongst the build spec of a given
* description
*/
- private ICommand getJavaCommand(IProjectDescription description)
- throws CoreException {
-
- ICommand[] commands = description.getBuildSpec();
- for (int i = 0; i < commands.length; ++i) {
- if (commands[i].getBuilderName().equals(
- PHPeclipsePlugin.BUILDER_PARSER_ID)) {
- return commands[i];
- }
- }
- return null;
- }
+// private ICommand getJavaCommand(IProjectDescription description)
+// throws CoreException {
+//
+// ICommand[] commands = description.getBuildSpec();
+// for (int i = 0; i < commands.length; ++i) {
+// if (commands[i].getBuilderName().equals(
+// PHPeclipsePlugin.BUILDER_PARSER_ID)) {
+// return commands[i];
+// }
+// }
+// return null;
+// }
/**
* Convenience method that returns the specific type of info for a Java
* Returns the package fragment root prefixed by the given path, or an empty
* collection if there are no such elements in the model.
*/
- protected IPackageFragmentRoot[] getPackageFragmentRoots(IPath path)
-
- throws JavaModelException {
- IPackageFragmentRoot[] roots = getAllPackageFragmentRoots();
- ArrayList matches = new ArrayList();
-
- for (int i = 0; i < roots.length; ++i) {
- if (path.isPrefixOf(roots[i].getPath())) {
- matches.add(roots[i]);
- }
- }
- IPackageFragmentRoot[] copy = new IPackageFragmentRoot[matches.size()];
- matches.toArray(copy);
- return copy;
- }
+// protected IPackageFragmentRoot[] getPackageFragmentRoots(IPath path)
+//
+// throws JavaModelException {
+// IPackageFragmentRoot[] roots = getAllPackageFragmentRoots();
+// ArrayList matches = new ArrayList();
+//
+// for (int i = 0; i < roots.length; ++i) {
+// if (path.isPrefixOf(roots[i].getPath())) {
+// matches.add(roots[i]);
+// }
+// }
+// IPackageFragmentRoot[] copy = new IPackageFragmentRoot[matches.size()];
+// matches.toArray(copy);
+// return copy;
+// }
/**
* @see IJavaProject
/*
* @see IJavaProject
*/
- public boolean isOnClasspath(IJavaElement element) {
- IPath path = element.getPath();
- switch (element.getElementType()) {
- case IJavaElement.PACKAGE_FRAGMENT_ROOT:
- if (!((IPackageFragmentRoot) element).isArchive()) {
- // ensure that folders are only excluded if all of their
- // children are excluded
- path = path.append("*"); //$NON-NLS-1$
- }
- break;
- case IJavaElement.PACKAGE_FRAGMENT:
- if (!((IPackageFragmentRoot) element.getParent()).isArchive()) {
- // ensure that folders are only excluded if all of their
- // children are excluded
- path = path.append("*"); //$NON-NLS-1$
- }
- break;
- }
- return this.isOnClasspath(path);
- }
-
- private boolean isOnClasspath(IPath path) {
- IClasspathEntry[] classpath;
- try {
- classpath = this
- .getResolvedClasspath(true/* ignore unresolved variable */);
- } catch (JavaModelException e) {
- return false; // not a Java project
- }
- for (int i = 0; i < classpath.length; i++) {
- IClasspathEntry entry = classpath[i];
- if (entry.getPath().isPrefixOf(path)
- && !Util.isExcluded(path, null, ((ClasspathEntry) entry)
- .fullExclusionPatternChars(), true)) {
- return true;
- }
- }
- return false;
- }
+// public boolean isOnClasspath(IJavaElement element) {
+// IPath path = element.getPath();
+// switch (element.getElementType()) {
+// case IJavaElement.PACKAGE_FRAGMENT_ROOT:
+// if (!((IPackageFragmentRoot) element).isArchive()) {
+// // ensure that folders are only excluded if all of their
+// // children are excluded
+// path = path.append("*"); //$NON-NLS-1$
+// }
+// break;
+// case IJavaElement.PACKAGE_FRAGMENT:
+// if (!((IPackageFragmentRoot) element.getParent()).isArchive()) {
+// // ensure that folders are only excluded if all of their
+// // children are excluded
+// path = path.append("*"); //$NON-NLS-1$
+// }
+// break;
+// }
+// return this.isOnClasspath(path);
+// }
+
+// private boolean isOnClasspath(IPath path) {
+// IClasspathEntry[] classpath;
+// try {
+// classpath = this
+// .getResolvedClasspath(true/* ignore unresolved variable */);
+// } catch (JavaModelException e) {
+// return false; // not a Java project
+// }
+// for (int i = 0; i < classpath.length; i++) {
+// IClasspathEntry entry = classpath[i];
+// if (entry.getPath().isPrefixOf(path)
+// && !Util.isExcluded(path, null, ((ClasspathEntry) entry)
+// .fullExclusionPatternChars(), true)) {
+// return true;
+// }
+// }
+// return false;
+// }
/*
* @see IJavaProject
*/
- public boolean isOnClasspath(IResource resource) {
- IPath path = resource.getFullPath();
-
- // ensure that folders are only excluded if all of their children are
- // excluded
- if (resource.getType() == IResource.FOLDER) {
- path = path.append("*"); //$NON-NLS-1$
- }
-
- return this.isOnClasspath(path);
- }
+// public boolean isOnClasspath(IResource resource) {
+// IPath path = resource.getFullPath();
+//
+// // ensure that folders are only excluded if all of their children are
+// // excluded
+// if (resource.getType() == IResource.FOLDER) {
+// path = path.append("*"); //$NON-NLS-1$
+// }
+//
+// return this.isOnClasspath(path);
+// }
private IPath getPluginWorkingLocation() {
return this.project.getWorkingLocation(JavaCore.PLUGIN_ID);
* Update the Java command in the build spec (replace existing one if
* present, add one first if none).
*/
- private void setJavaCommand(IProjectDescription description,
- ICommand newCommand) throws CoreException {
-
- ICommand[] oldCommands = description.getBuildSpec();
- ICommand oldJavaCommand = getJavaCommand(description);
- ICommand[] newCommands;
-
- if (oldJavaCommand == null) {
- // Add a Java build spec before other builders (1FWJK7I)
- newCommands = new ICommand[oldCommands.length + 1];
- System
- .arraycopy(oldCommands, 0, newCommands, 1,
- oldCommands.length);
- newCommands[0] = newCommand;
- } else {
- for (int i = 0, max = oldCommands.length; i < max; i++) {
- if (oldCommands[i] == oldJavaCommand) {
- oldCommands[i] = newCommand;
- break;
- }
- }
- newCommands = oldCommands;
- }
-
- // Commit the spec change into the project
- description.setBuildSpec(newCommands);
- getProject().setDescription(description, null);
- }
+// private void setJavaCommand(IProjectDescription description,
+// ICommand newCommand) throws CoreException {
+//
+// ICommand[] oldCommands = description.getBuildSpec();
+// ICommand oldJavaCommand = getJavaCommand(description);
+// ICommand[] newCommands;
+//
+// if (oldJavaCommand == null) {
+// // Add a Java build spec before other builders (1FWJK7I)
+// newCommands = new ICommand[oldCommands.length + 1];
+// System
+// .arraycopy(oldCommands, 0, newCommands, 1,
+// oldCommands.length);
+// newCommands[0] = newCommand;
+// } else {
+// for (int i = 0, max = oldCommands.length; i < max; i++) {
+// if (oldCommands[i] == oldJavaCommand) {
+// oldCommands[i] = newCommand;
+// break;
+// }
+// }
+// newCommands = oldCommands;
+// }
+//
+// // Commit the spec change into the project
+// description.setBuildSpec(newCommands);
+// getProject().setDescription(description, null);
+// }
/**
* @see net.sourceforge.phpdt.core.IJavaProject#setOptions(Map)
*******************************************************************************/
package net.sourceforge.phpdt.internal.core;
-import net.sourceforge.phpdt.core.IClasspathEntry;
+//import net.sourceforge.phpdt.core.IClasspathEntry;
import net.sourceforge.phpdt.core.IJavaProject;
-import net.sourceforge.phpdt.core.JavaModelException;
-import net.sourceforge.phpdt.internal.core.util.Util;
+//import net.sourceforge.phpdt.core.JavaModelException;
+//import net.sourceforge.phpdt.internal.core.util.Util;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
+//import org.eclipse.core.resources.IContainer;
+//import org.eclipse.core.resources.IResource;
+//import org.eclipse.core.runtime.CoreException;
+//import org.eclipse.core.runtime.IPath;
/**
* Info for IJavaProject.
/**
* A array with all the non-java resources contained by this PackageFragment
*/
- private Object[] fNonJavaResources;
+ //private Object[] fNonJavaResources;
/**
* Create and initialize a new instance of the receiver
*/
public JavaProjectElementInfo() {
- fNonJavaResources = null;
+ //fNonJavaResources = null;
}
/**
* Compute the non-java resources contained in this java project.
*/
- private Object[] computeNonJavaResources(JavaProject project) {
-
- // determine if src == project and/or if bin == project
- IPath projectPath = project.getProject().getFullPath();
- boolean srcIsProject = false;
- //boolean binIsProject = false;
- char[][] exclusionPatterns = null;
- IClasspathEntry[] classpath = null;
- IPath projectOutput = null;
- try {
- classpath = project
- .getResolvedClasspath(true/* ignore unresolved variable */);
- for (int i = 0; i < classpath.length; i++) {
- IClasspathEntry entry = classpath[i];
- if (projectPath.equals(entry.getPath())) {
- srcIsProject = true;
- exclusionPatterns = ((ClasspathEntry) entry)
- .fullExclusionPatternChars();
- break;
- }
- }
- projectOutput = project.getOutputLocation();
- //binIsProject = projectPath.equals(projectOutput);
- } catch (JavaModelException e) {
- // ignore
- }
-
- Object[] nonJavaResources = new IResource[5];
- int nonJavaResourcesCounter = 0;
- try {
- IResource[] members = ((IContainer) project.getResource())
- .members();
- for (int i = 0, max = members.length; i < max; i++) {
- IResource res = members[i];
- switch (res.getType()) {
- case IResource.FILE:
- IPath resFullPath = res.getFullPath();
- //String resName = res.getName();
-
- // ignore a jar file on the classpath
- // if (ProjectPrefUtil.isArchiveFileName(resName) &&
- // this.isClasspathEntryOrOutputLocation(resFullPath,
- // classpath, projectOutput)) {
- // break;
- // }
- // ignore .java file if src == project
- if (srcIsProject
- // && ProjectPrefUtil.isValidCompilationUnitName(resName)
- && !Util.isExcluded(res, exclusionPatterns)) {
- break;
- }
- // ignore .class file if bin == project
- // if (binIsProject &&
- // ProjectPrefUtil.isValidClassFileName(resName)) {
- // break;
- // }
- // else add non java resource
- if (nonJavaResources.length == nonJavaResourcesCounter) {
- // resize
- System
- .arraycopy(
- nonJavaResources,
- 0,
- (nonJavaResources = new IResource[nonJavaResourcesCounter * 2]),
- 0, nonJavaResourcesCounter);
- }
- nonJavaResources[nonJavaResourcesCounter++] = res;
- break;
- case IResource.FOLDER:
- resFullPath = res.getFullPath();
-
- // ignore non-excluded folders on the classpath or that
- // correspond to an output location
- if ((srcIsProject
- && !Util.isExcluded(res, exclusionPatterns) && Util
- .isValidFolderNameForPackage(res.getName()))
- || this.isClasspathEntryOrOutputLocation(
- resFullPath, classpath, projectOutput)) {
- break;
- }
- // else add non java resource
- if (nonJavaResources.length == nonJavaResourcesCounter) {
- // resize
- System
- .arraycopy(
- nonJavaResources,
- 0,
- (nonJavaResources = new IResource[nonJavaResourcesCounter * 2]),
- 0, nonJavaResourcesCounter);
- }
- nonJavaResources[nonJavaResourcesCounter++] = res;
- }
- }
- if (nonJavaResources.length != nonJavaResourcesCounter) {
- System
- .arraycopy(
- nonJavaResources,
- 0,
- (nonJavaResources = new IResource[nonJavaResourcesCounter]),
- 0, nonJavaResourcesCounter);
- }
- } catch (CoreException e) {
- nonJavaResources = NO_NON_JAVA_RESOURCES;
- nonJavaResourcesCounter = 0;
- }
- return nonJavaResources;
- }
+// private Object[] computeNonJavaResources(JavaProject project) {
+//
+// // determine if src == project and/or if bin == project
+// IPath projectPath = project.getProject().getFullPath();
+// boolean srcIsProject = false;
+// //boolean binIsProject = false;
+// char[][] exclusionPatterns = null;
+// IClasspathEntry[] classpath = null;
+// IPath projectOutput = null;
+// try {
+// classpath = project
+// .getResolvedClasspath(true/* ignore unresolved variable */);
+// for (int i = 0; i < classpath.length; i++) {
+// IClasspathEntry entry = classpath[i];
+// if (projectPath.equals(entry.getPath())) {
+// srcIsProject = true;
+// exclusionPatterns = ((ClasspathEntry) entry)
+// .fullExclusionPatternChars();
+// break;
+// }
+// }
+// projectOutput = project.getOutputLocation();
+// //binIsProject = projectPath.equals(projectOutput);
+// } catch (JavaModelException e) {
+// // ignore
+// }
+//
+// Object[] nonJavaResources = new IResource[5];
+// int nonJavaResourcesCounter = 0;
+// try {
+// IResource[] members = ((IContainer) project.getResource())
+// .members();
+// for (int i = 0, max = members.length; i < max; i++) {
+// IResource res = members[i];
+// switch (res.getType()) {
+// case IResource.FILE:
+// IPath resFullPath = res.getFullPath();
+// //String resName = res.getName();
+//
+// // ignore a jar file on the classpath
+// // if (ProjectPrefUtil.isArchiveFileName(resName) &&
+// // this.isClasspathEntryOrOutputLocation(resFullPath,
+// // classpath, projectOutput)) {
+// // break;
+// // }
+// // ignore .java file if src == project
+// if (srcIsProject
+// // && ProjectPrefUtil.isValidCompilationUnitName(resName)
+// && !Util.isExcluded(res, exclusionPatterns)) {
+// break;
+// }
+// // ignore .class file if bin == project
+// // if (binIsProject &&
+// // ProjectPrefUtil.isValidClassFileName(resName)) {
+// // break;
+// // }
+// // else add non java resource
+// if (nonJavaResources.length == nonJavaResourcesCounter) {
+// // resize
+// System
+// .arraycopy(
+// nonJavaResources,
+// 0,
+// (nonJavaResources = new IResource[nonJavaResourcesCounter * 2]),
+// 0, nonJavaResourcesCounter);
+// }
+// nonJavaResources[nonJavaResourcesCounter++] = res;
+// break;
+// case IResource.FOLDER:
+// resFullPath = res.getFullPath();
+//
+// // ignore non-excluded folders on the classpath or that
+// // correspond to an output location
+// if ((srcIsProject
+// && !Util.isExcluded(res, exclusionPatterns) && Util
+// .isValidFolderNameForPackage(res.getName()))
+// || this.isClasspathEntryOrOutputLocation(
+// resFullPath, classpath, projectOutput)) {
+// break;
+// }
+// // else add non java resource
+// if (nonJavaResources.length == nonJavaResourcesCounter) {
+// // resize
+// System
+// .arraycopy(
+// nonJavaResources,
+// 0,
+// (nonJavaResources = new IResource[nonJavaResourcesCounter * 2]),
+// 0, nonJavaResourcesCounter);
+// }
+// nonJavaResources[nonJavaResourcesCounter++] = res;
+// }
+// }
+// if (nonJavaResources.length != nonJavaResourcesCounter) {
+// System
+// .arraycopy(
+// nonJavaResources,
+// 0,
+// (nonJavaResources = new IResource[nonJavaResourcesCounter]),
+// 0, nonJavaResourcesCounter);
+// }
+// } catch (CoreException e) {
+// nonJavaResources = NO_NON_JAVA_RESOURCES;
+// nonJavaResourcesCounter = 0;
+// }
+// return nonJavaResources;
+// }
/**
* @see IJavaProject
/**
* Returns an array of non-java resources contained in the receiver.
*/
- Object[] getNonJavaResources(JavaProject project) {
-
- Object[] nonJavaResources = fNonJavaResources;
- if (nonJavaResources == null) {
- nonJavaResources = computeNonJavaResources(project);
- fNonJavaResources = nonJavaResources;
- }
- return nonJavaResources;
- }
+// Object[] getNonJavaResources(JavaProject project) {
+//
+// Object[] nonJavaResources = fNonJavaResources;
+// if (nonJavaResources == null) {
+// nonJavaResources = computeNonJavaResources(project);
+// fNonJavaResources = nonJavaResources;
+// }
+// return nonJavaResources;
+// }
/**
* @see IJavaProject
* Returns whether the given path is a classpath entry or an output
* location.
*/
- private boolean isClasspathEntryOrOutputLocation(IPath path,
- IClasspathEntry[] resolvedClasspath, IPath projectOutput) {
- if (projectOutput.equals(path))
- return true;
- for (int i = 0, length = resolvedClasspath.length; i < length; i++) {
- IClasspathEntry entry = resolvedClasspath[i];
- if (entry.getPath().equals(path)) {
- return true;
- }
- IPath output;
- if ((output = entry.getOutputLocation()) != null
- && output.equals(path)) {
- return true;
- }
- }
- return false;
- }
+// private boolean isClasspathEntryOrOutputLocation(IPath path,
+// IClasspathEntry[] resolvedClasspath, IPath projectOutput) {
+// if (projectOutput.equals(path))
+// return true;
+// for (int i = 0, length = resolvedClasspath.length; i < length; i++) {
+// IClasspathEntry entry = resolvedClasspath[i];
+// if (entry.getPath().equals(path)) {
+// return true;
+// }
+// IPath output;
+// if ((output = entry.getOutputLocation()) != null
+// && output.equals(path)) {
+// return true;
+// }
+// }
+// return false;
+// }
protected void setNameLookup(NameLookup newNameLookup) {
*/
synchronized void setNonJavaResources(Object[] resources) {
- fNonJavaResources = resources;
+ //fNonJavaResources = resources;
}
// protected void setSearchableEnvironment(SearchableEnvironment
*******************************************************************************/
package net.sourceforge.phpdt.internal.core;
-import java.io.File;
+//import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
-import net.sourceforge.phpdt.core.IClasspathEntry;
+//import net.sourceforge.phpdt.core.IClasspathEntry;
import net.sourceforge.phpdt.core.ICompilationUnit;
import net.sourceforge.phpdt.core.IJavaElement;
import net.sourceforge.phpdt.core.IJavaProject;
import net.sourceforge.phpdt.core.IPackageFragment;
import net.sourceforge.phpdt.core.IPackageFragmentRoot;
import net.sourceforge.phpdt.core.IType;
-import net.sourceforge.phpdt.core.IWorkingCopy;
-import net.sourceforge.phpdt.core.JavaCore;
+//import net.sourceforge.phpdt.core.IWorkingCopy;
+//import net.sourceforge.phpdt.core.JavaCore;
import net.sourceforge.phpdt.core.JavaModelException;
import net.sourceforge.phpdt.internal.core.util.PerThreadObject;
-import net.sourceforge.phpdt.internal.core.util.Util;
+//import net.sourceforge.phpdt.internal.core.util.Util;
-import org.eclipse.core.resources.IResource;
+//import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
+//import org.eclipse.core.runtime.IPath;
/**
* A <code>NameLookup</code> provides name resolution within a Java project.
* The name must be fully qualified (eg "java.lang.Object",
* "java.util.Hashtable$Entry")
*/
- public ICompilationUnit findCompilationUnit(String qualifiedTypeName) {
- String pkgName = IPackageFragment.DEFAULT_PACKAGE_NAME;
- String cuName = qualifiedTypeName;
-
- int index = qualifiedTypeName.lastIndexOf('.');
- if (index != -1) {
- pkgName = qualifiedTypeName.substring(0, index);
- cuName = qualifiedTypeName.substring(index + 1);
- }
- index = cuName.indexOf('$');
- if (index != -1) {
- cuName = cuName.substring(0, index);
- }
- cuName += ".java"; //$NON-NLS-1$
- IPackageFragment[] frags = (IPackageFragment[]) fPackageFragments
- .get(pkgName);
- if (frags != null) {
- for (int i = 0; i < frags.length; i++) {
- //IPackageFragment frag = frags[i];
- // if (!(frag instanceof JarPackageFragment)) {
- // ICompilationUnit cu= frag.getCompilationUnit(cuName);
- // if (cu != null && cu.exists()) {
- // return cu;
- // }
- // }
- }
- }
- return null;
- }
+// public ICompilationUnit findCompilationUnit(String qualifiedTypeName) {
+// String pkgName = IPackageFragment.DEFAULT_PACKAGE_NAME;
+// String cuName = qualifiedTypeName;
+//
+// int index = qualifiedTypeName.lastIndexOf('.');
+// if (index != -1) {
+// pkgName = qualifiedTypeName.substring(0, index);
+// cuName = qualifiedTypeName.substring(index + 1);
+// }
+// index = cuName.indexOf('$');
+// if (index != -1) {
+// cuName = cuName.substring(0, index);
+// }
+// cuName += ".java"; //$NON-NLS-1$
+// IPackageFragment[] frags = (IPackageFragment[]) fPackageFragments
+// .get(pkgName);
+// if (frags != null) {
+// for (int i = 0; i < frags.length; i++) {
+// //IPackageFragment frag = frags[i];
+// // if (!(frag instanceof JarPackageFragment)) {
+// // ICompilationUnit cu= frag.getCompilationUnit(cuName);
+// // if (cu != null && cu.exists()) {
+// // return cu;
+// // }
+// // }
+// }
+// }
+// return null;
+// }
/**
* Returns the package fragment whose path matches the given (absolute)
* to the workbench: "/Project/src" - external to the workbench:
* "c:/jdk/classes.zip/java/lang"
*/
- public IPackageFragment findPackageFragment(IPath path) {
- if (!path.isAbsolute()) {
- throw new IllegalArgumentException(Util.bind("path.mustBeAbsolute")); //$NON-NLS-1$
- }
- /*
- * this code should rather use the package fragment map to find the
- * candidate package, then check if the respective enclosing root maps
- * to the one on this given IPath.
- */
- IResource possibleFragment = workspace.getRoot().findMember(path);
- if (possibleFragment == null) {
- // external jar
- for (int i = 0; i < fPackageFragmentRoots.length; i++) {
- IPackageFragmentRoot root = fPackageFragmentRoots[i];
- if (!root.isExternal()) {
- continue;
- }
- IPath rootPath = root.getPath();
- int matchingCount = rootPath.matchingFirstSegments(path);
- if (matchingCount != 0) {
- String name = path.toOSString();
- // + 1 is for the File.separatorChar
- name = name.substring(rootPath.toOSString().length() + 1,
- name.length());
- name = name.replace(File.separatorChar, '.');
- IJavaElement[] list = null;
- try {
- list = root.getChildren();
- } catch (JavaModelException npe) {
- continue; // the package fragment root is not present;
- }
- int elementCount = list.length;
- for (int j = 0; j < elementCount; j++) {
- IPackageFragment packageFragment = (IPackageFragment) list[j];
- if (nameMatches(name, packageFragment, false)) {
- return packageFragment;
- }
- }
- }
- }
- } else {
- IJavaElement fromFactory = JavaCore.create(possibleFragment);
- if (fromFactory == null) {
- return null;
- }
- if (fromFactory instanceof IPackageFragment) {
- return (IPackageFragment) fromFactory;
- } else if (fromFactory instanceof IJavaProject) {
- // default package in a default root
- JavaProject project = (JavaProject) fromFactory;
- try {
- IClasspathEntry entry = project.getClasspathEntryFor(path);
- if (entry != null) {
- IPackageFragmentRoot root = project
- .getPackageFragmentRoot(project.getResource());
- IPackageFragment[] pkgs = (IPackageFragment[]) fPackageFragments
- .get(IPackageFragment.DEFAULT_PACKAGE_NAME);
- if (pkgs == null) {
- return null;
- }
- for (int i = 0; i < pkgs.length; i++) {
- if (pkgs[i].getParent().equals(root)) {
- return pkgs[i];
- }
- }
- }
- } catch (JavaModelException e) {
- return null;
- }
- }
- }
- return null;
- }
+// public IPackageFragment findPackageFragment(IPath path) {
+// if (!path.isAbsolute()) {
+// throw new IllegalArgumentException(Util.bind("path.mustBeAbsolute")); //$NON-NLS-1$
+// }
+// /*
+// * this code should rather use the package fragment map to find the
+// * candidate package, then check if the respective enclosing root maps
+// * to the one on this given IPath.
+// */
+// IResource possibleFragment = workspace.getRoot().findMember(path);
+// if (possibleFragment == null) {
+// // external jar
+// for (int i = 0; i < fPackageFragmentRoots.length; i++) {
+// IPackageFragmentRoot root = fPackageFragmentRoots[i];
+// if (!root.isExternal()) {
+// continue;
+// }
+// IPath rootPath = root.getPath();
+// int matchingCount = rootPath.matchingFirstSegments(path);
+// if (matchingCount != 0) {
+// String name = path.toOSString();
+// // + 1 is for the File.separatorChar
+// name = name.substring(rootPath.toOSString().length() + 1,
+// name.length());
+// name = name.replace(File.separatorChar, '.');
+// IJavaElement[] list = null;
+// try {
+// list = root.getChildren();
+// } catch (JavaModelException npe) {
+// continue; // the package fragment root is not present;
+// }
+// int elementCount = list.length;
+// for (int j = 0; j < elementCount; j++) {
+// IPackageFragment packageFragment = (IPackageFragment) list[j];
+// if (nameMatches(name, packageFragment, false)) {
+// return packageFragment;
+// }
+// }
+// }
+// }
+// } else {
+// IJavaElement fromFactory = JavaCore.create(possibleFragment);
+// if (fromFactory == null) {
+// return null;
+// }
+// if (fromFactory instanceof IPackageFragment) {
+// return (IPackageFragment) fromFactory;
+// } else if (fromFactory instanceof IJavaProject) {
+// // default package in a default root
+// JavaProject project = (JavaProject) fromFactory;
+// try {
+// IClasspathEntry entry = project.getClasspathEntryFor(path);
+// if (entry != null) {
+// IPackageFragmentRoot root = project
+// .getPackageFragmentRoot(project.getResource());
+// IPackageFragment[] pkgs = (IPackageFragment[]) fPackageFragments
+// .get(IPackageFragment.DEFAULT_PACKAGE_NAME);
+// if (pkgs == null) {
+// return null;
+// }
+// for (int i = 0; i < pkgs.length; i++) {
+// if (pkgs[i].getParent().equals(root)) {
+// return pkgs[i];
+// }
+// }
+// }
+// } catch (JavaModelException e) {
+// return null;
+// }
+// }
+// }
+// return null;
+// }
/**
* Returns the package fragments whose name matches the given (qualified)
* their compilation units. <code>null</code> means that no special
* compilation units should be used.
*/
- public void setUnitsToLookInside(IWorkingCopy[] unitsToLookInside) {
-
- if (unitsToLookInside == null) {
- this.unitsToLookInside.setCurrent(null);
- } else {
- HashMap workingCopies = new HashMap();
- this.unitsToLookInside.setCurrent(workingCopies);
- for (int i = 0, length = unitsToLookInside.length; i < length; i++) {
- IWorkingCopy unitToLookInside = unitsToLookInside[i];
- ICompilationUnit original = (ICompilationUnit) unitToLookInside
- .getOriginalElement();
- if (original != null) {
- workingCopies.put(original, unitToLookInside);
- } else {
- workingCopies.put(unitToLookInside, unitToLookInside);
- }
- }
- }
- }
+// public void setUnitsToLookInside(IWorkingCopy[] unitsToLookInside) {
+//
+// if (unitsToLookInside == null) {
+// this.unitsToLookInside.setCurrent(null);
+// } else {
+// HashMap workingCopies = new HashMap();
+// this.unitsToLookInside.setCurrent(workingCopies);
+// for (int i = 0, length = unitsToLookInside.length; i < length; i++) {
+// IWorkingCopy unitToLookInside = unitsToLookInside[i];
+// ICompilationUnit original = (ICompilationUnit) unitToLookInside
+// .getOriginalElement();
+// if (original != null) {
+// workingCopies.put(original, unitToLookInside);
+// } else {
+// workingCopies.put(unitToLookInside, unitToLookInside);
+// }
+// }
+// }
+// }
/**
* Notifies the given requestor of all types (classes and interfaces) in the
import java.util.Iterator;
import net.sourceforge.phpdt.internal.core.util.LRUCache;
-import net.sourceforge.phpdt.internal.core.util.Util;
+//import net.sourceforge.phpdt.internal.core.util.Util;
/**
* The <code>OverflowingLRUCache</code> is an LRUCache which attempts to
*
* @return Hashtable of entries
*/
- public java.util.Hashtable getEntryTable() {
- return fEntryTable;
- }
+// public java.util.Hashtable getEntryTable() {
+// return fEntryTable;
+// }
/**
* Returns the load factor for the cache. The load factor determines how
*
* @return double
*/
- public double getLoadFactor() {
- return fLoadFactor;
- }
+// public double getLoadFactor() {
+// return fLoadFactor;
+// }
/**
* @return The space by which the cache has overflown.
*/
- public int getOverflow() {
- return fOverflow;
- }
+// public int getOverflow() {
+// return fOverflow;
+// }
/**
* Ensures there is the specified amount of free space in the receiver, by
* @throws IllegalArgumentException
* when the new load factor is not in (0.0, 1.0]
*/
- public void setLoadFactor(double newLoadFactor)
- throws IllegalArgumentException {
- if (newLoadFactor <= 1.0 && newLoadFactor > 0.0)
- fLoadFactor = newLoadFactor;
- else
- throw new IllegalArgumentException(Util
- .bind("cache.invalidLoadFactor")); //$NON-NLS-1$
- }
+// public void setLoadFactor(double newLoadFactor)
+// throws IllegalArgumentException {
+// if (newLoadFactor <= 1.0 && newLoadFactor > 0.0)
+// fLoadFactor = newLoadFactor;
+// else
+// throw new IllegalArgumentException(Util
+// .bind("cache.invalidLoadFactor")); //$NON-NLS-1$
+// }
/**
* Sets the maximum amount of space that the cache can store
*******************************************************************************/
package net.sourceforge.phpdt.internal.core;
-import net.sourceforge.phpdt.core.JavaModelException;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
+//import net.sourceforge.phpdt.core.JavaModelException;
+//
+//import org.eclipse.core.resources.IContainer;
+//import org.eclipse.core.resources.IResource;
/**
* Element info for PackageFragments.
/**
*/
- boolean containsJavaResources() {
- return fChildren.length != 0;
- }
+// boolean containsJavaResources() {
+// return fChildren.length != 0;
+// }
/**
* Returns an array of non-java resources contained in the receiver.
*/
- Object[] getNonJavaResources(IResource underlyingResource,
- PackageFragmentRoot rootHandle) {
- Object[] nonJavaResources = fNonJavaResources;
- if (nonJavaResources == null) {
- try {
- nonJavaResources = PackageFragmentRootInfo
- .computeFolderNonJavaResources((JavaProject) rootHandle
- .getJavaProject(),
- (IContainer) underlyingResource, rootHandle
- .fullExclusionPatternChars());
- } catch (JavaModelException e) {
- }
- fNonJavaResources = nonJavaResources;
- }
- return nonJavaResources;
- }
+// Object[] getNonJavaResources(IResource underlyingResource,
+// PackageFragmentRoot rootHandle) {
+// Object[] nonJavaResources = fNonJavaResources;
+// if (nonJavaResources == null) {
+// try {
+// nonJavaResources = PackageFragmentRootInfo
+// .computeFolderNonJavaResources((JavaProject) rootHandle
+// .getJavaProject(),
+// (IContainer) underlyingResource, rootHandle
+// .fullExclusionPatternChars());
+// } catch (JavaModelException e) {
+// }
+// fNonJavaResources = nonJavaResources;
+// }
+// return nonJavaResources;
+// }
/**
* Set the fNonJavaResources to res value
import net.sourceforge.phpdt.internal.core.util.Util;
import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFolder;
+//import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
/**
* @see Openable
*/
- protected boolean generateInfos(OpenableElementInfo info,
- IProgressMonitor pm, Map newElements, IResource underlyingResource)
- throws JavaModelException {
-
- // ((PackageFragmentRootInfo)
- // info).setRootKind(determineKind(underlyingResource));
- // return computeChildren(info);
- return false;
- }
+// protected boolean generateInfos(OpenableElementInfo info,
+// IProgressMonitor pm, Map newElements, IResource underlyingResource)
+// throws JavaModelException {
+//
+// // ((PackageFragmentRootInfo)
+// // info).setRootKind(determineKind(underlyingResource));
+// // return computeChildren(info);
+// return false;
+// }
/**
* @see JavaElement#getHandleMemento()
* Returns the package name for the given folder (which is a decendent of
* this root).
*/
- protected String getPackageName(IFolder folder) throws JavaModelException {
- IPath myPath = getPath();
- IPath pkgPath = folder.getFullPath();
- int mySegmentCount = myPath.segmentCount();
- int pkgSegmentCount = pkgPath.segmentCount();
- StringBuffer name = new StringBuffer(
- IPackageFragment.DEFAULT_PACKAGE_NAME);
- for (int i = mySegmentCount; i < pkgSegmentCount; i++) {
- if (i > mySegmentCount) {
- name.append('.');
- }
- name.append(pkgPath.segment(i));
- }
- return name.toString();
- }
+// protected String getPackageName(IFolder folder) throws JavaModelException {
+// IPath myPath = getPath();
+// IPath pkgPath = folder.getFullPath();
+// int mySegmentCount = myPath.segmentCount();
+// int pkgSegmentCount = pkgPath.segmentCount();
+// StringBuffer name = new StringBuffer(
+// IPackageFragment.DEFAULT_PACKAGE_NAME);
+// for (int i = mySegmentCount; i < pkgSegmentCount; i++) {
+// if (i > mySegmentCount) {
+// name.append('.');
+// }
+// name.append(pkgPath.segment(i));
+// }
+// return name.toString();
+// }
/**
* @see IJavaElement
/**
* Returns an array of non-java resources contained in the receiver.
*/
- synchronized Object[] getNonJavaResources(IJavaProject project,
- IResource underlyingResource, PackageFragmentRoot handle) {
- Object[] nonJavaResources = fNonJavaResources;
- if (nonJavaResources == null) {
- nonJavaResources = this.computeNonJavaResources(project,
- underlyingResource, handle);
- fNonJavaResources = nonJavaResources;
- }
- return nonJavaResources;
- }
+// synchronized Object[] getNonJavaResources(IJavaProject project,
+// IResource underlyingResource, PackageFragmentRoot handle) {
+// Object[] nonJavaResources = fNonJavaResources;
+// if (nonJavaResources == null) {
+// nonJavaResources = this.computeNonJavaResources(project,
+// underlyingResource, handle);
+// fNonJavaResources = nonJavaResources;
+// }
+// return nonJavaResources;
+// }
/**
* Returns the kind of this root.
// net.sourceforge.phpdt.core.dom.CompilationUnit ast;
- public ReconcileWorkingCopyOperation(IJavaElement workingCopy,
- boolean forceProblemDetection) {
- super(new IJavaElement[] { workingCopy });
- this.forceProblemDetection = forceProblemDetection;
- }
+// public ReconcileWorkingCopyOperation(IJavaElement workingCopy,
+// boolean forceProblemDetection) {
+// super(new IJavaElement[] { workingCopy });
+// this.forceProblemDetection = forceProblemDetection;
+// }
public ReconcileWorkingCopyOperation(IJavaElement workingCopy,
boolean creatAST, int astLevel, boolean forceProblemDetection,
/**
* Returns a printable string for the array.
*/
- protected String toStringCharChar(char[][] names) {
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < names.length; i++) {
- result.append(toStringChar(names[i]));
- }
- return result.toString();
- }
+// protected String toStringCharChar(char[][] names) {
+// StringBuffer result = new StringBuffer();
+// for (int i = 0; i < names.length; i++) {
+// result.append(toStringChar(names[i]));
+// }
+// return result.toString();
+// }
public void cleanup() {
}
* Constructs a SearchableEnvironmentRequestor that wraps the given
* SearchRequestor.
*/
- public SearchableEnvironmentRequestor(ISearchRequestor requestor) {
- fRequestor = requestor;
- fUnitToSkip = null;
- }
+// public SearchableEnvironmentRequestor(ISearchRequestor requestor) {
+// fRequestor = requestor;
+// fUnitToSkip = null;
+// }
/**
* Constructs a SearchableEnvironmentRequestor that wraps the given
*******************************************************************************/
package net.sourceforge.phpdt.internal.core;
-import net.sourceforge.phpdt.core.Signature;
+//import net.sourceforge.phpdt.core.Signature;
import net.sourceforge.phpdt.internal.compiler.env.ISourceField;
/**
*
* @see Signature
*/
- protected String getTypeSignature() {
- return Signature.createTypeSignature(this.typeName, false);
- }
+// protected String getTypeSignature() {
+// return Signature.createTypeSignature(this.typeName, false);
+// }
/**
* Sets the type name of the field.
/**
* @see ISourceType
*/
- public char[] getEnclosingTypeName() {
- return fEnclosingTypeName;
- }
+// public char[] getEnclosingTypeName() {
+// return fEnclosingTypeName;
+// }
/**
* @see ISourceType