[230291] remove dead code
diff --git a/bundles/org.eclipse.wst.jsdt.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.jsdt.core/META-INF/MANIFEST.MF
index 0b89a37..fa8b8f9 100644
--- a/bundles/org.eclipse.wst.jsdt.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.jsdt.core/META-INF/MANIFEST.MF
@@ -43,7 +43,6 @@
org.eclipse.wst.jsdt.internal.formatter;x-internal:=true,
org.eclipse.wst.jsdt.internal.formatter.align;x-internal:=true,
org.eclipse.wst.jsdt.internal.formatter.comment;x-internal:=true,
- org.eclipse.wst.jsdt.internal.formatter.old;x-internal:=true,
org.eclipse.wst.jsdt.internal.oaametadata,
org.eclipse.wst.jsdt.launching
Bundle-Version: 1.0.0.qualifier
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionContext.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionContext.java
index 892f9c4..24c4548 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionContext.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/CompletionContext.java
@@ -47,16 +47,6 @@
public static final int TOKEN_KIND_STRING_LITERAL = 2;
/**
- * Tell user whether completion takes place in a jSdoc comment or not.
- *
- * @return boolean true if completion takes place in a jsdoc comment, false otherwise.
- * @deprecated Use {@link #isInJsdoc()} instead
- */
- public boolean isInJavadoc() {
- return isInJsdoc();
- }
-
- /**
* Tell user whether completion takes place in a jsdoc comment or not.
*
* @return boolean true if completion takes place in a jsdoc comment, false otherwise.
@@ -69,16 +59,6 @@
* Tell user whether completion takes place in text area of a jsdoc comment or not.
*
* @return boolean true if completion takes place in a text area of a jsdoc comment, false otherwise.
- * @deprecated Use {@link #isInJsdocText()} instead
- */
- public boolean isInJavadocText() {
- return isInJsdocText();
- }
-
- /**
- * Tell user whether completion takes place in text area of a jsdoc comment or not.
- *
- * @return boolean true if completion takes place in a text area of a jsdoc comment, false otherwise.
*/
public boolean isInJsdocText() {
return (this.javadoc & CompletionOnJavadoc.TEXT) != 0;
@@ -97,25 +77,6 @@
* </ul>
*
* @return boolean true if completion takes place in formal reference of a jsdoc tag, false otherwise.
- * @deprecated Use {@link #isInJsdocFormalReference()} instead
- */
- public boolean isInJavadocFormalReference() {
- return isInJsdocFormalReference();
- }
-
- /**
- * Tell user whether completion takes place in a formal reference of a jsdoc tag or not.
- * Tags with formal reference are:
- * <ul>
- * <li>@see</li>
- * <li>@throws</li>
- * <li>@exception</li>
- * <li>{@link Object}</li>
- * <li>{@linkplain Object}</li>
- * <li>{@value} when compiler compliance is set at leats to 1.5</li>
- * </ul>
- *
- * @return boolean true if completion takes place in formal reference of a jsdoc tag, false otherwise.
*/
public boolean isInJsdocFormalReference() {
return (this.javadoc & CompletionOnJavadoc.FORMAL_REFERENCE) != 0;
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ElementChangedEvent.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ElementChangedEvent.java
index 026ea77..d29b576 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ElementChangedEvent.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ElementChangedEvent.java
@@ -53,27 +53,6 @@
* to one or more JavaScript element(s) expressed as a hierarchical
* java element delta as returned by <code>getDelta</code>.
*
- * Note: this notification occurs during the corresponding PRE_AUTO_BUILD
- * resource change notification. The delta, which is notified here, only contains
- * information relative to the previous JavaScriptModel operations (in other words,
- * it ignores the possible resources which have changed outside JavaScript operations).
- * In particular, it is possible that the JavaScriptModel be inconsistent with respect to
- * resources, which got modified outside JavaScriptModel operations (it will only be
- * fully consistent once the POST_CHANGE notification has occurred).
- *
- * @see IJavaScriptElementDelta
- * @see org.eclipse.core.resources.IResourceChangeEvent
- * @see #getDelta()
- * @deprecated - no longer used, such deltas are now notified during POST_CHANGE
- */
- public static final int PRE_AUTO_BUILD = 2;
-
- /**
- * Event type constant (bit mask) indicating an after-the-fact
- * report of creations, deletions, and modifications
- * to one or more JavaScript element(s) expressed as a hierarchical
- * java element delta as returned by <code>getDelta</code>.
- *
* Note: this notification occurs as a result of a working copy reconcile
* operation.
*
@@ -118,7 +97,6 @@
*
* @return one of the event type constants
* @see #POST_CHANGE
- * @see #PRE_AUTO_BUILD
* @see #POST_RECONCILE
*/
public int getType() {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IClassFile.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IClassFile.java
index 7d7e465..966b40c 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IClassFile.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IClassFile.java
@@ -110,30 +110,6 @@
/**
- * Returns a working copy on the source associated with this class file using the given
- * factory to create the buffer, or <code>null</code> if there is no source associated
- * with the class file.
- * <p>
- * The buffer will be automatically initialized with the source of the class file
- * upon creation.
- * <p>
- * The only valid operations on this working copy are <code>getBuffer()</code> or <code>getOriginalElement</code>.
- *
- * @param monitor a progress monitor used to report progress while opening this compilation unit
- * or <code>null</code> if no progress should be reported
- * @param factory the factory that creates a buffer that is used to get the content of the working copy
- * or <code>null</code> if the internal factory should be used
- * @return a a working copy on the source associated with this class file
- * @exception JavaScriptModelException if the source of this class file can
- * not be determined. Reasons include:
- * <ul>
- * <li> This class file does not exist (ELEMENT_DOES_NOT_EXIST)</li>
- * </ul>
- * @since 2.0
- * @deprecated Use {@link ITypeRoot#getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} instead
- */
-IJavaScriptElement getWorkingCopy(IProgressMonitor monitor, IBufferFactory factory) throws JavaScriptModelException;
-/**
* Returns whether this type represents a class. This is not guaranteed to be
* instantaneous, as it may require parsing the underlying file.
*
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeAssist.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeAssist.java
index ec638c4..f2aab82 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeAssist.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeAssist.java
@@ -30,49 +30,6 @@
* is the 0-based index of the character, after which code assist is desired.
* An <code>offset</code> of -1 indicates to code assist at the beginning of this
* compilation unit.
- *
- * @param offset the given offset position
- * @param requestor the given completion requestor
- *
- * @exception JavaScriptModelException if code assist could not be performed. Reasons include:<ul>
- * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
- * <li> The position specified is < -1 or is greater than this compilation unit's
- * source length (INDEX_OUT_OF_BOUNDS)
- * </ul>
- *
- * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
- * @deprecated Use {@link #codeComplete(int, ICompletionRequestor)} instead.
- */
- void codeComplete(int offset, ICodeCompletionRequestor requestor)
- throws JavaScriptModelException;
- /**
- * Performs code completion at the given offset position in this compilation unit,
- * reporting results to the given completion requestor. The <code>offset</code>
- * is the 0-based index of the character, after which code assist is desired.
- * An <code>offset</code> of -1 indicates to code assist at the beginning of this
- * compilation unit.
- *
- * @param offset the given offset position
- * @param requestor the given completion requestor
- * @exception JavaScriptModelException if code assist could not be performed. Reasons include:<ul>
- * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
- * <li> The position specified is < -1 or is greater than this compilation unit's
- * source length (INDEX_OUT_OF_BOUNDS)
- * </ul>
- *
- * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
- * @since 2.0
- * @deprecated Use {@link #codeComplete(int, CompletionRequestor)} instead.
- */
- void codeComplete(int offset, ICompletionRequestor requestor)
- throws JavaScriptModelException;
-
- /**
- * Performs code completion at the given offset position in this compilation unit,
- * reporting results to the given completion requestor. The <code>offset</code>
- * is the 0-based index of the character, after which code assist is desired.
- * An <code>offset</code> of -1 indicates to code assist at the beginning of this
- * compilation unit.
* <p>
*
* @param offset the given offset position
@@ -114,36 +71,6 @@
*
* @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
* @since 3.0
- * @deprecated Use {@link #codeComplete(int, CompletionRequestor, WorkingCopyOwner)} instead.
- */
- void codeComplete(int offset, ICompletionRequestor requestor, WorkingCopyOwner owner)
- throws JavaScriptModelException;
-
- /**
- * Performs code completion at the given offset position in this compilation unit,
- * reporting results to the given completion requestor. The <code>offset</code>
- * is the 0-based index of the character, after which code assist is desired.
- * An <code>offset</code> of -1 indicates to code assist at the beginning of this
- * compilation unit.
- * It considers types in the working copies with the given owner first. In other words,
- * the owner's working copies will take precedence over their original compilation units
- * in the workspace.
- * <p>
- * Note that if a working copy is empty, it will be as if the original compilation
- * unit had been deleted.
- * </p>
- *
- * @param offset the given offset position
- * @param requestor the given completion requestor
- * @param owner the owner of working copies that take precedence over their original compilation units
- * @exception JavaScriptModelException if code assist could not be performed. Reasons include:<ul>
- * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
- * <li> The position specified is < -1 or is greater than this compilation unit's
- * source length (INDEX_OUT_OF_BOUNDS)
- * </ul>
- *
- * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
- * @since 3.0
*/
void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner)
throws JavaScriptModelException;
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeCompletionRequestor.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeCompletionRequestor.java
deleted file mode 100644
index e2aadfc..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeCompletionRequestor.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core;
-
-import org.eclipse.core.resources.IMarker;
-
-/**
- * A completion requestor accepts results as they are computed and is aware
- * of source positions to complete the various different results.
- * <p>
- * This interface may be implemented by clients.
- * </p>
- *
- * @see ICodeAssist
- * @deprecated Use {@link CompletionRequestor} instead.
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
-*/
-public interface ICodeCompletionRequestor {
-/**
- * Code assist notification of a class completion.
- *
- * @param packageName Declaring package name of the class.
- * @param className Name of the class.
- * @param completionName The completion for the class.
- * Can include ';' for imported classes.
- * @param modifiers The modifiers of the class.
- * @param completionStart The start position of insertion of the name of the class.
- * @param completionEnd The end position of insertion of the name of the class.
- *
- * NOTE - All package and type names are presented in their readable form:
- * Package names are in the form "a.b.c".
- * Nested type names are in the qualified form "A.M".
- * The default package is represented by an empty array.
- */
-void acceptClass(
- char[] packageName,
- char[] className,
- char[] completionName,
- int modifiers,
- int completionStart,
- int completionEnd);
-/**
- * Code assist notification of a compilation error detected during completion.
- * @param marker Only problems which are categorized as errors are notified to the requestor,
- * warnings are silently ignored.
- * In case an error got signaled, no other completions might be available,
- * therefore the problem message should be presented to the user.
- * The source positions of the problem are related to the source where it was
- * detected (might be in another compilation unit, if it was indirectly requested
- * during the code assist process).
- * Note: the problem knows its originating file name.
- */
-void acceptError(IMarker marker);
-/**
- * Code assist notification of a field completion.
- *
- * @param declaringTypePackageName Name of the package in which the type that contains this field is declared.
- *
- * @param declaringTypeName Name of the type declaring this new field.
- *
- * @param name Name of the field.
- *
- * @param typePackageName Name of the package in which the type of this field is declared.
- *
- * @param typeName Name of the type of this field.
- *
- * @param completionName The completion for the field.
- *
- * @param modifiers The modifiers of this field.
- *
- * @param completionStart The start position of insertion of the name of this field.
- *
- * @param completionEnd The end position of insertion of the name of this field.
- *
- * NOTE - All package and type names are presented in their readable form:
- * Package names are in the form "a.b.c".
- * Base types are in the form "int" or "boolean".
- * Array types are in the qualified form "M[]" or "int[]".
- * Nested type names are in the qualified form "A.M".
- * The default package is represented by an empty array.
- */
-void acceptField(
- char[] declaringTypePackageName,
- char[] declaringTypeName,
- char[] name,
- char[] typePackageName,
- char[] typeName,
- char[] completionName,
- int modifiers,
- int completionStart,
- int completionEnd);
-/**
- * Code assist notification of an interface completion.
- *
- * @param packageName Declaring package name of the interface.
- * @param interfaceName Name of the interface.
- * @param completionName The completion for the interface.
- * Can include ';' for imported interfaces.
- * @param modifiers The modifiers of the interface.
- * @param completionStart The start position of insertion of the name of the interface.
- * @param completionEnd The end position of insertion of the name of the interface.
- *
- * NOTE - All package and type names are presented in their readable form:
- * Package names are in the form "a.b.c".
- * Nested type names are in the qualified form "A.M".
- * The default package is represented by an empty array.
- */
-void acceptInterface(
- char[] packageName,
- char[] interfaceName,
- char[] completionName,
- int modifiers,
- int completionStart,
- int completionEnd);
-/**
- * Code assist notification of a keyword completion.
- *
- * @param keywordName The keyword source.
- * @param completionStart The start position of insertion of the name of this keyword.
- * @param completionEnd The end position of insertion of the name of this keyword.
- */
-void acceptKeyword(char[] keywordName, int completionStart, int completionEnd);
-/**
- * Code assist notification of a label completion.
- *
- * @param labelName The label source.
- * @param completionStart The start position of insertion of the name of this label.
- * @param completionEnd The end position of insertion of the name of this label.
- */
-void acceptLabel(char[] labelName, int completionStart, int completionEnd);
-/**
- * Code assist notification of a local variable completion.
- *
- * @param name Name of the new local variable.
- *
- * @param typePackageName Name of the package in which the type of this new local variable is declared.
- *
- * @param typeName Name of the type of this new local variable.
- *
- * @param modifiers The modifiers of this new local variable.
- *
- * @param completionStart The start position of insertion of the name of this new local variable.
- *
- * @param completionEnd The end position of insertion of the name of this new local variable.
- *
- * NOTE - All package and type names are presented in their readable form:
- * Package names are in the form "a.b.c".
- * Base types are in the form "int" or "boolean".
- * Array types are in the qualified form "M[]" or "int[]".
- * Nested type names are in the qualified form "A.M".
- * The default package is represented by an empty array.
- */
-void acceptLocalVariable(
- char[] name,
- char[] typePackageName,
- char[] typeName,
- int modifiers,
- int completionStart,
- int completionEnd);
-/**
- * Code assist notification of a method completion.
- *
- * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared.
- *
- * @param declaringTypeName Name of the type declaring this new method.
- *
- * @param selector Name of the new method.
- *
- * @param parameterPackageNames Names of the packages in which the parameter types are declared.
- * Should contain as many elements as parameterTypeNames.
- *
- * @param parameterTypeNames Names of the parameters types.
- * Should contain as many elements as parameterPackageNames.
- *
- * @param returnTypePackageName Name of the package in which the return type is declared.
- *
- * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor.
- *
- * @param completionName The completion for the method.
- * Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it.
- *
- * @param modifiers The modifiers of this new method.
- *
- * @param completionStart The start position of insertion of the name of this new method.
- *
- * @param completionEnd The end position of insertion of the name of this new method.
- *
- * NOTE - All package and type names are presented in their readable form:
- * Package names are in the form "a.b.c".
- * Base types are in the form "int" or "boolean".
- * Array types are in the qualified form "M[]" or "int[]".
- * Nested type names are in the qualified form "A.M".
- * The default package is represented by an empty array.
- *
- * NOTE: parameter names can be retrieved from the source model after the user selects a specific method.
- */
-void acceptMethod(
- char[] declaringTypePackageName,
- char[] declaringTypeName,
- char[] selector,
- char[][] parameterPackageNames,
- char[][] parameterTypeNames,
- char[] returnTypePackageName,
- char[] returnTypeName,
- char[] completionName,
- int modifiers,
- int completionStart,
- int completionEnd);
-/**
- * Code assist notification of a modifier completion.
- *
- * @param modifierName The new modifier.
- * @param completionStart The start position of insertion of the name of this new modifier.
- * @param completionEnd The end position of insertion of the name of this new modifier.
- */
-void acceptModifier(char[] modifierName, int completionStart, int completionEnd);
-/**
- * Code assist notification of a package completion.
- *
- * @param packageName The package name.
- * @param completionName The completion for the package.
- * Can include '.*;' for imports.
- * @param completionStart The start position of insertion of the name of this new package.
- * @param completionEnd The end position of insertion of the name of this new package.
- *
- * NOTE - All package names are presented in their readable form:
- * Package names are in the form "a.b.c".
- * The default package is represented by an empty array.
- */
-void acceptPackage(
- char[] packageName,
- char[] completionName,
- int completionStart,
- int completionEnd);
-/**
- * Code assist notification of a type completion.
- *
- * @param packageName Declaring package name of the type.
- * @param typeName Name of the type.
- * @param completionName The completion for the type.
- * Can include ';' for imported types.
- * @param completionStart The start position of insertion of the name of the type.
- * @param completionEnd The end position of insertion of the name of the type.
- *
- * NOTE - All package and type names are presented in their readable form:
- * Package names are in the form "a.b.c".
- * Nested type names are in the qualified form "A.M".
- * The default package is represented by an empty array.
- */
-void acceptType(
- char[] packageName,
- char[] typeName,
- char[] completionName,
- int completionStart,
- int completionEnd);
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeFormatter.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeFormatter.java
deleted file mode 100644
index 07570ca..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ICodeFormatter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core;
-
-/**
- * Specification for a generic source code formatter. Client plug-ins can contribute
- * an implementation for an ICodeFormatter, through the extension point "org.eclipse.wst.jsdt.core.codeFormatter".
- * In case none is found, a default formatter can be provided through the ToolFactory.
- *
- * @see ToolFactory#createCodeFormatter()
- * @see ToolFactory#createDefaultCodeFormatter(java.util.Map options)
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.CodeFormatter} instead (note: options have changed)
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public interface ICodeFormatter {
-
- /**
- * Formats the String <code>sourceString</code>,
- * and returns a string containing the formatted version.
- *
- * @param string the string to format
- * @param indentationLevel the initial indentation level, used
- * to shift left/right the entire source fragment. An initial indentation
- * level of zero has no effect.
- * @param positions an array of positions to map. These are
- * character-based source positions inside the original source,
- * arranged in non-decreasing order, for which corresponding positions in
- * the formatted source will be computed (so as to relocate elements associated
- * with the original source). It updates the positions array with updated
- * positions. If set to <code>null</code>, then no positions are mapped.
- * @param lineSeparator the line separator to use in formatted source,
- * if set to <code>null</code>, then the platform default one will be used.
- * @return the formatted output string.
- */
- String format(String string, int indentationLevel, int[] positions, String lineSeparator);
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunction.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunction.java
index 5304208..b7fff01 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunction.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunction.java
@@ -57,23 +57,6 @@
String[] getExceptionTypes() throws JavaScriptModelException;
/**
- * Returns the formal type parameter signatures for this method.
- * Returns an empty array if this method has no formal type parameters.
- * <p>
- * The formal type parameter signatures may be either unresolved (for source
- * types) or resolved (for binary types). See {@link Signature} for details.
- * </p>
- *
- * @exception JavaScriptModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
- * @return the formal type parameter signatures of this method,
- * in the order declared in the source, an empty array if none
- * @see Signature
- * @since 3.0
- * @deprecated Use {@link #getTypeParameters()} instead
- */
-String[] getTypeParameterSignatures() throws JavaScriptModelException;
-/**
* Returns the formal type parameters for this method.
* Returns an empty array if this method has no formal type parameters.
*
@@ -251,9 +234,5 @@
* @since 2.0
*/
boolean isSimilar(IFunction method);
-/**
- * @deprecated Use {@link #getFunction(String,String[])} instead
- */
-public IFunction getMethod(String selector, String[] parameterTypeSignatures) ;
public IFunction getFunction(String selector, String[] parameterTypeSignatures) ;
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunctionContainer.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunctionContainer.java
index 965d314..ddf625e 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunctionContainer.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IFunctionContainer.java
@@ -73,24 +73,6 @@
* @param name the given name
* @param parameterTypeSignatures the given parameter types
* @return the method with the specified name and parameter types in this type
- * @deprecated Use {@link #getFunction(String,String[])} instead
- */
-IFunction getMethod(String name, String[] parameterTypeSignatures);
-/**
- * Returns the method with the specified name and parameter types
- * in this type (for example, <code>"foo", {"I", "QString;"}</code>).
- * To get the handle for a constructor, the name specified must be the
- * simple name of the enclosing type.
- * This is a handle-only method. The method may or may not be present.
- * <p>
- * The type signatures may be either unresolved (for source types)
- * or resolved (for binary types), and either basic (for basic types)
- * or rich (for parameterized types). See {@link Signature} for details.
- * </p>
- *
- * @param name the given name
- * @param parameterTypeSignatures the given parameter types
- * @return the method with the specified name and parameter types in this type
*/
IFunction getFunction(String name, String[] parameterTypeSignatures);
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathEntry.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathEntry.java
index 4bb0058..716f0f0 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathEntry.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IIncludePathEntry.java
@@ -432,27 +432,4 @@
* @since 2.0
*/
boolean isExported();
-
- /**
- * This is a helper method, which returns the resolved classpath entry denoted
- * by an entry (if it is a variable entry). It is obtained by resolving the variable
- * reference in the first segment. Returns <code>null</code> if unable to resolve using
- * the following algorithm:
- * <ul>
- * <li> if variable segment cannot be resolved, returns <code>null</code></li>
- * <li> finds a project, JAR or binary folder in the workspace at the resolved path location</li>
- * <li> if none finds an external JAR file or folder outside the workspace at the resolved path location </li>
- * <li> if none returns <code>null</code></li>
- * </ul>
- * <p>
- * Variable source attachment is also resolved and recorded in the resulting classpath entry.
- * <p>
- * @return the resolved library or project classpath entry, or <code>null</code>
- * if the given path could not be resolved to a classpath entry
- * <p>
- * Note that this deprecated API doesn't handle CPE_CONTAINER entries.
- *
- * @deprecated Use {@link JavaScriptCore#getResolvedIncludepathEntry(IIncludePathEntry)} instead
- */
- IIncludePathEntry getResolvedEntry();
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElementDelta.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElementDelta.java
index af022e8..d4f0b8f 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElementDelta.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptElementDelta.java
@@ -35,9 +35,6 @@
* which is an archive.</li>
* <li>{@link #F_CHILDREN} - A child of the element has changed in some way. This flag
* is only valid if the element is an {@link IParent}.</li>
- * <li>{@link #F_INCLUDEPATH_REORDER} - A classpath entry corresponding to the element
- * has changed position in the project's classpath. This flag is only valid if the element is an
- * {@link IPackageFragmentRoot}.</li>
* <li>{@link #F_CLOSED} - The underlying {@link org.eclipse.core.resources.IProject}
* has been closed. This flag is only valid if the element is an {@link IJavaScriptProject}.</li>
* <li>{@link #F_CONTENT} - The contents of the element have been altered. This flag
@@ -78,8 +75,7 @@
* do not imply anything about the parent or children of the element.
* </p>
* <p>
- * The {@link #F_ADDED_TO_CLASSPATH}, {@link #F_REMOVED_FROM_CLASSPATH} and
- * {@link #F_INCLUDEPATH_REORDER} flags are triggered by changes to a project's classpath. They do not mean that
+ * The {@link #F_ADDED_TO_CLASSPATH} and {@link #F_REMOVED_FROM_CLASSPATH} flags are triggered by changes to a project's classpath. They do not mean that
* the underlying resource was added, removed or changed. For example, if a project P already contains a folder src, then
* adding a classpath entry with the 'P/src' path to the project's classpath will result in an {@link IJavaScriptElementDelta}
* with the {@link #F_ADDED_TO_CLASSPATH} flag for the {@link IPackageFragmentRoot} P/src.
@@ -173,12 +169,6 @@
public int F_REMOVED_FROM_CLASSPATH = 0x000080;
/**
- * Change flag indicating that a classpath entry corresponding to the element has changed position in the project's
- * classpath. This flag is only valid if the element is an {@link IPackageFragmentRoot}.
- * @deprecated Use {@link #F_REORDER} instead.
- */
- public int F_INCLUDEPATH_REORDER = 0x000100;
- /**
* Change flag indicating that the element has changed position relatively to its siblings.
* If the element is an {@link IPackageFragmentRoot}, a classpath entry corresponding
* to the element has changed position in the project's classpath.
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatus.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatus.java
index f337703..a367c01 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatus.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptModelStatus.java
@@ -66,16 +66,6 @@
*/
IPath getPath();
/**
- * Returns the string associated with the failure (see specification
- * of the status code), or <code>null</code> if no string is related to this
- * particular status code.
- *
- * @return the string culprit, or <code>null</code> if none
- * @see IJavaScriptModelStatusConstants
- * @deprecated Use {@link IStatus#getMessage()} instead
- */
-String getString();
-/**
* Returns whether this status indicates that a Java model element does not exist.
* This convenience method is equivalent to
* <code>getCode() == IJavaScriptModelStatusConstants.ELEMENT_DOES_NOT_EXIST</code>.
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptProject.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptProject.java
index f95183a..ed93b48 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptProject.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptProject.java
@@ -477,26 +477,6 @@
IPackageFragmentRoot[] getPackageFragmentRoots() throws JavaScriptModelException;
/**
- * Returns the existing package fragment roots identified by the given entry.
- * Note that a classpath entry that refers to another project may
- * have more than one root (if that project has more than on root
- * containing source), and classpath entries within the current
- * project identify a single root.
- * <p>
- * If the classpath entry denotes a variable, it will be resolved and return
- * the roots of the target entry (empty if not resolvable).
- * <p>
- * If the classpath entry denotes a container, it will be resolved and return
- * the roots corresponding to the set of container entries (empty if not resolvable).
- *
- * @param entry the given entry
- * @return the existing package fragment roots identified by the given entry
- * @see IJsGlobalScopeContainer
- * @deprecated Use {@link IJavaScriptProject#findPackageFragmentRoots(IIncludePathEntry)} instead
- */
- IPackageFragmentRoot[] getPackageFragmentRoots(IIncludePathEntry entry);
-
- /**
* Returns all package fragments in all package fragment roots contained
* in this project. This is a convenience method.
*
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptUnit.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptUnit.java
index b7da2fa..62cf37e 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptUnit.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IJavaScriptUnit.java
@@ -728,10 +728,6 @@
* @since 3.0
*/
void restore() throws JavaScriptModelException;
-/**
- * @deprecated Use {@link #findFunctions(IFunction)} instead
- */
-IFunction[] findMethods(IFunction method);
IFunction[] findFunctions(IFunction method);
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragment.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragment.java
index 14de399..1d59863 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragment.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IPackageFragment.java
@@ -106,18 +106,6 @@
* @param name the given name
* @return the compilation unit with the specified name in this package
* @see JavaScriptConventions#validateCompilationUnitName(String name, String sourceLevel, String complianceLevel)
- * @deprecated Use {@link #getJavaScriptUnit(String)} instead
- */
- IJavaScriptUnit getCompilationUnit(String name);
- /**
- * Returns the compilation unit with the specified name
- * in this package (for example, <code>"Object.js"</code>).
- * The name has to be a valid compilation unit name.
- * This is a handle-only method. The compilation unit may or may not be present.
- *
- * @param name the given name
- * @return the compilation unit with the specified name in this package
- * @see JavaScriptConventions#validateCompilationUnitName(String name, String sourceLevel, String complianceLevel)
*/
IJavaScriptUnit getJavaScriptUnit(String name);
/**
@@ -131,20 +119,6 @@
* @exception JavaScriptModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
* @return all of the compilation units in this package fragment
- * @deprecated Use {@link #getJavaScriptUnits()} instead
- */
- IJavaScriptUnit[] getCompilationUnits() throws JavaScriptModelException;
- /**
- * Returns all of the compilation units in this package fragment.
- *
- * <p>Note: it is possible that a package fragment contains only
- * class files (in other words, its kind is <code>K_BINARY</code>), in which
- * case this method returns an empty collection.
- * </p>
- *
- * @exception JavaScriptModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
- * @return all of the compilation units in this package fragment
*/
IJavaScriptUnit[] getJavaScriptUnits() throws JavaScriptModelException;
/**
@@ -164,26 +138,6 @@
* exception occurs while accessing its corresponding resource.
* @return all of the compilation units in this package fragment
* @since 3.0
- * @deprecated Use {@link #getJavaScriptUnits(WorkingCopyOwner)} instead
- */
- IJavaScriptUnit[] getCompilationUnits(WorkingCopyOwner owner) throws JavaScriptModelException;
- /**
- * Returns all of the compilation units in this package fragment that are
- * in working copy mode and that have the given owner.
- * <p>
- * Only existing working copies are returned. So a compilation unit handle that has no
- * corresponding resource on disk will be included if and only if is in working copy mode.
- * </p>
- * <p>Note: it is possible that a package fragment contains only
- * class files (in other words, its kind is <code>K_BINARY</code>), in which
- * case this method returns an empty collection.
- * </p>
- *
- * @param owner the owner of the returned compilation units
- * @exception JavaScriptModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
- * @return all of the compilation units in this package fragment
- * @since 3.0
*/
IJavaScriptUnit[] getJavaScriptUnits(WorkingCopyOwner owner) throws JavaScriptModelException;
/**
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IType.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IType.java
index 0d4a253..02009a8 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IType.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/IType.java
@@ -64,89 +64,6 @@
* @param requestor the completion requestor
* @exception JavaScriptModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
- * @since 2.0
- * @deprecated Use {@link #codeComplete(char[],int,int,char[][],char[][],int[],boolean,CompletionRequestor)} instead.
- */
- void codeComplete(
- char[] snippet,
- int insertion,
- int position,
- char[][] localVariableTypeNames,
- char[][] localVariableNames,
- int[] localVariableModifiers,
- boolean isStatic,
- ICompletionRequestor requestor)
- throws JavaScriptModelException;
-
- /**
- * Do code completion inside a code snippet in the context of the current type.
- * It considers types in the working copies with the given owner first. In other words,
- * the owner's working copies will take precedence over their original compilation units
- * in the workspace.
- * <p>
- * Note that if a working copy is empty, it will be as if the original compilation
- * unit had been deleted.
- * </p><p>
- * If the type can access to his source code and the insertion position is valid,
- * then completion is performed against source. Otherwise the completion is performed
- * against type structure and given locals variables.
- * </p>
- *
- * @param snippet the code snippet
- * @param insertion the position with in source where the snippet
- * is inserted. This position must not be in comments.
- * A possible value is -1, if the position is not known.
- * @param position the position with in snippet where the user
- * is performing code assist.
- * @param localVariableTypeNames an array (possibly empty) of fully qualified
- * type names of local variables visible at the current scope
- * @param localVariableNames an array (possibly empty) of local variable names
- * that are visible at the current scope
- * @param localVariableModifiers an array (possible empty) of modifiers for
- * local variables
- * @param isStatic whether the current scope is in a static context
- * @param requestor the completion requestor
- * @param owner the owner of working copies that take precedence over their original compilation units
- * @exception JavaScriptModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
- * @since 3.0
- * @deprecated Use {@link #codeComplete(char[],int,int,char[][],char[][],int[],boolean,CompletionRequestor,WorkingCopyOwner)} instead.
- */
- void codeComplete(
- char[] snippet,
- int insertion,
- int position,
- char[][] localVariableTypeNames,
- char[][] localVariableNames,
- int[] localVariableModifiers,
- boolean isStatic,
- ICompletionRequestor requestor,
- WorkingCopyOwner owner)
- throws JavaScriptModelException;
-
- /**
- * Do code completion inside a code snippet in the context of the current type.
- *
- * If the type can access to his source code and the insertion position is valid,
- * then completion is performed against source. Otherwise the completion is performed
- * against type structure and given locals variables.
- *
- * @param snippet the code snippet
- * @param insertion the position with in source where the snippet
- * is inserted. This position must not be in comments.
- * A possible value is -1, if the position is not known.
- * @param position the position within snippet where the user
- * is performing code assist.
- * @param localVariableTypeNames an array (possibly empty) of fully qualified
- * type names of local variables visible at the current scope
- * @param localVariableNames an array (possibly empty) of local variable names
- * that are visible at the current scope
- * @param localVariableModifiers an array (possible empty) of modifiers for
- * local variables
- * @param isStatic whether the current scope is in a static context
- * @param requestor the completion requestor
- * @exception JavaScriptModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
* @since 3.1
*/
void codeComplete(
@@ -467,25 +384,6 @@
* @param name the given name
* @param parameterTypeSignatures the given parameter types
* @return the method with the specified name and parameter types in this type
- * @deprecated Use {@link #getFunction(String,String[])} instead
- */
- IFunction getMethod(String name, String[] parameterTypeSignatures);
-
- /**
- * Returns the method with the specified name and parameter types
- * in this type (for example, <code>"foo", {"I", "QString;"}</code>).
- * To get the handle for a constructor, the name specified must be the
- * simple name of the enclosing type.
- * This is a handle-only method. The method may or may not be present.
- * <p>
- * The type signatures may be either unresolved (for source types)
- * or resolved (for binary types), and either basic (for basic types)
- * or rich (for parameterized types). See {@link Signature} for details.
- * </p>
- *
- * @param name the given name
- * @param parameterTypeSignatures the given parameter types
- * @return the method with the specified name and parameter types in this type
*/
IFunction getFunction(String name, String[] parameterTypeSignatures);
@@ -861,27 +759,6 @@
/**
* Creates and returns a type hierarchy for this type containing
- * this type and all of its supertypes, considering types in the given
- * working copies. In other words, the list of working copies will take
- * precedence over their original compilation units in the workspace.
- * <p>
- * Note that passing an empty working copy will be as if the original compilation
- * unit had been deleted.
- * </p>
- *
- * @param workingCopies the working copies that take precedence over their original compilation units
- * @param monitor the given progress monitor
- * @return a type hierarchy for this type containing this type and all of its supertypes
- * @exception JavaScriptModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
- * @since 2.0
- * @deprecated Use {@link #newSupertypeHierarchy(IJavaScriptUnit[], IProgressMonitor)} instead
- */
- ITypeHierarchy newSupertypeHierarchy(IWorkingCopy[] workingCopies, IProgressMonitor monitor)
- throws JavaScriptModelException;
-
- /**
- * Creates and returns a type hierarchy for this type containing
* this type and all of its supertypes, considering types in the
* working copies with the given owner.
* In other words, the owner's working copies will take
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptConventions.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptConventions.java
index 1346a40..f32c647 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptConventions.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptConventions.java
@@ -23,9 +23,8 @@
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.wst.jsdt.internal.compiler.parser.Scanner;
-import org.eclipse.wst.jsdt.internal.compiler.parser.ScannerHelper;
+import org.eclipse.wst.jsdt.internal.compiler.parser.ScannerHelper;
import org.eclipse.wst.jsdt.internal.compiler.parser.TerminalTokens;
-import org.eclipse.wst.jsdt.internal.compiler.util.SuffixConstants;
import org.eclipse.wst.jsdt.internal.core.ClasspathEntry;
import org.eclipse.wst.jsdt.internal.core.JavaModelStatus;
import org.eclipse.wst.jsdt.internal.core.util.Messages;
@@ -52,33 +51,6 @@
// Not instantiable
}
- /**
- * Returns whether the given package fragment root paths are considered
- * to overlap.
- * <p>
- * Two root paths overlap if one is a prefix of the other, or they point to
- * the same location. However, a JAR is allowed to be nested in a root.
- *
- * @param rootPath1 the first root path
- * @param rootPath2 the second root path
- * @return true if the given package fragment root paths are considered to overlap, false otherwise
- * @deprecated Overlapping roots are allowed in 2.1
- */
- public static boolean isOverlappingRoots(IPath rootPath1, IPath rootPath2) {
- if (rootPath1 == null || rootPath2 == null) {
- return false;
- }
- String extension1 = rootPath1.getFileExtension();
- String extension2 = rootPath2.getFileExtension();
- if (extension1 != null && (extension1.equalsIgnoreCase(SuffixConstants.EXTENSION_JAR) || extension1.equalsIgnoreCase(SuffixConstants.EXTENSION_ZIP))) {
- return false;
- }
- if (extension2 != null && (extension2.equalsIgnoreCase(SuffixConstants.EXTENSION_JAR) || extension2.equalsIgnoreCase(SuffixConstants.EXTENSION_ZIP))) {
- return false;
- }
- return rootPath1.isPrefixOf(rootPath2) || rootPath2.isPrefixOf(rootPath1);
- }
-
/*
* Returns the current identifier extracted by the scanner (without unicode
* escapes) from the given id and for the given source and compliance levels.
@@ -186,29 +158,6 @@
}
/**
- * Validate the given .class file name.
- * <p>
- * A .class file name must obey the following rules:
- * <ul>
- * <li> it must not be null
- * <li> it must include the <code>".class"</code> suffix
- * <li> its prefix must be a valid identifier
- * <li> it must not contain any characters or substrings that are not valid
- * on the file system on which workspace root is located.
- * </ul>
- * </p>
- * @param name the name of a .class file
- * @return a status object with code <code>IStatus.OK</code> if
- * the given name is valid as a .class file name, otherwise a status
- * object indicating what is wrong with the name
- * @since 2.0
- * @deprecated Use {@link #validateClassFileName(String id, String sourceLevel, String complianceLevel)} instead
- */
- public static IStatus validateClassFileName(String name) {
- return validateClassFileName(name, CompilerOptions.VERSION_1_3, CompilerOptions.VERSION_1_3);
- }
-
- /**
* Validate the given .class file name for the given source and compliance levels.
* <p>
* A .class file name must obey the following rules:
@@ -332,23 +281,6 @@
}
/**
- * Validate the given import declaration name.
- * <p>
- * The name of an import corresponds to a fully qualified type name
- * or an on-demand package name as defined by ImportDeclaration (JLS2 7.5).
- * For example, <code>"java.util.*"</code> or <code>"java.util.Hashtable"</code>.
- *
- * @param name the import declaration
- * @return a status object with code <code>IStatus.OK</code> if
- * the given name is valid as an import declaration, otherwise a status
- * object indicating what is wrong with the name
- * @deprecated Use {@link #validateImportDeclaration(String id, String sourceLevel, String complianceLevel)} instead
- */
- public static IStatus validateImportDeclaration(String name) {
- return validateImportDeclaration(name,CompilerOptions.VERSION_1_3,CompilerOptions.VERSION_1_3);
- }
-
- /**
* Validate the given import declaration name for the given source and compliance levels.
* <p>
* The name of an import corresponds to a fully qualified type name
@@ -464,24 +396,6 @@
* the given name is valid as a method name, otherwise a status
* object indicating what is wrong with the name
* @deprecated Use {@link #validateFunctionName(String id, String sourceLevel, String complianceLevel)} instead
- * @deprecated Use {@link #validateFunctionName(String)} instead
- */
- public static IStatus validateMethodName(String name) {
- return validateFunctionName(name);
- }
-
- /**
- * Validate the given method name.
- * The special names "<init>" and "<clinit>" are not valid.
- * <p>
- * The syntax for a method name is defined by Identifier
- * of MethodDeclarator (JLS2 8.4). For example "println".
- *
- * @param name the name of a method
- * @return a status object with code <code>IStatus.OK</code> if
- * the given name is valid as a method name, otherwise a status
- * object indicating what is wrong with the name
- * @deprecated Use {@link #validateFunctionName(String id, String sourceLevel, String complianceLevel)} instead
*/
public static IStatus validateFunctionName(String name) {
return validateFunctionName(name, CompilerOptions.VERSION_1_3,CompilerOptions.VERSION_1_3);
@@ -501,26 +415,6 @@
* the given name is valid as a method name, otherwise a status
* object indicating what is wrong with the name
* @since 3.3
- * @deprecated Use {@link #validateFunctionName(String,String,String)} instead
- */
- public static IStatus validateMethodName(String name, String sourceLevel, String complianceLevel) {
- return validateFunctionName(name, sourceLevel, complianceLevel);
- }
-
- /**
- * Validate the given method name for the given source and compliance levels.
- * The special names "<init>" and "<clinit>" are not valid.
- * <p>
- * The syntax for a method name is defined by Identifier
- * of MethodDeclarator (JLS2 8.4). For example "println".
- *
- * @param name the name of a method
- * @param sourceLevel the source level
- * @param complianceLevel the compliance level
- * @return a status object with code <code>IStatus.OK</code> if
- * the given name is valid as a method name, otherwise a status
- * object indicating what is wrong with the name
- * @since 3.3
*/
public static IStatus validateFunctionName(String name, String sourceLevel, String complianceLevel) {
return validateIdentifier(name, sourceLevel,complianceLevel);
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptCore.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptCore.java
index ae03909..6fb98f4 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptCore.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptCore.java
@@ -111,8 +111,6 @@
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.wst.jsdt.internal.compiler.util.SuffixConstants;
import org.eclipse.wst.jsdt.internal.core.BatchOperation;
-import org.eclipse.wst.jsdt.internal.core.BufferFactoryWrapper;
-import org.eclipse.wst.jsdt.internal.core.BufferManager;
import org.eclipse.wst.jsdt.internal.core.ClasspathAccessRule;
import org.eclipse.wst.jsdt.internal.core.ClasspathAttribute;
import org.eclipse.wst.jsdt.internal.core.ClasspathEntry;
@@ -838,84 +836,6 @@
* Possible configurable option ID.
* @see #getDefaultOptions()
* @since 2.0
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION},
- * {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_BLOCK} ,
- * {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION},
- * {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION},
- * {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_SWITCH},
- * {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION} instead
- */
- public static final String FORMATTER_NEWLINE_OPENING_BRACE = PLUGIN_ID + ".formatter.newline.openingBrace"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 2.0
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT},
- * {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT},
- * {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT},
- * {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT} instead.
- */
- public static final String FORMATTER_NEWLINE_CONTROL = PLUGIN_ID + ".formatter.newline.controlStatement"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 2.0
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMPACT_ELSE_IF} instead
- */
- public static final String FORMATTER_NEWLINE_ELSE_IF = PLUGIN_ID + ".formatter.newline.elseIf"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 2.0
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK} instead
- */
- public static final String FORMATTER_NEWLINE_EMPTY_BLOCK = PLUGIN_ID + ".formatter.newline.emptyBlock"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 2.0
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE} instead
- */
- public static final String FORMATTER_CLEAR_BLANK_LINES = PLUGIN_ID + ".formatter.newline.clearAll"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 2.0
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_LINE_SPLIT} instead
- */
- public static final String FORMATTER_LINE_SPLIT = PLUGIN_ID + ".formatter.lineSplit"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 2.0
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR} instead
- */
- public static final String FORMATTER_COMPACT_ASSIGNMENT = PLUGIN_ID + ".formatter.style.assignment"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 2.0
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_TAB_CHAR}} instead
- */
- public static final String FORMATTER_TAB_CHAR = PLUGIN_ID + ".formatter.tabulation.char"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 2.0
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_TAB_SIZE} instead
- */
- public static final String FORMATTER_TAB_SIZE = PLUGIN_ID + ".formatter.tabulation.size"; //$NON-NLS-1$
- /**
- * Possible configurable option ID
- * @see #getDefaultOptions()
- * @since 2.1
- * @deprecated Use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST} instead
- */
- public static final String FORMATTER_SPACE_CASTEXPRESSION = PLUGIN_ID + ".formatter.space.castexpression"; //$NON-NLS-1$
- /**
- * Possible configurable option ID.
- * @see #getDefaultOptions()
- * @since 2.0
*/
public static final String CODEASSIST_VISIBILITY_CHECK = PLUGIN_ID + ".codeComplete.visibilityCheck"; //$NON-NLS-1$
/**
@@ -1269,21 +1189,6 @@
* @param attributes the mutable marker attribute map (key type: <code>String</code>,
* value type: <code>String</code>)
* @param element the Java element for which the marker needs to be configured
- * @deprecated Use {@link #addJavaScriptElementMarkerAttributes(Map,IJavaScriptElement)} instead
- */
- public static void addJavaElementMarkerAttributes(
- Map attributes,
- IJavaScriptElement element) {
- addJavaScriptElementMarkerAttributes(attributes, element);
- }
-
- /**
- * Configures the given marker attribute map for the given Java element.
- * Used for markers, which denote a Java element rather than a resource.
- *
- * @param attributes the mutable marker attribute map (key type: <code>String</code>,
- * value type: <code>String</code>)
- * @param element the Java element for which the marker needs to be configured
*/
public static void addJavaScriptElementMarkerAttributes(
Map attributes,
@@ -1294,17 +1199,6 @@
attributes.put(ATT_HANDLE_ID, element.getHandleIdentifier());
}
- /**
- * @deprecated Use {@link #addNonJavaScriptResources(Object[],IContainer,int,ArrayList)} instead
- */
- private static void addNonJavaResources(Object[] nonJavaResources,
- IContainer container,
- int rootPathSegmentCounts,
- ArrayList collector) {
- addNonJavaScriptResources(nonJavaResources, container,
- rootPathSegmentCounts, collector);
- }
-
private static void addNonJavaScriptResources(Object[] nonJavaResources,
IContainer container,
int rootPathSegmentCounts,
@@ -1335,23 +1229,6 @@
/**
- * Adds the given listener for POST_CHANGE resource change events to the Java core.
- * The listener is guaranteed to be notified of the POST_CHANGE resource change event before
- * the Java core starts processing the resource change event itself.
- * <p>
- * Has no effect if an identical listener is already registered.
- * </p>
- *
- * @param listener the listener
- * @see #removePreProcessingResourceChangedListener(IResourceChangeListener)
- * @since 3.0
- * @deprecated use addPreProcessingResourceChangedListener(listener, IResourceChangeEvent.POST_CHANGE) instead
- */
- public static void addPreProcessingResourceChangedListener(IResourceChangeListener listener) {
- addPreProcessingResourceChangedListener(listener, IResourceChangeEvent.POST_CHANGE);
- }
-
- /**
* Adds the given listener for resource change events of the given types to the Java core.
* The listener is guaranteed to be notified of the resource change event before
* the Java core starts processing the resource change event itself.
@@ -1743,45 +1620,6 @@
* @param variableName the name of the classpath variable
* @return the path, or <code>null</code> if none
* @see #setIncludepathVariable(String, IPath)
- * @deprecated Use {@link #getIncludepathVariable(String)} instead
- */
- public static IPath getClasspathVariable(final String variableName) {
- return getIncludepathVariable(variableName);
- }
-
- /**
- * Returns the path held in the given classpath variable.
- * Returns <code>null</code> if unable to bind.
- * <p>
- * Classpath variable values are persisted locally to the workspace, and
- * are preserved from session to session.
- * <p>
- * Note that classpath variables can be contributed registered initializers for,
- * using the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer".
- * If an initializer is registered for a variable, its persisted value will be ignored:
- * its initializer will thus get the opportunity to rebind the variable differently on
- * each session.
- *
- * @param variableName the name of the classpath variable
- * @return the path, or <code>null</code> if none
- * @see #setClasspathVariable(String, IPath)
- */
- /**
- * Returns the path held in the given classpath variable.
- * Returns <code>null</code> if unable to bind.
- * <p>
- * Classpath variable values are persisted locally to the workspace, and
- * are preserved from session to session.
- * <p>
- * Note that classpath variables can be contributed registered initializers for,
- * using the extension point "org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer".
- * If an initializer is registered for a variable, its persisted value will be ignored:
- * its initializer will thus get the opportunity to rebind the variable differently on
- * each session.
- *
- * @param variableName the name of the classpath variable
- * @return the path, or <code>null</code> if none
- * @see #setIncludepathVariable(String, IPath)
*/
public static IPath getIncludepathVariable(final String variableName) {
@@ -1869,18 +1707,6 @@
* @param variableName
* @return A string if the classpath variable is deprecated, <code>null</code> otherwise.
* @since 3.3
- * @deprecated Use {@link #getIncludepathVariableDeprecationMessage(String)} instead
- */
- public static String getClasspathVariableDeprecationMessage(String variableName) {
- return getIncludepathVariableDeprecationMessage(variableName);
- }
-
- /**
- * Returns deprecation message of a given classpath variable.
- *
- * @param variableName
- * @return A string if the classpath variable is deprecated, <code>null</code> otherwise.
- * @since 3.3
*/
public static String getIncludepathVariableDeprecationMessage(String variableName) {
return (String) JavaModelManager.getJavaModelManager().deprecatedVariables.get(variableName);
@@ -1964,21 +1790,6 @@
*
* @return the list of classpath variable names
* @see #setIncludepathVariable(String, IPath)
- * @deprecated Use {@link #getIncludepathVariableNames()} instead
- */
- public static String[] getClasspathVariableNames() {
- return getIncludepathVariableNames();
- }
-
- /**
- * Returns the names of all known classpath variables.
- * <p>
- * Classpath variable values are persisted locally to the workspace, and
- * are preserved from session to session.
- * <p>
- *
- * @return the list of classpath variable names
- * @see #setIncludepathVariable(String, IPath)
*/
public static String[] getIncludepathVariableNames() {
return JavaModelManager.getJavaModelManager().variableNames();
@@ -3312,24 +3123,6 @@
}
/**
- * Answers the shared working copies currently registered for this buffer factory.
- * Working copies can be shared by several clients using the same buffer factory,see
- * <code>IWorkingCopy.getSharedWorkingCopy</code>.
- *
- * @param factory the given buffer factory
- * @return the list of shared working copies for a given buffer factory
- * @since 2.0
- * @deprecated Use {@link #getWorkingCopies(WorkingCopyOwner)} instead
- */
- public static IWorkingCopy[] getSharedWorkingCopies(IBufferFactory factory){
-
- // if factory is null, default factory must be used
- if (factory == null) factory = BufferManager.getDefaultBufferManager().getDefaultBufferFactory();
-
- return getWorkingCopies(BufferFactoryWrapper.create(factory));
- }
-
- /**
* Returns the names of all defined user libraries. The corresponding classpath container path
* is the name appended to the USER_LIBRARY_CONTAINER_ID.
* @return Return an array containing the names of all known user defined.
@@ -4474,25 +4267,6 @@
* <p>
*
* @param variableName the name of the classpath variable
- * @see #setIncludepathVariable(String, IPath)
- *
- * @deprecated Use {@link #removeIncludepathVariable(String, IProgressMonitor)} instead
- */
- public static void removeIncludepathVariable(String variableName) {
- removeIncludepathVariable(variableName, null);
- }
-
- /**
- * Removed the given classpath variable. Does nothing if no value was
- * set for this classpath variable.
- * <p>
- * This functionality cannot be used while the resource tree is locked.
- * <p>
- * Classpath variable values are persisted locally to the workspace, and
- * are preserved from session to session.
- * <p>
- *
- * @param variableName the name of the classpath variable
* @param monitor the progress monitor to report progress
* @see #setIncludepathVariable(String, IPath)
*/
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ToolFactory.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ToolFactory.java
index 9139443..c2cc4ae 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ToolFactory.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/ToolFactory.java
@@ -13,17 +13,11 @@
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Plugin;
import org.eclipse.wst.jsdt.core.compiler.IScanner;
import org.eclipse.wst.jsdt.core.formatter.CodeFormatter;
import org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
import org.eclipse.wst.jsdt.internal.core.util.PublicScanner;
import org.eclipse.wst.jsdt.internal.formatter.DefaultCodeFormatter;
@@ -69,43 +63,6 @@
public static final int M_FORMAT_EXISTING = new Integer(1).intValue();
/**
- * Create an instance of a code formatter. A code formatter implementation can be contributed via the
- * extension point "org.eclipse.wst.jsdt.core.codeFormatter". If unable to find a registered extension, the factory
- * will default to using the default code formatter.
- *
- * @return an instance of a code formatter
- * @see ICodeFormatter
- * @see ToolFactory#createDefaultCodeFormatter(Map)
- * @deprecated Use {@link #createCodeFormatter(Map)} instead. Extension point is discontinued
- */
- public static ICodeFormatter createCodeFormatter(){
-
- Plugin jdtCorePlugin = JavaScriptCore.getPlugin();
- if (jdtCorePlugin == null) return null;
-
- IExtensionPoint extension = jdtCorePlugin.getDescriptor().getExtensionPoint(JavaModelManager.FORMATTER_EXTPOINT_ID);
- if (extension != null) {
- IExtension[] extensions = extension.getExtensions();
- for(int i = 0; i < extensions.length; i++){
- IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
- for(int j = 0; j < configElements.length; j++){
- try {
- Object execExt = configElements[j].createExecutableExtension("class"); //$NON-NLS-1$
- if (execExt instanceof ICodeFormatter){
- // use first contribution found
- return (ICodeFormatter)execExt;
- }
- } catch(CoreException e){
- // unable to instantiate extension, will answer default formatter instead
- }
- }
- }
- }
- // no proper contribution found, use default formatter
- return createDefaultCodeFormatter(null);
- }
-
- /**
* Create an instance of the built-in code formatter.
* <p>The given options should at least provide the source level ({@link JavaScriptCore#COMPILER_SOURCE}),
* the compiler compliance level ({@link JavaScriptCore#COMPILER_COMPLIANCE}) and the target platform
@@ -164,25 +121,6 @@
/**
- * Create an instance of the built-in code formatter. A code formatter implementation can be contributed via the
- * extension point "org.eclipse.wst.jsdt.core.codeFormatter". If unable to find a registered extension, the factory will
- * default to using the default code formatter.
- *
- * @param options - the options map to use for formatting with the default code formatter. Recognized options
- * are documented on <code>JavaScriptCore#getDefaultOptions()</code>. If set to <code>null</code>, then use
- * the current settings from <code>JavaScriptCore#getOptions</code>.
- * @return an instance of the built-in code formatter
- * @see ICodeFormatter
- * @see ToolFactory#createCodeFormatter()
- * @see JavaScriptCore#getOptions()
- * @deprecated Use {@link #createCodeFormatter(Map)} instead
- */
- public static ICodeFormatter createDefaultCodeFormatter(Map options){
- if (options == null) options = JavaScriptCore.getOptions();
- return new org.eclipse.wst.jsdt.internal.formatter.old.CodeFormatter(options);
- }
-
- /**
* Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be
* used to tokenize some source in a Java aware way.
* Here is a typical scanning loop:
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IProblem.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IProblem.java
index 4c7d225..4135f66 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IProblem.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IProblem.java
@@ -305,8 +305,6 @@
int UndefinedName = Internal + FieldRelated + 50;
int UninitializedLocalVariable = Internal + 51;
int VariableTypeCannotBeVoid = Internal + 52;
- /** @deprecated - problem is no longer generated, use {@link #CannotAllocateVoidArray} instead */
- int VariableTypeCannotBeVoidArray = Internal + 53;
int CannotAllocateVoidArray = Internal + 54;
// local variables
int RedefinedLocal = Internal + 55;
@@ -472,9 +470,6 @@
int SuperfluousSemicolon = Internal + 180;
/** @since 3.0 */
int UnnecessaryCast = Internal + TypeRelated + 181;
- /** @deprecated - no longer generated, use {@link #UnnecessaryCast} instead
- * @since 3.0 */
- int UnnecessaryArgumentCast = Internal + TypeRelated + 182;
/** @since 3.0 */
int UnnecessaryInstanceof = Internal + TypeRelated + 183;
/** @since 3.0 */
@@ -626,28 +621,6 @@
/** @since 3.1 */
int ObjectMustBeClass = Internal + 330;
- /** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
- int SuperclassNotFound = TypeRelated + 329 + ProblemReasons.NotFound; // TypeRelated + 330
- /** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
- int SuperclassNotVisible = TypeRelated + 329 + ProblemReasons.NotVisible; // TypeRelated + 331
- /** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
- int SuperclassAmbiguous = TypeRelated + 329 + ProblemReasons.Ambiguous; // TypeRelated + 332
- /** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
- int SuperclassInternalNameProvided = TypeRelated + 329 + ProblemReasons.InternalNameProvided; // TypeRelated + 333
- /** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
- int SuperclassInheritedNameHidesEnclosingName = TypeRelated + 329 + ProblemReasons.InheritedNameHidesEnclosingName; // TypeRelated + 334
-
- /** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
- int InterfaceNotFound = TypeRelated + 334 + ProblemReasons.NotFound; // TypeRelated + 335
- /** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
- int InterfaceNotVisible = TypeRelated + 334 + ProblemReasons.NotVisible; // TypeRelated + 336
- /** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
- int InterfaceAmbiguous = TypeRelated + 334 + ProblemReasons.Ambiguous; // TypeRelated + 337
- /** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
- int InterfaceInternalNameProvided = TypeRelated + 334 + ProblemReasons.InternalNameProvided; // TypeRelated + 338
- /** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
- int InterfaceInheritedNameHidesEnclosingName = TypeRelated + 334 + ProblemReasons.InheritedNameHidesEnclosingName; // TypeRelated + 339
-
// field related problems
int DuplicateField = FieldRelated + 340;
int DuplicateModifierForField = FieldRelated + 341;
@@ -657,17 +630,6 @@
int IllegalModifierCombinationFinalVolatileForField = FieldRelated + 345;
int UnexpectedStaticModifierForField = FieldRelated + 346;
- /** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
- int FieldTypeNotFound = FieldRelated + 349 + ProblemReasons.NotFound; // FieldRelated + 350
- /** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
- int FieldTypeNotVisible = FieldRelated + 349 + ProblemReasons.NotVisible; // FieldRelated + 351
- /** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
- int FieldTypeAmbiguous = FieldRelated + 349 + ProblemReasons.Ambiguous; // FieldRelated + 352
- /** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
- int FieldTypeInternalNameProvided = FieldRelated + 349 + ProblemReasons.InternalNameProvided; // FieldRelated + 353
- /** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
- int FieldTypeInheritedNameHidesEnclosingName = FieldRelated + 349 + ProblemReasons.InheritedNameHidesEnclosingName; // FieldRelated + 354
-
// method related problems
int DuplicateMethod = MethodRelated + 355;
int IllegalModifierForArgument = MethodRelated + 356;
@@ -679,46 +641,9 @@
int IllegalAbstractModifierCombinationForMethod = MethodRelated + 362;
int AbstractMethodInAbstractClass = MethodRelated + 363;
int ArgumentTypeCannotBeVoid = MethodRelated + 364;
- /** @deprecated - problem is no longer generated, use {@link #CannotAllocateVoidArray} instead */
- int ArgumentTypeCannotBeVoidArray = MethodRelated + 365;
- /** @deprecated - problem is no longer generated, use {@link #CannotAllocateVoidArray} instead */
- int ReturnTypeCannotBeVoidArray = MethodRelated + 366;
int NativeMethodsCannotBeStrictfp = MethodRelated + 367;
int DuplicateModifierForArgument = MethodRelated + 368;
- /** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
- int ArgumentTypeNotFound = MethodRelated + 369 + ProblemReasons.NotFound; // MethodRelated + 370
- /** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
- int ArgumentTypeNotVisible = MethodRelated + 369 + ProblemReasons.NotVisible; // MethodRelated + 371
- /** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
- int ArgumentTypeAmbiguous = MethodRelated + 369 + ProblemReasons.Ambiguous; // MethodRelated + 372
- /** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
- int ArgumentTypeInternalNameProvided = MethodRelated + 369 + ProblemReasons.InternalNameProvided; // MethodRelated + 373
- /** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
- int ArgumentTypeInheritedNameHidesEnclosingName = MethodRelated + 369 + ProblemReasons.InheritedNameHidesEnclosingName; // MethodRelated + 374
-
- /** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
- int ExceptionTypeNotFound = MethodRelated + 374 + ProblemReasons.NotFound; // MethodRelated + 375
- /** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
- int ExceptionTypeNotVisible = MethodRelated + 374 + ProblemReasons.NotVisible; // MethodRelated + 376
- /** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
- int ExceptionTypeAmbiguous = MethodRelated + 374 + ProblemReasons.Ambiguous; // MethodRelated + 377
- /** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
- int ExceptionTypeInternalNameProvided = MethodRelated + 374 + ProblemReasons.InternalNameProvided; // MethodRelated + 378
- /** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
- int ExceptionTypeInheritedNameHidesEnclosingName = MethodRelated + 374 + ProblemReasons.InheritedNameHidesEnclosingName; // MethodRelated + 379
-
- /** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
- int ReturnTypeNotFound = MethodRelated + 379 + ProblemReasons.NotFound; // MethodRelated + 380
- /** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
- int ReturnTypeNotVisible = MethodRelated + 379 + ProblemReasons.NotVisible; // MethodRelated + 381
- /** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
- int ReturnTypeAmbiguous = MethodRelated + 379 + ProblemReasons.Ambiguous; // MethodRelated + 382
- /** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
- int ReturnTypeInternalNameProvided = MethodRelated + 379 + ProblemReasons.InternalNameProvided; // MethodRelated + 383
- /** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
- int ReturnTypeInheritedNameHidesEnclosingName = MethodRelated + 379 + ProblemReasons.InheritedNameHidesEnclosingName; // MethodRelated + 384
-
// import related problems
int ConflictingImport = ImportRelated + 385;
int DuplicateImport = ImportRelated + 386;
@@ -726,28 +651,12 @@
int UnusedImport = ImportRelated + 388;
int ImportNotFound = ImportRelated + 389 + ProblemReasons.NotFound; // ImportRelated + 390
- /** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
- int ImportNotVisible = ImportRelated + 389 + ProblemReasons.NotVisible; // ImportRelated + 391
- /** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
- int ImportAmbiguous = ImportRelated + 389 + ProblemReasons.Ambiguous; // ImportRelated + 392
- /** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
- int ImportInternalNameProvided = ImportRelated + 389 + ProblemReasons.InternalNameProvided; // ImportRelated + 393
- /** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
- int ImportInheritedNameHidesEnclosingName = ImportRelated + 389 + ProblemReasons.InheritedNameHidesEnclosingName; // ImportRelated + 394
-
/** @since 3.1 */
int InvalidTypeForStaticImport = ImportRelated + 391;
// local variable related problems
int DuplicateModifierForVariable = MethodRelated + 395;
int IllegalModifierForVariable = MethodRelated + 396;
- /** @deprecated - problem is no longer generated, use {@link #RedundantNullCheckOnNonNullLocalVariable} instead */
- int LocalVariableCannotBeNull = Internal + 397; // since 3.3: semantics are LocalVariableRedundantCheckOnNonNull
- /** @deprecated - problem is no longer generated, use {@link #NullLocalVariableReference}, {@link #RedundantNullCheckOnNullLocalVariable} or {@link #RedundantLocalVariableNullAssignment} instead */
- int LocalVariableCanOnlyBeNull = Internal + 398; // since 3.3: split with LocalVariableRedundantCheckOnNull depending on context
- /** @deprecated - problem is no longer generated, use {@link #PotentialNullLocalVariableReference} instead */
- int LocalVariableMayBeNull = Internal + 399;
-
// method verifier problems
int AbstractMethodMustBeImplemented = MethodRelated + 400;
int FinalMethodCannotBeOverridden = MethodRelated + 401;
@@ -1142,9 +1051,6 @@
int AnnotationValueMustBeClassLiteral = Internal + 612;
/** @since 3.1 */
int AnnotationValueMustBeConstant = Internal + 613;
- /** @deprecated - problem is no longer generated (code is legite)
- * @since 3.1 */
- int AnnotationFieldNeedConstantInitialization = Internal + 614;
/** @since 3.1 */
int IllegalModifierForAnnotationField = Internal + 615;
/** @since 3.1 */
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java
index 313f0f2..2a3c080 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/AST.java
@@ -21,9 +21,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.text.IDocument;
import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.IClassFile;
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.wst.jsdt.internal.compiler.parser.Scanner;
@@ -743,287 +741,6 @@
}
/**
- * Parses the source string of the given Java model compilation unit element
- * and creates and returns a corresponding abstract syntax tree. The source
- * string is obtained from the Java model element using
- * <code>IJavaScriptUnit.getSource()</code>.
- * <p>
- * The returned compilation unit node is the root node of a new AST.
- * Each node in the subtree carries source range(s) information relating back
- * to positions in the source string (the source string is not remembered
- * with the AST).
- * The source range usually begins at the first character of the first token
- * corresponding to the node; leading whitespace and comments are <b>not</b>
- * included. The source range usually extends through the last character of
- * the last token corresponding to the node; trailing whitespace and
- * comments are <b>not</b> included. There are a handful of exceptions
- * (including compilation units and the various body declarations); the
- * specification for these node type spells out the details.
- * Source ranges nest properly: the source range for a child is always
- * within the source range of its parent, and the source ranges of sibling
- * nodes never overlap.
- * If a syntax error is detected while parsing, the relevant node(s) of the
- * tree will be flagged as <code>MALFORMED</code>.
- * </p>
- * <p>
- * If <code>resolveBindings</code> is <code>true</code>, the various names
- * and types appearing in the compilation unit can be resolved to "bindings"
- * by calling the <code>resolveBinding</code> methods. These bindings
- * draw connections between the different parts of a program, and
- * generally afford a more powerful vantage point for clients who wish to
- * analyze a program's structure more deeply. These bindings come at a
- * considerable cost in both time and space, however, and should not be
- * requested frivolously. The additional space is not reclaimed until the
- * AST, all its nodes, and all its bindings become garbage. So it is very
- * important to not retain any of these objects longer than absolutely
- * necessary. Bindings are resolved at the time the AST is created. Subsequent
- * modifications to the AST do not affect the bindings returned by
- * <code>resolveBinding</code> methods in any way; these methods return the
- * same binding as before the AST was modified (including modifications
- * that rearrange subtrees by reparenting nodes).
- * If <code>resolveBindings</code> is <code>false</code>, the analysis
- * does not go beyond parsing and building the tree, and all
- * <code>resolveBinding</code> methods return <code>null</code> from the
- * outset.
- * </p>
- *
- * @param unit the Java model compilation unit whose source code is to be parsed
- * @param resolveBindings <code>true</code> if bindings are wanted,
- * and <code>false</code> if bindings are not of interest
- * @return the compilation unit node
- * @exception IllegalArgumentException if the given Java element does not
- * exist or if its source string cannot be obtained
- * @see ASTNode#getFlags()
- * @see ASTNode#MALFORMED
- * @see ASTNode#getStartPosition()
- * @see ASTNode#getLength()
- * @since 2.0
- * @deprecated Use {@link ASTParser} instead.
- */
- public static JavaScriptUnit parseCompilationUnit(
- IJavaScriptUnit unit,
- boolean resolveBindings) {
-
- try {
- ASTParser c = ASTParser.newParser(AST.JLS2);
- c.setSource(unit);
- c.setResolveBindings(resolveBindings);
- ASTNode result = c.createAST(null);
- return (JavaScriptUnit) result;
- } catch (IllegalStateException e) {
- // convert ASTParser's complaints into old form
- throw new IllegalArgumentException();
- }
- }
-
- /**
- * Parses the source string corresponding to the given Java class file
- * element and creates and returns a corresponding abstract syntax tree.
- * The source string is obtained from the Java model element using
- * <code>IClassFile.getSource()</code>, and is only available for a class
- * files with attached source.
- * <p>
- * The returned compilation unit node is the root node of a new AST.
- * Each node in the subtree carries source range(s) information relating back
- * to positions in the source string (the source string is not remembered
- * with the AST).
- * The source range usually begins at the first character of the first token
- * corresponding to the node; leading whitespace and comments are <b>not</b>
- * included. The source range usually extends through the last character of
- * the last token corresponding to the node; trailing whitespace and
- * comments are <b>not</b> included. There are a handful of exceptions
- * (including compilation units and the various body declarations); the
- * specification for these node type spells out the details.
- * Source ranges nest properly: the source range for a child is always
- * within the source range of its parent, and the source ranges of sibling
- * nodes never overlap.
- * If a syntax error is detected while parsing, the relevant node(s) of the
- * tree will be flagged as <code>MALFORMED</code>.
- * </p>
- * <p>
- * If <code>resolveBindings</code> is <code>true</code>, the various names
- * and types appearing in the compilation unit can be resolved to "bindings"
- * by calling the <code>resolveBinding</code> methods. These bindings
- * draw connections between the different parts of a program, and
- * generally afford a more powerful vantage point for clients who wish to
- * analyze a program's structure more deeply. These bindings come at a
- * considerable cost in both time and space, however, and should not be
- * requested frivolously. The additional space is not reclaimed until the
- * AST, all its nodes, and all its bindings become garbage. So it is very
- * important to not retain any of these objects longer than absolutely
- * necessary. Bindings are resolved at the time the AST is created. Subsequent
- * modifications to the AST do not affect the bindings returned by
- * <code>resolveBinding</code> methods in any way; these methods return the
- * same binding as before the AST was modified (including modifications
- * that rearrange subtrees by reparenting nodes).
- * If <code>resolveBindings</code> is <code>false</code>, the analysis
- * does not go beyond parsing and building the tree, and all
- * <code>resolveBinding</code> methods return <code>null</code> from the
- * outset.
- * </p>
- *
- * @param classFile the Java model class file whose corresponding source code is to be parsed
- * @param resolveBindings <code>true</code> if bindings are wanted,
- * and <code>false</code> if bindings are not of interest
- * @return the compilation unit node
- * @exception IllegalArgumentException if the given Java element does not
- * exist or if its source string cannot be obtained
- * @see ASTNode#getFlags()
- * @see ASTNode#MALFORMED
- * @see ASTNode#getStartPosition()
- * @see ASTNode#getLength()
- * @since 2.1
- * @deprecated Use {@link ASTParser} instead.
- */
- public static JavaScriptUnit parseCompilationUnit(
- IClassFile classFile,
- boolean resolveBindings) {
-
- if (classFile == null) {
- throw new IllegalArgumentException();
- }
- try {
- ASTParser c = ASTParser.newParser(AST.JLS2);
- c.setSource(classFile);
- c.setResolveBindings(resolveBindings);
- ASTNode result = c.createAST(null);
- return (JavaScriptUnit) result;
- } catch (IllegalStateException e) {
- // convert ASTParser's complaints into old form
- throw new IllegalArgumentException();
- }
- }
-
- /**
- * Parses the given string as the hypothetical contents of the named
- * compilation unit and creates and returns a corresponding abstract syntax tree.
- * <p>
- * The returned compilation unit node is the root node of a new AST.
- * Each node in the subtree carries source range(s) information relating back
- * to positions in the given source string (the given source string itself
- * is not remembered with the AST).
- * The source range usually begins at the first character of the first token
- * corresponding to the node; leading whitespace and comments are <b>not</b>
- * included. The source range usually extends through the last character of
- * the last token corresponding to the node; trailing whitespace and
- * comments are <b>not</b> included. There are a handful of exceptions
- * (including compilation units and the various body declarations); the
- * specification for these node type spells out the details.
- * Source ranges nest properly: the source range for a child is always
- * within the source range of its parent, and the source ranges of sibling
- * nodes never overlap.
- * If a syntax error is detected while parsing, the relevant node(s) of the
- * tree will be flagged as <code>MALFORMED</code>.
- * </p>
- * <p>
- * If the given project is not <code>null</code>, the various names
- * and types appearing in the compilation unit can be resolved to "bindings"
- * by calling the <code>resolveBinding</code> methods. These bindings
- * draw connections between the different parts of a program, and
- * generally afford a more powerful vantage point for clients who wish to
- * analyze a program's structure more deeply. These bindings come at a
- * considerable cost in both time and space, however, and should not be
- * requested frivolously. The additional space is not reclaimed until the
- * AST, all its nodes, and all its bindings become garbage. So it is very
- * important to not retain any of these objects longer than absolutely
- * necessary. Bindings are resolved at the time the AST is created. Subsequent
- * modifications to the AST do not affect the bindings returned by
- * <code>resolveBinding</code> methods in any way; these methods return the
- * same binding as before the AST was modified (including modifications
- * that rearrange subtrees by reparenting nodes).
- * If the given project is <code>null</code>, the analysis
- * does not go beyond parsing and building the tree, and all
- * <code>resolveBinding</code> methods return <code>null</code> from the
- * outset.
- * </p>
- * <p>
- * The name of the compilation unit must be supplied for resolving bindings.
- * This name should be suffixed by a dot ('.') followed by one of the
- * {@link JavaScriptCore#getJavaScriptLikeExtensions() Java-like extensions}
- * and match the name of the main
- * (public) class or interface declared in the source. For example, if the source
- * declares a public class named "Foo", the name of the compilation can be
- * "Foo.js". For the purposes of resolving bindings, types declared in the
- * source string hide types by the same name available through the classpath
- * of the given project.
- * </p>
- *
- * @param source the string to be parsed as a Java compilation unit
- * @param unitName the name of the compilation unit that would contain the source
- * string, or <code>null</code> if <code>javaProject</code> is also <code>null</code>
- * @param project the Java project used to resolve names, or
- * <code>null</code> if bindings are not resolved
- * @return the compilation unit node
- * @see ASTNode#getFlags()
- * @see ASTNode#MALFORMED
- * @see ASTNode#getStartPosition()
- * @see ASTNode#getLength()
- * @since 2.0
- * @deprecated Use {@link ASTParser} instead.
- */
- public static JavaScriptUnit parseCompilationUnit(
- char[] source,
- String unitName,
- IJavaScriptProject project) {
-
- if (source == null) {
- throw new IllegalArgumentException();
- }
- ASTParser astParser = ASTParser.newParser(AST.JLS2);
- astParser.setSource(source);
- astParser.setUnitName(unitName);
- astParser.setProject(project);
- astParser.setResolveBindings(project != null);
- ASTNode result = astParser.createAST(null);
- return (JavaScriptUnit) result;
- }
-
- /**
- * Parses the given string as a Java compilation unit and creates and
- * returns a corresponding abstract syntax tree.
- * <p>
- * The returned compilation unit node is the root node of a new AST.
- * Each node in the subtree carries source range(s) information relating back
- * to positions in the given source string (the given source string itself
- * is not remembered with the AST).
- * The source range usually begins at the first character of the first token
- * corresponding to the node; leading whitespace and comments are <b>not</b>
- * included. The source range usually extends through the last character of
- * the last token corresponding to the node; trailing whitespace and
- * comments are <b>not</b> included. There are a handful of exceptions
- * (including compilation units and the various body declarations); the
- * specification for these node type spells out the details.
- * Source ranges nest properly: the source range for a child is always
- * within the source range of its parent, and the source ranges of sibling
- * nodes never overlap.
- * If a syntax error is detected while parsing, the relevant node(s) of the
- * tree will be flagged as <code>MALFORMED</code>.
- * </p>
- * <p>
- * This method does not compute binding information; all <code>resolveBinding</code>
- * methods applied to nodes of the resulting AST return <code>null</code>.
- * </p>
- *
- * @param source the string to be parsed as a Java compilation unit
- * @return the compilation unit node
- * @see ASTNode#getFlags()
- * @see ASTNode#MALFORMED
- * @see ASTNode#getStartPosition()
- * @see ASTNode#getLength()
- * @since 2.0
- * @deprecated Use {@link ASTParser} instead.
- */
- public static JavaScriptUnit parseCompilationUnit(char[] source) {
- if (source == null) {
- throw new IllegalArgumentException();
- }
- ASTParser c = ASTParser.newParser(AST.JLS2);
- c.setSource(source);
- ASTNode result = c.createAST(null);
- return (JavaScriptUnit) result;
- }
-
- /**
* Returns the binding resolver for this AST.
*
* @return the binding resolver for this AST
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnit.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnit.java
index 7e58ea1..2b83bff 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnit.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnit.java
@@ -747,33 +747,6 @@
* through the end of the source string and has no line delimiter.
* For example, the source string <code>class A\n{\n}</code> has 3 lines
* corresponding to inclusive character ranges [0,7], [8,9], and [10,10].
- * Returns 1 for a character position that does not correspond to any
- * source line, or if no line number information is available for this
- * compilation unit.
- *
- * @param position a 0-based character position, possibly
- * negative or out of range
- * @return the 1-based line number, or <code>1</code> if the character
- * position does not correspond to a source line in the original
- * source file or if line number information is not known for this
- * compilation unit
- * @deprecated Use getLineNumber(int) instead. Be careful to handle the negative values.
- * @see ASTParser
- * @see #getLineNumber(int)
- */
- public int lineNumber(int position) {
- int lineNumber = getLineNumber(position);
- return lineNumber < 1 ? 1 : lineNumber;
- }
-
- /**
- * Returns the line number corresponding to the given source character
- * position in the original source string. The initial line of the
- * compilation unit is numbered 1, and each line extends through the
- * last character of the end-of-line delimiter. The very last line extends
- * through the end of the source string and has no line delimiter.
- * For example, the source string <code>class A\n{\n}</code> has 3 lines
- * corresponding to inclusive character ranges [0,7], [8,9], and [10,10].
* Returns -1 for a character position that does not correspond to any
* source line, or -2 if no line number information is available for this
* compilation unit.
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/eval/IEvaluationContext.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/eval/IEvaluationContext.java
index ef00108..dda861a 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/eval/IEvaluationContext.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/eval/IEvaluationContext.java
@@ -441,29 +441,4 @@
public void validateImports(ICodeSnippetRequestor requestor)
throws JavaScriptModelException;
- /**
- * Performs a code completion at the given position in the given code snippet,
- * reporting results to the given completion requestor.
- * <p>
- * Note that code completion does not involve evaluation.
- * <p>
- *
- * @param codeSnippet the code snippet to complete in
- * @param position the character position in the code snippet to complete at,
- * or -1 indicating the beginning of the snippet
- * @param requestor the code completion requestor capable of accepting all
- * possible types of completions
- * @exception JavaScriptModelException if code completion could not be performed. Reasons include:
- * <ul>
- * <li>The position specified is less than -1 or is greater than the snippet's
- * length (INDEX_OUT_OF_BOUNDS)</li>
- * </ul>
- * @deprecated - use codeComplete(String, int, ICompletionRequestor) instead
- */
- public void codeComplete(
- String codeSnippet,
- int position,
- org.eclipse.wst.jsdt.core.ICodeCompletionRequestor requestor)
- throws JavaScriptModelException;
-
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchConstants.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchConstants.java
index 8427867..cf81600 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchConstants.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchConstants.java
@@ -190,44 +190,6 @@
/* Syntactic match modes */
/**
- * The search pattern matches exactly the search result,
- * that is, the source of the search result equals the search pattern.
- * @deprecated Use {@link SearchPattern#R_EXACT_MATCH} instead.
- */
- int EXACT_MATCH = 0;
- /**
- * The search pattern is a prefix of the search result.
- * @deprecated Use {@link SearchPattern#R_PREFIX_MATCH} instead.
- */
- int PREFIX_MATCH = 1;
- /**
- * The search pattern contains one or more wild cards ('*') where a
- * wild-card can replace 0 or more characters in the search result.
- * @deprecated Use {@link SearchPattern#R_PATTERN_MATCH} instead.
- */
- int PATTERN_MATCH = 2;
-
-
- /* Case sensitivity */
-
- /**
- * The search pattern matches the search result only
- * if cases are the same.
- * @deprecated Use the methods that take the matchMode
- * with {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead.
- */
- boolean CASE_SENSITIVE = true;
- /**
- * The search pattern ignores cases in the search result.
- * @deprecated Use the methods that take the matchMode
- * without {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead.
- */
- boolean CASE_INSENSITIVE = false;
-
-
- /* Waiting policies */
-
- /**
* The search operation starts immediately, even if the underlying indexer
* has not finished indexing the workspace. Results will more likely
* not contain all the matches.
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchResultCollector.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchResultCollector.java
deleted file mode 100644
index 8709574..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchResultCollector.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.search;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-
-/**
- * A <code>IJavaScriptSearchResultCollector</code> collects search results from a <code>search</code>
- * query to a <code>SearchEngine</code>. Clients must implement this interface and pass
- * an instance to the <code>search(...)</code> methods. When a search starts, the <code>aboutToStart()</code>
- * method is called, then 0 or more call to <code>accept(...)</code> are done, finally the
- * <code>done()</code> method is called.
- * <p>
- * Results provided to this collector may be accurate - in this case they have an <code>EXACT_MATCH</code> accuracy -
- * or they might be potential matches only - they have a <code>POTENTIAL_MATCH</code> accuracy. This last
- * case can occur when a problem prevented the <code>SearchEngine</code> from resolving the match.
- * </p>
- * <p>
- * The order of the results is unspecified. Clients must not rely on this order to display results,
- * but they should sort these results (for example, in syntactical order).
- * <p>
- * The <code>IJavaScriptSearchResultCollector</code> is also used to provide a progress monitor to the
- * <code>SearchEngine</code>.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- *
- * @see SearchEngine
- * @deprecated Since 3.0, the class
- * {@link org.eclipse.wst.jsdt.core.search.SearchRequestor} replaces this interface.
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public interface IJavaScriptSearchResultCollector {
- /**
- * The search result corresponds exactly to the search pattern.
- *
- * @deprecated Use {@link SearchMatch#A_ACCURATE} instead.
- */
- int EXACT_MATCH = 0;
-
- /**
- * The search result is potentially a match for the search pattern,
- * but a problem prevented the search engine from being more accurate
- * (typically because of the classpath was not correctly set).
- *
- * @deprecated Use {@link SearchMatch#A_INACCURATE} instead.
- */
- int POTENTIAL_MATCH = 1;
-
-/**
- * Called before the actual search starts.
- *
- * @deprecated Replaced by {@link SearchRequestor#beginReporting()}.
- */
-public void aboutToStart();
-/**
- * Accepts the given search result.
- *
- * @param resource the resource in which the match has been found
- * @param start the start position of the match, -1 if it is unknown
- * @param end the end position of the match, -1 if it is unknown;
- * the ending offset is exclusive, meaning that the actual range of characters
- * covered is <code>[start, end]</code>
- * @param enclosingElement the Java element that contains the character range
- * <code>[start, end]</code>; the value can be <code>null</code> indicating that
- * no enclosing Java element has been found
- * @param accuracy the level of accuracy the search result has; either
- * <code>EXACT_MATCH</code> or <code>POTENTIAL_MATCH</code>
- * @exception CoreException if this collector had a problem accepting the search result
- * @deprecated Replaced by {@link SearchRequestor#acceptSearchMatch(SearchMatch)}.
- */
-public void accept(
- IResource resource,
- int start,
- int end,
- IJavaScriptElement enclosingElement,
- int accuracy)
- throws CoreException;
-/**
- * Called when the search has ended.
- *
- * @deprecated Replaced by {@link SearchRequestor#endReporting()}.
- */
-public void done();
-/**
- * Returns the progress monitor used to report progress.
- *
- * @return a progress monitor or null if no progress monitor is provided
- */
-public IProgressMonitor getProgressMonitor();
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchScope.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchScope.java
index ba3d9ee..3a34a6d 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchScope.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/IJavaScriptSearchScope.java
@@ -92,46 +92,5 @@
* @return an array of paths to the enclosing projects and JARS.
*/
IPath[] enclosingProjectsAndJars();
-/**
- * Returns whether this scope contains any <code>.class</code> files (either
- * in folders or within JARs).
- *
- * @return whether this scope contains any <code>.class</code> files
- * @deprecated Use
- * {@link org.eclipse.wst.jsdt.core.search.SearchEngine#createJavaSearchScope(IJavaScriptElement[])}
- * with the package fragment roots that correspond to the binaries instead.
- */
-boolean includesBinaries();
-/**
- * Returns whether this scope includes classpaths defined by
- * the projects of the resources of this search scope.
- *
- * @return whether this scope includes classpaths
- * @deprecated Use
- * {@link org.eclipse.wst.jsdt.core.search.SearchEngine#createJavaSearchScope(IJavaScriptElement[])}
- * with a Java project instead.
- */
-boolean includesClasspaths();
-/**
- * Sets whether this scope contains any <code>.class</code> files (either
- * in folders or within JARs).
- *
- * @param includesBinaries whether this scope contains any <code>.class</code> files
- * @deprecated Use
- * {@link org.eclipse.wst.jsdt.core.search.SearchEngine#createJavaSearchScope(IJavaScriptElement[])}
- * with the package fragment roots that correspond to the binaries instead.
- */
-public void setIncludesBinaries(boolean includesBinaries);
-/**
- * Sets whether this scope includes the classpaths defined by
- * the projects of the resources of this search scope.
- *
- * @param includesClasspaths whether this scope includes classpaths
- * @deprecated Use
- * {@link org.eclipse.wst.jsdt.core.search.SearchEngine#createJavaSearchScope(IJavaScriptElement[])}
- * with a Java project instead.
- */
-public void setIncludesClasspaths(boolean includesClasspaths);
-
public boolean shouldExclude(String container, String resourceName);
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/ISearchPattern.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/ISearchPattern.java
deleted file mode 100644
index bae27a7..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/ISearchPattern.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.search;
-
-/**
- * A search pattern defines how search results are found. Use <code>SearchEngine.createSearchPattern</code>
- * to create a search pattern.
- *
- * @see SearchEngine#createSearchPattern(org.eclipse.wst.jsdt.core.IJavaScriptElement, int)
- * @see SearchEngine#createSearchPattern(String, int, int, boolean)
- * @deprecated Since 3.0, the class
- * {@link org.eclipse.wst.jsdt.core.search.SearchPattern} replaces this interface.
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public interface ISearchPattern {
- // used as a marker interface: contains no methods
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/ITypeNameRequestor.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/ITypeNameRequestor.java
deleted file mode 100644
index feb4525..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/ITypeNameRequestor.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.search;
-
-/**
- * A <code>ITypeNameRequestor</code> collects search results from a <code>searchAllTypeNames</code>
- * query to a <code>SearchEngine</code>. Clients must implement this interface and pass
- * an instance to the <code>searchAllTypeNames(...)</code> method. Only top-level and
- * member types are reported. Local types are not reported.
- * <p>
- * This interface may be implemented by clients.
- * </p>
- * @deprecated Use abstract class {@link TypeNameRequestor} instead.
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public interface ITypeNameRequestor {
-/**
- * Accepts a top-level or a member class.
- *
- * @param packageName the dot-separated name of the package of the class
- * @param simpleTypeName the simple name of the class
- * @param enclosingTypeNames if the class is a member type,
- * the simple names of the enclosing types from the outer-most to the
- * direct parent of the class (for example, if the class is x.y.A$B$C then
- * the enclosing types are [A, B]. This is an empty array if the class
- * is a top-level type.
- * @param path the full path to the resource containing the class. If the resource is a .class file
- * or a source file, this is the full path in the workspace to this resource. If the
- * resource is an archive (that is, a .zip or .jar file), the path is composed of 2 paths separated
- * by <code>IJavaScriptSearchScope.JAR_FILE_ENTRY_SEPARATOR</code>:
- * the first path is the full OS path to the archive (if it is an external archive),
- * or the workspace relative <code>IPath</code> to the archive (if it is an internal archive),
- * the second path is the path to the resource inside the archive.
- */
-void acceptClass(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path);
-/**
- * Accepts a top-level or a member interface.
- *
- * @param packageName the dot-separated name of the package of the interface
- * @param simpleTypeName the simple name of the interface
- * @param enclosingTypeNames if the interface is a member type,
- * the simple names of the enclosing types from the outer-most to the
- * direct parent of the interface (for example, if the interface is x.y.A$B$I then
- * the enclosing types are [A, B]. This is an empty array if the interface
- * is a top-level type.
- * @param path the full path to the resource containing the interface. If the resource is a .class file
- * or a source file, this is the full path in the workspace to this resource. If the
- * resource is an archive (that is, a .zip or .jar file), the path is composed of 2 paths separated
- * by <code>IJavaScriptSearchScope.JAR_FILE_ENTRY_SEPARATOR</code>:
- * the first path is the full OS path to the archive (if it is an external archive),
- * or the workspace relative <code>IPath</code> to the archive (if it is an internal archive),
- * the second path is the path to the resource inside the archive.
- * */
-void acceptInterface(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path);
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/SearchEngine.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/SearchEngine.java
index 1e9d54a..1860d6b 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/SearchEngine.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/search/SearchEngine.java
@@ -10,26 +10,16 @@
*******************************************************************************/
package org.eclipse.wst.jsdt.core.search;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.IWorkingCopy;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.internal.compiler.env.AccessRestriction;
import org.eclipse.wst.jsdt.internal.core.search.BasicSearchEngine;
-import org.eclipse.wst.jsdt.internal.core.search.IRestrictedAccessTypeRequestor;
import org.eclipse.wst.jsdt.internal.core.search.TypeNameMatchRequestorWrapper;
import org.eclipse.wst.jsdt.internal.core.search.TypeNameRequestorWrapper;
-import org.eclipse.wst.jsdt.internal.core.search.matching.DeclarationOfAccessedFieldsPattern;
-import org.eclipse.wst.jsdt.internal.core.search.matching.DeclarationOfReferencedMethodsPattern;
-import org.eclipse.wst.jsdt.internal.core.search.matching.DeclarationOfReferencedTypesPattern;
/**
* A {@link SearchEngine} searches for Java elements following a search pattern.
@@ -53,70 +43,6 @@
*/
public class SearchEngine {
- /**
- * Internal adapter class.
- * @deprecated marking deprecated as it uses deprecated ISearchPattern
- */
- static class SearchPatternAdapter implements ISearchPattern {
- SearchPattern pattern;
- SearchPatternAdapter(SearchPattern pattern) {
- this.pattern = pattern;
- }
- }
-
- /**
- * Internal adapter class.
- * @deprecated marking deprecated as it uses deprecated IJavaScriptSearchResultCollector
- */
- static class ResultCollectorAdapter extends SearchRequestor {
- IJavaScriptSearchResultCollector resultCollector;
- ResultCollectorAdapter(IJavaScriptSearchResultCollector resultCollector) {
- this.resultCollector = resultCollector;
- }
- /**
- * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.wst.jsdt.core.search.SearchMatch)
- */
- public void acceptSearchMatch(SearchMatch match) throws CoreException {
- this.resultCollector.accept(
- match.getResource(),
- match.getOffset(),
- match.getOffset() + match.getLength(),
- (IJavaScriptElement) match.getElement(),
- match.getAccuracy()
- );
- }
- /**
- * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#beginReporting()
- */
- public void beginReporting() {
- this.resultCollector.aboutToStart();
- }
- /**
- * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#endReporting()
- */
- public void endReporting() {
- this.resultCollector.done();
- }
- }
-
- /**
- * Internal adapter class.
- * @deprecated marking deprecated as it uses deprecated ITypeNameRequestor
- */
- static class TypeNameRequestorAdapter implements IRestrictedAccessTypeRequestor {
- ITypeNameRequestor nameRequestor;
- TypeNameRequestorAdapter(ITypeNameRequestor requestor) {
- this.nameRequestor = requestor;
- }
- public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) {
- if (Flags.isInterface(modifiers)) {
- nameRequestor.acceptInterface(packageName, simpleTypeName, enclosingTypeNames, path);
- } else {
- nameRequestor.acceptClass(packageName, simpleTypeName, enclosingTypeNames, path);
- }
- }
- }
-
// Search engine now uses basic engine functionalities
private BasicSearchEngine basicEngine;
@@ -143,26 +69,6 @@
this.basicEngine = new BasicSearchEngine(workingCopies);
}
/**
- * Creates a new search engine with a list of working copies that will take precedence over
- * their original compilation units in the subsequent search operations.
- * <p>
- * Note that passing an empty working copy will be as if the original compilation
- * unit had been deleted.</p>
- * <p>
- * Since 3.0 the given working copies take precedence over primary working copies (if any).
- *
- * @param workingCopies the working copies that take precedence over their original compilation units
- * @since 2.0
- * @deprecated Use {@link #SearchEngine(IJavaScriptUnit[])} instead.
- */
- public SearchEngine(IWorkingCopy[] workingCopies) {
- int length = workingCopies.length;
- IJavaScriptUnit[] units = new IJavaScriptUnit[length];
- System.arraycopy(workingCopies, 0, units, 0, length);
- this.basicEngine = new BasicSearchEngine(units);
- }
-
- /**
* Creates a new search engine with the given working copy owner.
* The working copies owned by this owner will take precedence over
* the primary compilation units in the subsequent search operations.
@@ -205,28 +111,6 @@
}
/**
- * Returns a Java search scope limited to the given resources.
- * The Java elements resulting from a search with this scope will
- * have their underlying resource included in or equals to one of the given
- * resources.
- * <p>
- * Resources must not overlap, for example, one cannot include a folder and its children.
- * </p>
- *
- * @param resources the resources the scope is limited to
- * @return a new Java search scope
- * @deprecated Use {@link #createJavaSearchScope(IJavaScriptElement[])} instead.
- */
- public static IJavaScriptSearchScope createJavaSearchScope(IResource[] resources) {
- int length = resources.length;
- IJavaScriptElement[] elements = new IJavaScriptElement[length];
- for (int i = 0; i < length; i++) {
- elements[i] = JavaScriptCore.create(resources[i]);
- }
- return createJavaSearchScope(elements);
- }
-
- /**
* Returns a Java search scope limited to the given Java elements.
* The Java elements resulting from a search with this scope will
* be children of the given elements.
@@ -310,103 +194,6 @@
}
/**
- * Returns a search pattern that combines the given two patterns into a "or" pattern.
- * The search result will match either the left pattern or the right pattern.
- *
- * @param leftPattern the left pattern
- * @param rightPattern the right pattern
- * @return a "or" pattern
- * @deprecated Use {@link SearchPattern#createOrPattern(SearchPattern, SearchPattern)} instead.
- */
- public static ISearchPattern createOrSearchPattern(ISearchPattern leftPattern, ISearchPattern rightPattern) {
- SearchPattern left = ((SearchPatternAdapter) leftPattern).pattern;
- SearchPattern right = ((SearchPatternAdapter) rightPattern).pattern;
- SearchPattern pattern = SearchPattern.createOrPattern(left, right);
- return new SearchPatternAdapter(pattern);
- }
-
- /**
- * Returns a search pattern based on a given string pattern. The string patterns support '*' wild-cards.
- * The remaining parameters are used to narrow down the type of expected results.
- *
- * <br>
- * Examples:
- * <ul>
- * <li>search for case insensitive references to <code>Object</code>:
- * <code>createSearchPattern("Object", TYPE, REFERENCES, false);</code></li>
- * <li>search for case sensitive references to exact <code>Object()</code> constructor:
- * <code>createSearchPattern("java.lang.Object()", CONSTRUCTOR, REFERENCES, true);</code></li>
- * <li>search for implementers of <code>java.lang.Runnable</code>:
- * <code>createSearchPattern("java.lang.Runnable", TYPE, IMPLEMENTORS, true);</code></li>
- * </ul>
- * @param stringPattern the given pattern
- * @param searchFor determines the nature of the searched elements
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#CLASS}: only look for classes</li>
- * <li>{@link IJavaScriptSearchConstants#INTERFACE}: only look for interfaces</li>
- * <li>{@link IJavaScriptSearchConstants#TYPE}: look for both classes and interfaces</li>
- * <li>{@link IJavaScriptSearchConstants#FIELD}: look for fields</li>
- * <li>{@link IJavaScriptSearchConstants#METHOD}: look for methods</li>
- * <li>{@link IJavaScriptSearchConstants#CONSTRUCTOR}: look for constructors</li>
- * <li>{@link IJavaScriptSearchConstants#PACKAGE}: look for packages</li>
- * </ul>
- * @param limitTo determines the nature of the expected matches
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#DECLARATIONS}: will search declarations matching with the corresponding
- * element. In case the element is a method, declarations of matching methods in subtypes will also
- * be found, allowing to find declarations of abstract methods, etc.</li>
- *
- * <li>{@link IJavaScriptSearchConstants#REFERENCES}: will search references to the given element.</li>
- *
- * <li>{@link IJavaScriptSearchConstants#ALL_OCCURRENCES}: will search for either declarations or references as specified
- * above.</li>
- *
- * <li>{@link IJavaScriptSearchConstants#IMPLEMENTORS}: for types, will find all types
- * which directly implement/extend a given interface.
- * Note that types may be only classes or only interfaces if {@link IJavaScriptSearchConstants#CLASS } or
- * {@link IJavaScriptSearchConstants#INTERFACE} is respectively used instead of {@link IJavaScriptSearchConstants#TYPE}.
- * </li>
- * </ul>
- *
- * @param isCaseSensitive indicates whether the search is case sensitive or not.
- * @return a search pattern on the given string pattern, or <code>null</code> if the string pattern is ill-formed.
- * @deprecated Use {@link SearchPattern#createPattern(String, int, int, int)} instead.
- */
- public static ISearchPattern createSearchPattern(String stringPattern, int searchFor, int limitTo, boolean isCaseSensitive) {
- int matchMode = stringPattern.indexOf('*') != -1 || stringPattern.indexOf('?') != -1
- ? SearchPattern.R_PATTERN_MATCH
- : SearchPattern.R_EXACT_MATCH;
- int matchRule = isCaseSensitive ? matchMode | SearchPattern.R_CASE_SENSITIVE : matchMode;
- return new SearchPatternAdapter(SearchPattern.createPattern(stringPattern, searchFor, limitTo, matchRule));
- }
-
- /**
- * Returns a search pattern based on a given Java element.
- * The pattern is used to trigger the appropriate search, and can be parameterized as follows:
- *
- * @param element the Java element the search pattern is based on
- * @param limitTo determines the nature of the expected matches
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#DECLARATIONS}: will search declarations matching with the corresponding
- * element. In case the element is a method, declarations of matching methods in subtypes will also
- * be found, allowing to find declarations of abstract methods, etc.</li>
- *
- * <li>{@link IJavaScriptSearchConstants#REFERENCES}: will search references to the given element.</li>
- *
- * <li>{@link IJavaScriptSearchConstants#ALL_OCCURRENCES}: will search for either declarations or references as specified
- * above.</li>
- *
- * <li>{@link IJavaScriptSearchConstants#IMPLEMENTORS}: for types, will find all types
- * which directly implement/extend a given interface.</li>
- * </ul>
- * @return a search pattern for a Java element or <code>null</code> if the given element is ill-formed
- * @deprecated Use {@link SearchPattern#createPattern(IJavaScriptElement, int)} instead.
- */
- public static ISearchPattern createSearchPattern(IJavaScriptElement element, int limitTo) {
- return new SearchPatternAdapter(SearchPattern.createPattern(element, limitTo));
- }
-
- /**
* Create a type name match on a given type with specific modifiers.
*
* @param type The java model handle of the type
@@ -437,118 +224,6 @@
}
/**
- * Searches for the Java element determined by the given signature. The signature
- * can be incomplete. For example, a call like
- * <code>search(ws, "run()", METHOD,REFERENCES, col)</code>
- * searches for all references to the method <code>run</code>.
- *
- * Note that by default the pattern will be case insensitive. For specifying case s
- * sensitive search, use <code>search(workspace, createSearchPattern(patternString, searchFor, limitTo, true), scope, resultCollector);</code>
- *
- * @param workspace the workspace
- * @param patternString the pattern to be searched for
- * @param searchFor a hint what kind of Java element the string pattern represents.
- * Look into {@link IJavaScriptSearchConstants} for valid values
- * @param limitTo one of the following values:
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#DECLARATIONS}: search
- * for declarations only </li>
- * <li>{@link IJavaScriptSearchConstants#REFERENCES}: search
- * for all references </li>
- * <li>{@link IJavaScriptSearchConstants#ALL_OCCURRENCES}: search
- * for both declarations and all references </li>
- * <li>{@link IJavaScriptSearchConstants#IMPLEMENTORS}: for types, will find all types
- * which directly implement/extend a given interface.<br>
- * Note that types may be only classes or only interfaces if respectively {@link IJavaScriptSearchConstants#CLASS} or
- * {@link IJavaScriptSearchConstants#INTERFACE} is used for searchFor parameter instead of {@link IJavaScriptSearchConstants#TYPE}.
- * </li>
- * </ul>
- * @param scope the search result has to be limited to the given scope
- * @param resultCollector a callback object to which each match is reported
- * @exception JavaScriptModelException if the search failed. Reasons include:
- * <ul>
- * <li>the classpath is incorrectly set</li>
- * </ul>
- * @deprecated Use {@link #search(SearchPattern, SearchParticipant[], IJavaScriptSearchScope, SearchRequestor, IProgressMonitor)} instead.
- */
- public void search(IWorkspace workspace, String patternString, int searchFor, int limitTo, IJavaScriptSearchScope scope, IJavaScriptSearchResultCollector resultCollector) throws JavaScriptModelException {
- try {
- int matchMode = patternString.indexOf('*') != -1 || patternString.indexOf('?') != -1
- ? SearchPattern.R_PATTERN_MATCH
- : SearchPattern.R_EXACT_MATCH;
- search(
- SearchPattern.createPattern(patternString, searchFor, limitTo, matchMode | SearchPattern.R_CASE_SENSITIVE),
- new SearchParticipant[] {getDefaultSearchParticipant()},
- scope,
- new ResultCollectorAdapter(resultCollector),
- resultCollector.getProgressMonitor());
- } catch (CoreException e) {
- if (e instanceof JavaScriptModelException)
- throw (JavaScriptModelException) e;
- throw new JavaScriptModelException(e);
- }
- }
-
- /**
- * Searches for the given Java element.
- *
- * @param workspace the workspace
- * @param element the Java element to be searched for
- * @param limitTo one of the following values:
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#DECLARATIONS}: search
- * for declarations only </li>
- * <li>{@link IJavaScriptSearchConstants#REFERENCES}: search
- * for all references </li>
- * <li>{@link IJavaScriptSearchConstants#ALL_OCCURRENCES}: search
- * for both declarations and all references </li>
- * <li>{@link IJavaScriptSearchConstants#IMPLEMENTORS}: for types, will find all types
- * which directly implement/extend a given interface.</li>
- * </ul>
- * @param scope the search result has to be limited to the given scope
- * @param resultCollector a callback object to which each match is reported
- * @exception JavaScriptModelException if the search failed. Reasons include:
- * <ul>
- * <li>the element doesn't exist</li>
- * <li>the classpath is incorrectly set</li>
- * </ul>
- * @deprecated Use {@link #search(SearchPattern, SearchParticipant[], IJavaScriptSearchScope, SearchRequestor, IProgressMonitor)} instead.
- */
- public void search(IWorkspace workspace, IJavaScriptElement element, int limitTo, IJavaScriptSearchScope scope, IJavaScriptSearchResultCollector resultCollector) throws JavaScriptModelException {
- search(workspace, createSearchPattern(element, limitTo), scope, resultCollector);
- }
-
- /**
- * Searches for matches of a given search pattern. Search patterns can be created using helper
- * methods (from a String pattern or a Java element) and encapsulate the description of what is
- * being searched (for example, search method declarations in a case sensitive way).
- *
- * @param workspace the workspace
- * @param searchPattern the pattern to be searched for
- * @param scope the search result has to be limited to the given scope
- * @param resultCollector a callback object to which each match is reported
- * @exception JavaScriptModelException if the search failed. Reasons include:
- * <ul>
- * <li>the classpath is incorrectly set</li>
- * </ul>
- * @deprecated Use {@link #search(SearchPattern, SearchParticipant[], IJavaScriptSearchScope, SearchRequestor, IProgressMonitor)} instead.
- */
- public void search(IWorkspace workspace, ISearchPattern searchPattern, IJavaScriptSearchScope scope, IJavaScriptSearchResultCollector resultCollector) throws JavaScriptModelException {
- try {
- search(
- ((SearchPatternAdapter)searchPattern).pattern,
- new SearchParticipant[] {getDefaultSearchParticipant()},
- scope,
- new ResultCollectorAdapter(resultCollector),
- resultCollector.getProgressMonitor());
- } catch (CoreException e) {
- if (e instanceof JavaScriptModelException)
- throw (JavaScriptModelException) e;
- throw new JavaScriptModelException(e);
- }
- }
-
- /**
* Searches for matches of a given search pattern. Search patterns can be created using helper
* methods (from a String pattern or a Java element) and encapsulate the description of what is
* being searched (for example, search method declarations in a case sensitive way).
@@ -570,74 +245,6 @@
/**
* Searches for all top-level types and member types in the given scope.
- * The search can be selecting specific types (given a package exact full name or
- * a type name with specific match mode).
- *
- * @param packageExactName the exact package full name of the searched types.<br>
- * If you want to use a prefix or a wild-carded string for package, you need to use
- * {@link #searchAllTypeNames(char[], int, char[], int, int, IJavaScriptSearchScope, TypeNameRequestor, int, IProgressMonitor)}
- * method instead. May be <code>null</code>, then any package name is accepted.
- * @param typeName the dot-separated qualified name of the searched type (the qualification include
- * the enclosing types if the searched type is a member type), or a prefix
- * for this type, or a wild-carded string for this type.
- * May be <code>null</code>, then any type name is accepted.
- * @param matchRule type name match rule one of
- * <ul>
- * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type name are the full names
- * of the searched types.</li>
- * <li>{@link SearchPattern#R_PREFIX_MATCH} if the package name and type name are prefixes of the names
- * of the searched types.</li>
- * <li>{@link SearchPattern#R_PATTERN_MATCH} if the package name and type name contain wild-cards.</li>
- * <li>{@link SearchPattern#R_CAMELCASE_MATCH} if type name are camel case of the names of the searched types.</li>
- * </ul>
- * combined with {@link SearchPattern#R_CASE_SENSITIVE},
- * e.g. {@link SearchPattern#R_EXACT_MATCH} | {@link SearchPattern#R_CASE_SENSITIVE} if an exact and case sensitive match is requested,
- * or {@link SearchPattern#R_PREFIX_MATCH} if a prefix non case sensitive match is requested.
- * @param searchFor determines the nature of the searched elements
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#CLASS}: only look for classes</li>
- * <li>{@link IJavaScriptSearchConstants#INTERFACE}: only look for interfaces</li>
- * <li>{@link IJavaScriptSearchConstants#ENUM}: only look for enumeration</li>
- * <li>{@link IJavaScriptSearchConstants#ANNOTATION_TYPE}: only look for annotation type</li>
- * <li>{@link IJavaScriptSearchConstants#CLASS_AND_ENUM}: only look for classes and enumerations</li>
- * <li>{@link IJavaScriptSearchConstants#CLASS_AND_INTERFACE}: only look for classes and interfaces</li>
- * <li>{@link IJavaScriptSearchConstants#TYPE}: look for all types (ie. classes, interfaces, enum and annotation types)</li>
- * </ul>
- * @param scope the scope to search in
- * @param nameRequestor the requestor that collects the results of the search
- * @param waitingPolicy one of
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#FORCE_IMMEDIATE_SEARCH} if the search should start immediately</li>
- * <li>{@link IJavaScriptSearchConstants#CANCEL_IF_NOT_READY_TO_SEARCH} if the search should be cancelled if the
- * underlying indexer has not finished indexing the workspace</li>
- * <li>{@link IJavaScriptSearchConstants#WAIT_UNTIL_READY_TO_SEARCH} if the search should wait for the
- * underlying indexer to finish indexing the workspace</li>
- * </ul>
- * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
- * monitor is provided
- * @exception JavaScriptModelException if the search failed. Reasons include:
- * <ul>
- * <li>the classpath is incorrectly set</li>
- * </ul>
- * @since 3.1
- * @deprecated Use {@link #searchAllTypeNames(char[], int, char[], int, int, IJavaScriptSearchScope, TypeNameRequestor, int, IProgressMonitor)}
- * instead
- */
- public void searchAllTypeNames(
- final char[] packageExactName,
- final char[] typeName,
- final int matchRule,
- int searchFor,
- IJavaScriptSearchScope scope,
- final TypeNameRequestor nameRequestor,
- int waitingPolicy,
- IProgressMonitor progressMonitor) throws JavaScriptModelException {
-
- searchAllTypeNames(packageExactName, SearchPattern.R_EXACT_MATCH, typeName, matchRule, searchFor, scope, nameRequestor, waitingPolicy, progressMonitor);
- }
-
- /**
- * Searches for all top-level types and member types in the given scope.
* The search can be selecting specific types (given a package name using specific match mode
* and/or a type name using another specific match mode).
*
@@ -897,133 +504,6 @@
}
/**
- * Searches for all top-level types and member types in the given scope.
- * The search can be selecting specific types (given a package or a type name
- * prefix and match modes).
- *
- * @param packageName the full name of the package of the searched types, or a prefix for this
- * package, or a wild-carded string for this package.
- * @param typeName the dot-separated qualified name of the searched type (the qualification include
- * the enclosing types if the searched type is a member type), or a prefix
- * for this type, or a wild-carded string for this type.
- * @param matchRule one of
- * <ul>
- * <li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type name are the full names
- * of the searched types.</li>
- * <li>{@link SearchPattern#R_PREFIX_MATCH} if the package name and type name are prefixes of the names
- * of the searched types.</li>
- * <li>{@link SearchPattern#R_PATTERN_MATCH} if the package name and type name contain wild-cards.</li>
- * </ul>
- * combined with {@link SearchPattern#R_CASE_SENSITIVE},
- * e.g. {@link SearchPattern#R_EXACT_MATCH} | {@link SearchPattern#R_CASE_SENSITIVE} if an exact and case sensitive match is requested,
- * or {@link SearchPattern#R_PREFIX_MATCH} if a prefix non case sensitive match is requested.
- * @param searchFor one of
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#CLASS} if searching for classes only</li>
- * <li>{@link IJavaScriptSearchConstants#INTERFACE} if searching for interfaces only</li>
- * <li>{@link IJavaScriptSearchConstants#TYPE} if searching for both classes and interfaces</li>
- * </ul>
- * @param scope the scope to search in
- * @param nameRequestor the requestor that collects the results of the search
- * @param waitingPolicy one of
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#FORCE_IMMEDIATE_SEARCH} if the search should start immediately</li>
- * <li>{@link IJavaScriptSearchConstants#CANCEL_IF_NOT_READY_TO_SEARCH} if the search should be cancelled if the
- * underlying indexer has not finished indexing the workspace</li>
- * <li>{@link IJavaScriptSearchConstants#WAIT_UNTIL_READY_TO_SEARCH} if the search should wait for the
- * underlying indexer to finish indexing the workspace</li>
- * </ul>
- * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
- * monitor is provided
- * @exception JavaScriptModelException if the search failed. Reasons include:
- * <ul>
- * <li>the classpath is incorrectly set</li>
- * </ul>
- * @since 3.0
- *@deprecated Use {@link #searchAllTypeNames(char[], char[], int, int, IJavaScriptSearchScope, TypeNameRequestor, int, IProgressMonitor)} instead
- */
- public void searchAllTypeNames(
- final char[] packageName,
- final char[] typeName,
- final int matchRule,
- int searchFor,
- IJavaScriptSearchScope scope,
- final ITypeNameRequestor nameRequestor,
- int waitingPolicy,
- IProgressMonitor progressMonitor) throws JavaScriptModelException {
-
- TypeNameRequestorAdapter requestorAdapter = new TypeNameRequestorAdapter(nameRequestor);
- this.basicEngine.searchAllTypeNames(packageName, SearchPattern.R_EXACT_MATCH, typeName, matchRule, searchFor, scope, requestorAdapter, waitingPolicy, progressMonitor);
- }
-
- /**
- * Searches for all top-level types and member types in the given scope.
- * The search can be selecting specific types (given a package or a type name
- * prefix and match modes).
- *
- * @param workspace the workspace to search in
- * @param packageName the full name of the package of the searched types, or a prefix for this
- * package, or a wild-carded string for this package.
- * @param typeName the dot-separated qualified name of the searched type (the qualification include
- * the enclosing types if the searched type is a member type), or a prefix
- * for this type, or a wild-carded string for this type.
- * @param matchMode one of
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#EXACT_MATCH} if the package name and type name are the full names
- * of the searched types.</li>
- * <li>{@link IJavaScriptSearchConstants#PREFIX_MATCH} if the package name and type name are prefixes of the names
- * of the searched types.</li>
- * <li>{@link IJavaScriptSearchConstants#PATTERN_MATCH} if the package name and type name contain wild-cards.</li>
- * </ul>
- * @param isCaseSensitive whether the search should be case sensitive
- * @param searchFor one of
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#CLASS} if searching for classes only</li>
- * <li>{@link IJavaScriptSearchConstants#INTERFACE} if searching for interfaces only</li>
- * <li>{@link IJavaScriptSearchConstants#TYPE} if searching for both classes and interfaces</li>
- * </ul>
- * @param scope the scope to search in
- * @param nameRequestor the requestor that collects the results of the search
- * @param waitingPolicy one of
- * <ul>
- * <li>{@link IJavaScriptSearchConstants#FORCE_IMMEDIATE_SEARCH} if the search should start immediately</li>
- * <li>{@link IJavaScriptSearchConstants#CANCEL_IF_NOT_READY_TO_SEARCH} if the search should be cancelled if the
- * underlying indexer has not finished indexing the workspace</li>
- * <li>{@link IJavaScriptSearchConstants#WAIT_UNTIL_READY_TO_SEARCH} if the search should wait for the
- * underlying indexer to finish indexing the workspace</li>
- * </ul>
- * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
- * monitor is provided
- * @exception JavaScriptModelException if the search failed. Reasons include:
- * <ul>
- * <li>the classpath is incorrectly set</li>
- * </ul>
- *@deprecated Use {@link #searchAllTypeNames(char[], char[], int, int, IJavaScriptSearchScope, ITypeNameRequestor, int, IProgressMonitor)} instead
- */
- public void searchAllTypeNames(
- IWorkspace workspace,
- final char[] packageName,
- final char[] typeName,
- final int matchMode,
- final boolean isCaseSensitive,
- int searchFor,
- IJavaScriptSearchScope scope,
- final ITypeNameRequestor nameRequestor,
- int waitingPolicy,
- IProgressMonitor progressMonitor) throws JavaScriptModelException {
-
- searchAllTypeNames(
- packageName,
- typeName,
- isCaseSensitive ? matchMode | SearchPattern.R_CASE_SENSITIVE : matchMode,
- searchFor,
- scope,
- nameRequestor,
- waitingPolicy,
- progressMonitor);
- }
-
- /**
* Searches for all declarations of the fields accessed in the given element.
* The element can be a compilation unit, a source type, or a source method.
* Reports the field declarations using the given requestor.
@@ -1065,48 +545,6 @@
}
/**
- * Searches for all declarations of the fields accessed in the given element.
- * The element can be a compilation unit, a source type, or a source method.
- * Reports the field declarations using the given collector.
- * <p>
- * Consider the following code:
- * <code>
- * <pre>
- * class A {
- * int field1;
- * }
- * class B extends A {
- * String value;
- * }
- * class X {
- * void test() {
- * B b = new B();
- * System.out.println(b.value + b.field1);
- * };
- * }
- * </pre>
- * </code>
- * then searching for declarations of accessed fields in method
- * <code>X.test()</code> would collect the fields
- * <code>B.value</code> and <code>A.field1</code>.
- * </p>
- *
- * @param workspace the workspace
- * @param enclosingElement the method, type, or compilation unit to be searched in
- * @param resultCollector a callback object to which each match is reported
- * @exception JavaScriptModelException if the search failed. Reasons include:
- * <ul>
- * <li>the element doesn't exist</li>
- * <li>the classpath is incorrectly set</li>
- * </ul>
- * @deprecated Use {@link #searchDeclarationsOfAccessedFields(IJavaScriptElement, SearchRequestor, IProgressMonitor)} instead.
- */
- public void searchDeclarationsOfAccessedFields(IWorkspace workspace, IJavaScriptElement enclosingElement, IJavaScriptSearchResultCollector resultCollector) throws JavaScriptModelException {
- SearchPattern pattern = new DeclarationOfAccessedFieldsPattern(enclosingElement);
- this.basicEngine.searchDeclarations(enclosingElement, new ResultCollectorAdapter(resultCollector), pattern, resultCollector.getProgressMonitor());
- }
-
- /**
* Searches for all declarations of the types referenced in the given element.
* The element can be a compilation unit, a source type, or a source method.
* Reports the type declarations using the given requestor.
@@ -1148,48 +586,6 @@
}
/**
- * Searches for all declarations of the types referenced in the given element.
- * The element can be a compilation unit, a source type, or a source method.
- * Reports the type declarations using the given collector.
- * <p>
- * Consider the following code:
- * <code>
- * <pre>
- * class A {
- * }
- * class B extends A {
- * }
- * interface I {
- * int VALUE = 0;
- * }
- * class X {
- * void test() {
- * B b = new B();
- * this.foo(b, I.VALUE);
- * };
- * }
- * </pre>
- * </code>
- * then searching for declarations of referenced types in method <code>X.test()</code>
- * would collect the class <code>B</code> and the interface <code>I</code>.
- * </p>
- *
- * @param workspace the workspace
- * @param enclosingElement the method, type, or compilation unit to be searched in
- * @param resultCollector a callback object to which each match is reported
- * @exception JavaScriptModelException if the search failed. Reasons include:
- * <ul>
- * <li>the element doesn't exist</li>
- * <li>the classpath is incorrectly set</li>
- * </ul>
- * @deprecated Use {@link #searchDeclarationsOfReferencedTypes(IJavaScriptElement, SearchRequestor, IProgressMonitor)} instead.
- */
- public void searchDeclarationsOfReferencedTypes(IWorkspace workspace, IJavaScriptElement enclosingElement, IJavaScriptSearchResultCollector resultCollector) throws JavaScriptModelException {
- SearchPattern pattern = new DeclarationOfReferencedTypesPattern(enclosingElement);
- this.basicEngine.searchDeclarations(enclosingElement, new ResultCollectorAdapter(resultCollector), pattern, resultCollector.getProgressMonitor());
- }
-
- /**
* Searches for all declarations of the methods invoked in the given element.
* The element can be a compilation unit, a source type, or a source method.
* Reports the method declarations using the given requestor.
@@ -1232,49 +628,4 @@
public void searchDeclarationsOfSentMessages(IJavaScriptElement enclosingElement, SearchRequestor requestor, IProgressMonitor monitor) throws JavaScriptModelException {
this.basicEngine.searchDeclarationsOfSentMessages(enclosingElement, requestor, monitor);
}
-
- /**
- * Searches for all declarations of the methods invoked in the given element.
- * The element can be a compilation unit, a source type, or a source method.
- * Reports the method declarations using the given collector.
- * <p>
- * Consider the following code:
- * <code>
- * <pre>
- * class A {
- * void foo() {};
- * void bar() {};
- * }
- * class B extends A {
- * void foo() {};
- * }
- * class X {
- * void test() {
- * A a = new B();
- * a.foo();
- * B b = (B)a;
- * b.bar();
- * };
- * }
- * </pre>
- * </code>
- * then searching for declarations of sent messages in method
- * <code>X.test()</code> would collect the methods
- * <code>A.foo()</code>, <code>B.foo()</code>, and <code>A.bar()</code>.
- * </p>
- *
- * @param workspace the workspace
- * @param enclosingElement the method, type, or compilation unit to be searched in
- * @param resultCollector a callback object to which each match is reported
- * @exception JavaScriptModelException if the search failed. Reasons include:
- * <ul>
- * <li>the element doesn't exist</li>
- * <li>the classpath is incorrectly set</li>
- * </ul>
- * @deprecated Use {@link #searchDeclarationsOfSentMessages(IJavaScriptElement, SearchRequestor, IProgressMonitor)} instead.
- */
- public void searchDeclarationsOfSentMessages(IWorkspace workspace, IJavaScriptElement enclosingElement, IJavaScriptSearchResultCollector resultCollector) throws JavaScriptModelException {
- SearchPattern pattern = new DeclarationOfReferencedMethodsPattern(enclosingElement);
- this.basicEngine.searchDeclarations(enclosingElement, new ResultCollectorAdapter(resultCollector), pattern, resultCollector.getProgressMonitor());
- }
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/util/JavaScriptUnitSorter.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/util/JavaScriptUnitSorter.java
index f1b32d9..35343f3 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/util/JavaScriptUnitSorter.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/util/JavaScriptUnitSorter.java
@@ -46,9 +46,7 @@
// Not instantiable
}
- /**
- * @deprecated marking deprecated as it is using deprecated code
- */
+
private static void checkASTLevel(int level) {
switch (level) {
case AST.JLS2 :
@@ -82,123 +80,11 @@
* </pre>
* </p>
*
- * @see #sort(IJavaScriptUnit, int[], Comparator, int, IProgressMonitor)
* @see org.eclipse.wst.jsdt.core.dom.BodyDeclaration
*/
public static final String RELATIVE_ORDER = "relativeOrder"; //$NON-NLS-1$
/**
- * Reorders the declarations in the given compilation unit according to
- * JLS2 rules. The caller is
- * responsible for arranging in advance that the given compilation unit is
- * a working copy, and for saving the changes afterwards.
- * <p>
- * <b>Note:</b> Reordering the members within a type declaration might be
- * more than a cosmetic change and could have potentially serious
- * repercussions. Firstly, the order in which the fields of a type are
- * initialized is significant in the Java language; reordering fields
- * and initializers may result in compilation errors or change the execution
- * behavior of the code. Secondly, reordering a class's members may affect
- * how its instances are serialized. This operation should therefore be used
- * with caution and due concern for potential negative side effects.
- * </p>
- * <p>
- * The optional <code>positions</code> array contains a non-decreasing
- * ordered list of character-based source positions within the compilation
- * unit's source code string. Upon return from this method, the positions in
- * the array reflect the corresponding new locations in the modified source
- * code string. Note that this operation modifies the given array in place.
- * </p>
- * <p>
- * The <code>compare</code> method of the given comparator is passed pairs
- * of JLS2 AST body declarations (subclasses of <code>BodyDeclaration</code>)
- * representing body declarations at the same level. The comparator is
- * called on body declarations of nested classes, including anonymous and
- * local classes, but always at the same level. Clients need to provide
- * a comparator implementation (there is no standard comparator). The
- * <code>RELATIVE_ORDER</code> property attached to these AST nodes afforts
- * the comparator a way to preserve the original relative order.
- * </p>
- * <p>
- * The body declarations passed as parameters to the comparator
- * always carry at least the following minimal signature information:
- * <br>
- * <table border="1" width="80%" cellpadding="5">
- * <tr>
- * <td width="20%"><code>TypeDeclaration</code></td>
- * <td width="50%"><code>modifiers, isInterface, name, superclass,
- * superInterfaces<br>
- * RELATIVE_ORDER property</code></td>
- * </tr>
- * <tr>
- * <td width="20%"><code>FieldDeclaration</code></td>
- * <td width="50%"><code>modifiers, type, fragments
- * (VariableDeclarationFragments
- * with name only)<br>
- * RELATIVE_ORDER property</code></td>
- * </tr>
- * <tr>
- * <td width="20%"><code>FunctionDeclaration</code></td>
- * <td width="50%"><code>modifiers, isConstructor, returnType, name,
- * parameters
- * (SingleVariableDeclarations with name and type only),
- * thrownExceptions<br>
- * RELATIVE_ORDER property</code></td>
- * </tr>
- * <tr>
- * <td width="20%"><code>Initializer</code></td>
- * <td width="50%"><code>modifiers<br>
- * RELATIVE_ORDER property</code></td>
- * </tr>
- * </table>
- * Clients should not rely on the AST nodes being properly parented or on
- * having source range information. (Future releases may provide options
- * for requesting additional information like source positions, full ASTs,
- * non-recursive sorting, etc.)
- * </p>
- *
- * @param compilationUnit the given compilation unit, which must be a
- * working copy
- * @param positions an array of source positions to map, or
- * <code>null</code> if none. If supplied, the positions must
- * character-based source positions within the original source code for
- * the given compilation unit, arranged in non-decreasing order.
- * The array is updated in place when this method returns to reflect the
- * corresponding source positions in the permuted source code string
- * (but not necessarily any longer in non-decreasing order).
- * @param comparator the comparator capable of ordering
- * <code>BodyDeclaration</code>s; this comparator is passed AST nodes
- * from a JLS2 AST
- * @param options bitwise-or of option flags; <code>0</code> for default
- * behavior (reserved for future growth)
- * @param monitor the progress monitor to notify, or <code>null</code> if
- * none
- * @exception JavaScriptModelException if the compilation unit could not be
- * sorted. Reasons include:
- * <ul>
- * <li> The given compilation unit does not exist (ELEMENT_DOES_NOT_EXIST)</li>
- * <li> The given compilation unit is not a working copy (INVALID_ELEMENT_TYPES)</li>
- * <li> A <code>CoreException</code> occurred while accessing the underlying
- * resource
- * </ul>
- * @exception IllegalArgumentException if the given compilation unit is null
- * or if the given comparator is null.
- * @see org.eclipse.wst.jsdt.core.dom.BodyDeclaration
- * @see #RELATIVE_ORDER
- * @deprecated Clients should port their code to use the new JLS3 AST API and call
- * {@link #sort(int, IJavaScriptUnit, int[], Comparator, int, IProgressMonitor)
- * JavaScriptUnitSorter.sort(AST.JLS3, compilationUnit, positions, comparator, options, monitor)}
- * instead of using this method.
- */
- public static void sort(IJavaScriptUnit compilationUnit,
- int[] positions,
- Comparator comparator,
- int options,
- IProgressMonitor monitor) throws JavaScriptModelException {
- sort(AST.JLS2, compilationUnit, positions, comparator, options, monitor);
- }
-
- /**
* Reorders the declarations in the given compilation unit according to
* the specified AST level. The caller is responsible for arranging in
* advance that the given compilation unit is a working copy, and for
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/Compiler.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/Compiler.java
index 69981f1..fa7f0bc 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/Compiler.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/Compiler.java
@@ -12,7 +12,6 @@
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.util.Map;
import org.eclipse.wst.jsdt.core.IClassFile;
import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
@@ -92,105 +91,6 @@
* in UI when compiling interactively.
* @see org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies
*
- * @param settings java.util.Map
- * The settings that control the compiler behavior.
- *
- * @param requestor org.eclipse.wst.jsdt.internal.compiler.api.ICompilerRequestor
- * Component which will receive and persist all compilation results and is intended
- * to consume them as they are produced. Typically, in a batch compiler, it is
- * responsible for writing out the actual .class files to the file system.
- * @see org.eclipse.wst.jsdt.internal.compiler.CompilationResult
- *
- * @param problemFactory org.eclipse.wst.jsdt.internal.compiler.api.problem.IProblemFactory
- * Factory used inside the compiler to create problem descriptors. It allows the
- * compiler client to supply its own representation of compilation problems in
- * order to avoid object conversions. Note that the factory is not supposed
- * to accumulate the created problems, the compiler will gather them all and hand
- * them back as part of the compilation unit result.
- *
- * @deprecated this constructor is kept to preserve 3.1 and 3.2M4 compatibility
- */
- public Compiler(
- INameEnvironment environment,
- IErrorHandlingPolicy policy,
- Map settings,
- final ICompilerRequestor requestor,
- IProblemFactory problemFactory) {
- this(environment, policy, new CompilerOptions(settings), requestor, problemFactory, null);
- }
-
- /**
- * Answer a new compiler using the given name environment and compiler options.
- * The environment and options will be in effect for the lifetime of the compiler.
- * When the compiler is run, compilation results are sent to the given requestor.
- *
- * @param environment org.eclipse.wst.jsdt.internal.compiler.api.env.INameEnvironment
- * Environment used by the compiler in order to resolve type and package
- * names. The name environment implements the actual connection of the compiler
- * to the outside world (e.g. in batch mode the name environment is performing
- * pure file accesses, reuse previous build state or connection to repositories).
- * Note: the name environment is responsible for implementing the actual classpath
- * rules.
- *
- * @param policy org.eclipse.wst.jsdt.internal.compiler.api.problem.IErrorHandlingPolicy
- * Configurable part for problem handling, allowing the compiler client to
- * specify the rules for handling problems (stop on first error or accumulate
- * them all) and at the same time perform some actions such as opening a dialog
- * in UI when compiling interactively.
- * @see org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies
- *
- * @param settings java.util.Map
- * The settings that control the compiler behavior.
- *
- * @param requestor org.eclipse.wst.jsdt.internal.compiler.api.ICompilerRequestor
- * Component which will receive and persist all compilation results and is intended
- * to consume them as they are produced. Typically, in a batch compiler, it is
- * responsible for writing out the actual .class files to the file system.
- * @see org.eclipse.wst.jsdt.internal.compiler.CompilationResult
- *
- * @param problemFactory org.eclipse.wst.jsdt.internal.compiler.api.problem.IProblemFactory
- * Factory used inside the compiler to create problem descriptors. It allows the
- * compiler client to supply its own representation of compilation problems in
- * order to avoid object conversions. Note that the factory is not supposed
- * to accumulate the created problems, the compiler will gather them all and hand
- * them back as part of the compilation unit result.
- *
- * @param parseLiteralExpressionsAsConstants <code>boolean</code>
- * This parameter is used to optimize the literals or leave them as they are in the source.
- * If you put true, "Hello" + " world" will be converted to "Hello world".
- *
- * @deprecated this constructor is kept to preserve 3.1 and 3.2M4 compatibility
- */
- public Compiler(
- INameEnvironment environment,
- IErrorHandlingPolicy policy,
- Map settings,
- final ICompilerRequestor requestor,
- IProblemFactory problemFactory,
- boolean parseLiteralExpressionsAsConstants) {
- this(environment, policy, new CompilerOptions(settings, parseLiteralExpressionsAsConstants), requestor, problemFactory, null);
- }
-
- /**
- * Answer a new compiler using the given name environment and compiler options.
- * The environment and options will be in effect for the lifetime of the compiler.
- * When the compiler is run, compilation results are sent to the given requestor.
- *
- * @param environment org.eclipse.wst.jsdt.internal.compiler.api.env.INameEnvironment
- * Environment used by the compiler in order to resolve type and package
- * names. The name environment implements the actual connection of the compiler
- * to the outside world (e.g. in batch mode the name environment is performing
- * pure file accesses, reuse previous build state or connection to repositories).
- * Note: the name environment is responsible for implementing the actual classpath
- * rules.
- *
- * @param policy org.eclipse.wst.jsdt.internal.compiler.api.problem.IErrorHandlingPolicy
- * Configurable part for problem handling, allowing the compiler client to
- * specify the rules for handling problems (stop on first error or accumulate
- * them all) and at the same time perform some actions such as opening a dialog
- * in UI when compiling interactively.
- * @see org.eclipse.wst.jsdt.internal.compiler.DefaultErrorHandlingPolicies
- *
* @param options org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions
* The options that control the compiler behavior.
*
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryMethod.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryMethod.java
index cb40f86..1186f28 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryMethod.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryMethod.java
@@ -369,7 +369,13 @@
}
public ITypeParameter[] getTypeParameters() throws JavaScriptModelException {
- String[] typeParameterSignatures = getTypeParameterSignatures();
+ IBinaryMethod info = (IBinaryMethod) getElementInfo();
+ char[] genericSignature = info.getGenericSignature();
+ if (genericSignature == null)
+ return TypeParameter.NO_TYPE_PARAMETERS;
+ char[] dotBasedSignature = CharOperation.replaceOnCopy(genericSignature, '/', '.');
+ char[][] typeParams = Signature.getTypeParameters(dotBasedSignature);
+ String[] typeParameterSignatures = CharOperation.toStrings(typeParams);
int length = typeParameterSignatures.length;
if (length == 0) return TypeParameter.NO_TYPE_PARAMETERS;
ITypeParameter[] typeParameters = new ITypeParameter[length];
@@ -380,20 +386,6 @@
return typeParameters;
}
-/**
- * @see IFunction#getTypeParameterSignatures()
- * @since 3.0
- * @deprecated
- */
-public String[] getTypeParameterSignatures() throws JavaScriptModelException {
- IBinaryMethod info = (IBinaryMethod) getElementInfo();
- char[] genericSignature = info.getGenericSignature();
- if (genericSignature == null)
- return CharOperation.NO_STRINGS;
- char[] dotBasedSignature = CharOperation.replaceOnCopy(genericSignature, '/', '.');
- char[][] typeParams = Signature.getTypeParameters(dotBasedSignature);
- return CharOperation.toStrings(typeParams);
-}
public String[] getRawParameterNames() throws JavaScriptModelException {
IBinaryMethod info = (IBinaryMethod) getElementInfo();
@@ -648,12 +640,6 @@
if (indexOfNextMethod == -1) throw new JavaScriptModelException(new JavaModelStatus(IJavaScriptModelStatusConstants.UNKNOWN_JSDOC_FORMAT, this));
return contents.substring(indexOfEndLink + JavadocConstants.ANCHOR_SUFFIX_LENGTH, indexOfNextMethod);
}
-/**
- * @deprecated Use {@link #getFunction(String,String[])} instead
- */
-public IFunction getMethod(String selector, String[] parameterTypeSignatures) {
- return getFunction(selector, parameterTypeSignatures);
-}
public IFunction getFunction(String selector, String[] parameterTypeSignatures) {
// TODO Auto-generated method stub
return null;
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryType.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryType.java
index 9d5043f..c59bb75 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryType.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/BinaryType.java
@@ -20,14 +20,13 @@
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.wst.jsdt.core.CompletionRequestor;
import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.ICompletionRequestor;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IInitializer;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.ITypeHierarchy;
@@ -74,24 +73,6 @@
cfi.removeBinaryChildren();
}
-/**
- * @see IType#codeComplete(char[], int, int, char[][], char[][], int[], boolean, ICompletionRequestor)
- * @deprecated
- */
-public void codeComplete(char[] snippet,int insertion,int position,char[][] localVariableTypeNames,char[][] localVariableNames,int[] localVariableModifiers,boolean isStatic,ICompletionRequestor requestor) throws JavaScriptModelException {
- codeComplete(snippet, insertion, position, localVariableTypeNames, localVariableNames, localVariableModifiers, isStatic, requestor, DefaultWorkingCopyOwner.PRIMARY);
-}
-
-/**
- * @see IType#codeComplete(char[], int, int, char[][], char[][], int[], boolean, ICompletionRequestor, WorkingCopyOwner)
- * @deprecated
- */
-public void codeComplete(char[] snippet,int insertion,int position,char[][] localVariableTypeNames,char[][] localVariableNames,int[] localVariableModifiers,boolean isStatic,ICompletionRequestor requestor, WorkingCopyOwner owner) throws JavaScriptModelException {
- if (requestor == null) {
- throw new IllegalArgumentException("Completion requestor cannot be null"); //$NON-NLS-1$
- }
- codeComplete(snippet, insertion, position, localVariableTypeNames, localVariableNames, localVariableModifiers, isStatic, new org.eclipse.wst.jsdt.internal.codeassist.CompletionRequestorWrapper(requestor), owner);
-}
/*
* @see IType#codeComplete(char[], int, int, char[][], char[][], int[], boolean, ICompletionRequestor)
*/
@@ -432,15 +413,6 @@
/*
* @see IType#getMethod(String name, String[] parameterTypeSignatures)
*/
-/**
- * @deprecated Use {@link #getFunction(String,String[])} instead
- */
-public IFunction getMethod(String selector, String[] parameterTypeSignatures) {
- return getFunction(selector, parameterTypeSignatures);
-}
-/*
- * @see IType#getMethod(String name, String[] parameterTypeSignatures)
- */
public IFunction getFunction(String selector, String[] parameterTypeSignatures) {
return new BinaryMethod(this, selector, parameterTypeSignatures);
}
@@ -787,30 +759,6 @@
op.runOperation(monitor);
return op.getResult();
}
-/**
- * @param workingCopies the working copies that take precedence over their original compilation units
- * @param monitor the given progress monitor
- * @return a type hierarchy for this type containing this type and all of its supertypes
- * @exception JavaScriptModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
- *
- * @see IType#newSupertypeHierarchy(IWorkingCopy[], IProgressMonitor)
- * @deprecated
- */
-public ITypeHierarchy newSupertypeHierarchy(
- IWorkingCopy[] workingCopies,
- IProgressMonitor monitor)
- throws JavaScriptModelException {
-
- IJavaScriptUnit[] copies;
- if (workingCopies == null) {
- copies = null;
- } else {
- int length = workingCopies.length;
- System.arraycopy(workingCopies, 0, copies = new IJavaScriptUnit[length], 0, length);
- }
- return newSupertypeHierarchy(copies, monitor);
-}
/*
* @see IType#newSupertypeHierarchy(WorkingCopyOwner, IProgressMonitor)
*/
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClassFile.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClassFile.java
index 387a104..5f07eeb 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClassFile.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClassFile.java
@@ -15,31 +15,26 @@
import java.net.URI;
import java.util.ArrayList;
import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
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.IStatus;
import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
import org.eclipse.wst.jsdt.core.CompletionRequestor;
import org.eclipse.wst.jsdt.core.IBuffer;
import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.ICompletionRequestor;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatus;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
import org.eclipse.wst.jsdt.core.IParent;
@@ -50,9 +45,9 @@
import org.eclipse.wst.jsdt.core.JavaScriptConventions;
import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
import org.eclipse.wst.jsdt.core.LibrarySuperType;
import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
import org.eclipse.wst.jsdt.internal.compiler.IProblemFactory;
import org.eclipse.wst.jsdt.internal.compiler.SourceElementParser;
import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
@@ -222,24 +217,6 @@
// ((ClassFileInfo) info).readBinaryChildren(this, (HashMap) newElements, typeInfo);
return true;
}
-/**
- * @see org.eclipse.wst.jsdt.core.ICodeAssist#codeComplete(int, ICompletionRequestor)
- * @deprecated
- */
-public void codeComplete(int offset, ICompletionRequestor requestor) throws JavaScriptModelException {
- codeComplete(offset, requestor, DefaultWorkingCopyOwner.PRIMARY);
-}
-/**
- * @see org.eclipse.wst.jsdt.core.ICodeAssist#codeComplete(int, ICompletionRequestor, WorkingCopyOwner)
- * @deprecated
- */
-public void codeComplete(int offset, ICompletionRequestor requestor, WorkingCopyOwner owner) throws JavaScriptModelException {
- if (requestor == null) {
- throw new IllegalArgumentException("Completion requestor cannot be null"); //$NON-NLS-1$
- }
- codeComplete(offset, new org.eclipse.wst.jsdt.internal.codeassist.CompletionRequestorWrapper(requestor), owner);
-}
-
/* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.ICodeAssist#codeComplete(int, org.eclipse.wst.jsdt.core.CompletionRequestor)
*/
@@ -350,32 +327,32 @@
public byte[] getBytes() throws JavaScriptModelException {
JavaElement pkg = (JavaElement) getParent();
- if (pkg instanceof JarPackageFragment) {
- JarPackageFragmentRoot root = (JarPackageFragmentRoot) pkg.getParent();
- ZipFile zip = null;
- try {
- zip = root.getJar();
- String entryName = Util.concatWith(((PackageFragment) pkg).names, getElementName(), '/');
- ZipEntry ze = zip.getEntry(entryName);
- if (ze != null) {
- return org.eclipse.wst.jsdt.internal.compiler.util.Util.getZipEntryByteContent(ze, zip);
- }
- throw new JavaScriptModelException(new JavaModelStatus(IJavaScriptModelStatusConstants.ELEMENT_DOES_NOT_EXIST, this));
- } catch (IOException ioe) {
- throw new JavaScriptModelException(ioe, IJavaScriptModelStatusConstants.IO_EXCEPTION);
- } catch (CoreException e) {
- if (e instanceof JavaScriptModelException) {
- throw (JavaScriptModelException)e;
- } else {
- throw new JavaScriptModelException(e);
- }
- } finally {
- JavaModelManager.getJavaModelManager().closeZipFile(zip);
- }
- } else {
+// if (pkg instanceof JarPackageFragment) {
+// JarPackageFragmentRoot root = (JarPackageFragmentRoot) pkg.getParent();
+// ZipFile zip = null;
+// try {
+// zip = root.getJar();
+// String entryName = Util.concatWith(((PackageFragment) pkg).names, getElementName(), '/');
+// ZipEntry ze = zip.getEntry(entryName);
+// if (ze != null) {
+// return org.eclipse.wst.jsdt.internal.compiler.util.Util.getZipEntryByteContent(ze, zip);
+// }
+// throw new JavaScriptModelException(new JavaModelStatus(IJavaScriptModelStatusConstants.ELEMENT_DOES_NOT_EXIST, this));
+// } catch (IOException ioe) {
+// throw new JavaScriptModelException(ioe, IJavaScriptModelStatusConstants.IO_EXCEPTION);
+// } catch (CoreException e) {
+// if (e instanceof JavaScriptModelException) {
+// throw (JavaScriptModelException)e;
+// } else {
+// throw new JavaScriptModelException(e);
+// }
+// } finally {
+// JavaModelManager.getJavaModelManager().closeZipFile(zip);
+// }
+// } else {
IFile file = (IFile) getResource();
return Util.getResourceContentsAsByteArray(file);
- }
+// }
}
public IBuffer getBuffer() throws JavaScriptModelException {
IStatus status = validateClassFile();
@@ -611,13 +588,6 @@
return workingCopy;
}
/**
- * @see IClassFile
- * @deprecated
- */
-public IJavaScriptElement getWorkingCopy(IProgressMonitor monitor, org.eclipse.wst.jsdt.core.IBufferFactory factory) throws JavaScriptModelException {
- return getWorkingCopy(BufferFactoryWrapper.create(factory), monitor);
-}
-/**
* @see Openable
*/
protected boolean hasBuffer() {
@@ -784,65 +754,6 @@
return className;
}
-/**
- * @see org.eclipse.wst.jsdt.core.ICodeAssist#codeComplete(int, org.eclipse.wst.jsdt.core.ICodeCompletionRequestor)
- * @deprecated - should use codeComplete(int, ICompletionRequestor) instead
- */
-public void codeComplete(int offset, final org.eclipse.wst.jsdt.core.ICodeCompletionRequestor requestor) throws JavaScriptModelException {
-
- if (requestor == null){
- codeComplete(offset, (ICompletionRequestor)null);
- return;
- }
- codeComplete(
- offset,
- new ICompletionRequestor(){
- public void acceptAnonymousType(char[] superTypePackageName,char[] superTypeName, char[][] parameterPackageNames,char[][] parameterTypeNames,char[][] parameterNames,char[] completionName,int modifiers,int completionStart,int completionEnd, int relevance) {
- // ignore
- }
- public void acceptClass(char[] packageName, char[] className, char[] completionName, int modifiers, int completionStart, int completionEnd, int relevance) {
- requestor.acceptClass(packageName, className, completionName, modifiers, completionStart, completionEnd);
- }
- public void acceptError(IProblem error) {
- // was disabled in 1.0
- }
- public void acceptField(char[] declaringTypePackageName, char[] declaringTypeName, char[] fieldName, char[] typePackageName, char[] typeName, char[] completionName, int modifiers, int completionStart, int completionEnd, int relevance) {
- requestor.acceptField(declaringTypePackageName, declaringTypeName, fieldName, typePackageName, typeName, completionName, modifiers, completionStart, completionEnd);
- }
- public void acceptInterface(char[] packageName,char[] interfaceName,char[] completionName,int modifiers,int completionStart,int completionEnd, int relevance) {
- requestor.acceptInterface(packageName, interfaceName, completionName, modifiers, completionStart, completionEnd);
- }
- public void acceptKeyword(char[] keywordName,int completionStart,int completionEnd, int relevance){
- requestor.acceptKeyword(keywordName, completionStart, completionEnd);
- }
- public void acceptLabel(char[] labelName,int completionStart,int completionEnd, int relevance){
- requestor.acceptLabel(labelName, completionStart, completionEnd);
- }
- public void acceptLocalVariable(char[] localVarName,char[] typePackageName,char[] typeName,int modifiers,int completionStart,int completionEnd, int relevance){
- // ignore
- }
- public void acceptMethod(char[] declaringTypePackageName,char[] declaringTypeName,char[] selector,char[][] parameterPackageNames,char[][] parameterTypeNames,char[][] parameterNames,char[] returnTypePackageName,char[] returnTypeName,char[] completionName,int modifiers,int completionStart,int completionEnd, int relevance){
- // skip parameter names
- requestor.acceptMethod(declaringTypePackageName, declaringTypeName, selector, parameterPackageNames, parameterTypeNames, returnTypePackageName, returnTypeName, completionName, modifiers, completionStart, completionEnd);
- }
- public void acceptMethodDeclaration(char[] declaringTypePackageName,char[] declaringTypeName,char[] selector,char[][] parameterPackageNames,char[][] parameterTypeNames,char[][] parameterNames,char[] returnTypePackageName,char[] returnTypeName,char[] completionName,int modifiers,int completionStart,int completionEnd, int relevance){
- // ignore
- }
- public void acceptModifier(char[] modifierName,int completionStart,int completionEnd, int relevance){
- requestor.acceptModifier(modifierName, completionStart, completionEnd);
- }
- public void acceptPackage(char[] packageName,char[] completionName,int completionStart,int completionEnd, int relevance){
- requestor.acceptPackage(packageName, completionName, completionStart, completionEnd);
- }
- public void acceptType(char[] packageName,char[] typeName,char[] completionName,int completionStart,int completionEnd, int relevance){
- requestor.acceptType(packageName, typeName, completionName, completionStart, completionEnd);
- }
- public void acceptVariableName(char[] typePackageName,char[] typeName,char[] varName,char[] completionName,int completionStart,int completionEnd, int relevance){
- // ignore
- }
- });
-}
-
/*
* @see IType#getField(String name)
*/
@@ -864,13 +775,6 @@
return array;
}
}
-/**
- * @deprecated Use {@link #getFunction(String,String[])} instead
- */
-public IFunction getMethod(String selector, String[] parameterTypeSignatures) {
- return getFunction(selector, parameterTypeSignatures);
-}
-
public IFunction getFunction(String selector, String[] parameterTypeSignatures) {
return new SourceMethod(this, selector, parameterTypeSignatures);
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClasspathEntry.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClasspathEntry.java
index e30d5d6..45d4fba 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClasspathEntry.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ClasspathEntry.java
@@ -1243,15 +1243,6 @@
}
/**
- * @see IIncludePathEntry
- * @deprecated
- */
- public IIncludePathEntry getResolvedEntry() {
-
- return JavaScriptCore.getResolvedIncludepathEntry(this);
- }
-
- /**
* Validate a given classpath and output location for a project, using the following rules:
* <ul>
* <li> Classpath entries cannot collide with each other; that is, all entry paths must be unique.
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnit.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnit.java
index 608e878..afff425 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnit.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/CompilationUnit.java
@@ -27,22 +27,19 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.PerformanceStats;
-import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
import org.eclipse.wst.jsdt.core.CompletionRequestor;
import org.eclipse.wst.jsdt.core.Flags;
import org.eclipse.wst.jsdt.core.IBuffer;
import org.eclipse.wst.jsdt.core.IBufferFactory;
-import org.eclipse.wst.jsdt.core.ICodeCompletionRequestor;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.ICompletionRequestor;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IImportContainer;
import org.eclipse.wst.jsdt.core.IImportDeclaration;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IPackageDeclaration;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
@@ -53,12 +50,12 @@
import org.eclipse.wst.jsdt.core.JavaScriptConventions;
import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
import org.eclipse.wst.jsdt.core.LibrarySuperType;
import org.eclipse.wst.jsdt.core.Signature;
import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.core.compiler.IProblem;
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.internal.compiler.IProblemFactory;
import org.eclipse.wst.jsdt.internal.compiler.SourceElementParser;
@@ -295,82 +292,6 @@
super.closing(info);
} // else the buffer of a working copy must remain open for the lifetime of the working copy
}
-/**
- * @see org.eclipse.wst.jsdt.core.ICodeAssist#codeComplete(int, ICompletionRequestor)
- * @deprecated
- */
-public void codeComplete(int offset, ICompletionRequestor requestor) throws JavaScriptModelException {
- codeComplete(offset, requestor, DefaultWorkingCopyOwner.PRIMARY);
-}
-/**
- * @see org.eclipse.wst.jsdt.core.ICodeAssist#codeComplete(int, ICompletionRequestor, WorkingCopyOwner)
- * @deprecated
- */
-public void codeComplete(int offset, ICompletionRequestor requestor, WorkingCopyOwner workingCopyOwner) throws JavaScriptModelException {
- if (requestor == null) {
- throw new IllegalArgumentException("Completion requestor cannot be null"); //$NON-NLS-1$
- }
- codeComplete(offset, new org.eclipse.wst.jsdt.internal.codeassist.CompletionRequestorWrapper(requestor), workingCopyOwner);
-}
-/**
- * @see org.eclipse.wst.jsdt.core.ICodeAssist#codeComplete(int, ICodeCompletionRequestor)
- * @deprecated - use codeComplete(int, ICompletionRequestor)
- */
-public void codeComplete(int offset, final ICodeCompletionRequestor requestor) throws JavaScriptModelException {
-
- if (requestor == null){
- codeComplete(offset, (ICompletionRequestor)null);
- return;
- }
- codeComplete(
- offset,
- new ICompletionRequestor(){
- public void acceptAnonymousType(char[] superTypePackageName,char[] superTypeName,char[][] parameterPackageNames,char[][] parameterTypeNames,char[][] parameterNames,char[] completionName,int modifiers,int completionStart,int completionEnd, int relevance){
- // ignore
- }
- public void acceptClass(char[] packageName, char[] className, char[] completionName, int modifiers, int completionStart, int completionEnd, int relevance) {
- requestor.acceptClass(packageName, className, completionName, modifiers, completionStart, completionEnd);
- }
- public void acceptError(IProblem error) {
- // was disabled in 1.0
- }
- public void acceptField(char[] declaringTypePackageName, char[] declaringTypeName, char[] fieldName, char[] typePackageName, char[] typeName, char[] completionName, int modifiers, int completionStart, int completionEnd, int relevance) {
- requestor.acceptField(declaringTypePackageName, declaringTypeName, fieldName, typePackageName, typeName, completionName, modifiers, completionStart, completionEnd);
- }
- public void acceptInterface(char[] packageName,char[] interfaceName,char[] completionName,int modifiers,int completionStart,int completionEnd, int relevance) {
- requestor.acceptInterface(packageName, interfaceName, completionName, modifiers, completionStart, completionEnd);
- }
- public void acceptKeyword(char[] keywordName,int completionStart,int completionEnd, int relevance){
- requestor.acceptKeyword(keywordName, completionStart, completionEnd);
- }
- public void acceptLabel(char[] labelName,int completionStart,int completionEnd, int relevance){
- requestor.acceptLabel(labelName, completionStart, completionEnd);
- }
- public void acceptLocalVariable(char[] localVarName,char[] typePackageName,char[] typeName,int modifiers,int completionStart,int completionEnd, int relevance){
- // ignore
- }
- public void acceptMethod(char[] declaringTypePackageName,char[] declaringTypeName,char[] selector,char[][] parameterPackageNames,char[][] parameterTypeNames,char[][] parameterNames,char[] returnTypePackageName,char[] returnTypeName,char[] completionName,int modifiers,int completionStart,int completionEnd, int relevance){
- // skip parameter names
- requestor.acceptMethod(declaringTypePackageName, declaringTypeName, selector, parameterPackageNames, parameterTypeNames, returnTypePackageName, returnTypeName, completionName, modifiers, completionStart, completionEnd);
- }
- public void acceptMethodDeclaration(char[] declaringTypePackageName,char[] declaringTypeName,char[] selector,char[][] parameterPackageNames,char[][] parameterTypeNames,char[][] parameterNames,char[] returnTypePackageName,char[] returnTypeName,char[] completionName,int modifiers,int completionStart,int completionEnd, int relevance){
- // ignore
- }
- public void acceptModifier(char[] modifierName,int completionStart,int completionEnd, int relevance){
- requestor.acceptModifier(modifierName, completionStart, completionEnd);
- }
- public void acceptPackage(char[] packageName,char[] completionName,int completionStart,int completionEnd, int relevance){
- requestor.acceptPackage(packageName, completionName, completionStart, completionEnd);
- }
- public void acceptType(char[] packageName,char[] typeName,char[] completionName,int completionStart,int completionEnd, int relevance){
- requestor.acceptType(packageName, typeName, completionName, completionStart, completionEnd);
- }
- public void acceptVariableName(char[] typePackageName,char[] typeName,char[] varName,char[] completionName,int completionStart,int completionEnd, int relevance){
- // ignore
- }
- });
-}
-
/* (non-Javadoc)
* @see org.eclipse.wst.jsdt.core.ICodeAssist#codeComplete(int, org.eclipse.wst.jsdt.core.CompletionRequestor)
*/
@@ -1384,13 +1305,6 @@
return array;
}
-/**
- * @deprecated Use {@link #getFunction(String,String[])} instead
- */
-public IFunction getMethod(String selector, String[] parameterTypeSignatures) {
- return getFunction(selector, parameterTypeSignatures);
-}
-
public IFunction getFunction(String selector, String[] parameterTypeSignatures) {
return new SourceMethod(this, selector, parameterTypeSignatures);
}
@@ -1463,13 +1377,6 @@
return null;
}
-/**
- * @deprecated Use {@link #findFunctions(IFunction)} instead
- */
-public IFunction[] findMethods(IFunction method) {
- return findFunctions(method);
-}
-
public IFunction[] findFunctions(IFunction method) {
ArrayList list = new ArrayList();
try {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeleteResourceElementsOperation.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeleteResourceElementsOperation.java
index ec95cf2..431adea 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeleteResourceElementsOperation.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeleteResourceElementsOperation.java
@@ -130,8 +130,8 @@
int type = element.getElementType();
if (type <= IJavaScriptElement.PACKAGE_FRAGMENT_ROOT || type > IJavaScriptElement.JAVASCRIPT_UNIT)
error(IJavaScriptModelStatusConstants.INVALID_ELEMENT_TYPES, element);
- else if (type == IJavaScriptElement.PACKAGE_FRAGMENT && element instanceof JarPackageFragment)
- error(IJavaScriptModelStatusConstants.INVALID_ELEMENT_TYPES, element);
+// else if (type == IJavaScriptElement.PACKAGE_FRAGMENT && element instanceof JarPackageFragment)
+// error(IJavaScriptModelStatusConstants.INVALID_ELEMENT_TYPES, element);
IResource resource = element.getResource();
if (resource instanceof IFolder) {
if (resource.isLinked()) {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeltaProcessor.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeltaProcessor.java
index afca49f..6c84e7d 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeltaProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DeltaProcessor.java
@@ -36,8 +36,8 @@
import org.eclipse.core.runtime.PerformanceStats;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.wst.jsdt.core.ElementChangedEvent;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
import org.eclipse.wst.jsdt.core.IElementChangedListener;
+import org.eclipse.wst.jsdt.core.IIncludePathEntry;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptElementDelta;
import org.eclipse.wst.jsdt.core.IJavaScriptModel;
@@ -659,12 +659,12 @@
} else {
close(element);
int flags = IJavaScriptElementDelta.F_CONTENT;
- if (element instanceof JarPackageFragmentRoot){
- flags |= IJavaScriptElementDelta.F_ARCHIVE_CONTENT_CHANGED;
- // need also to reset project cache otherwise it will be out-of-date
- // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=162621
- this.projectCachesToReset.add(element.getJavaScriptProject());
- }
+// if (element instanceof JarPackageFragmentRoot){
+// flags |= IJavaScriptElementDelta.F_ARCHIVE_CONTENT_CHANGED;
+// // need also to reset project cache otherwise it will be out-of-date
+// // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=162621
+// this.projectCachesToReset.add(element.getJavaScriptProject());
+// }
if (isPrimary) {
flags |= IJavaScriptElementDelta.F_PRIMARY_RESOURCE;
}
@@ -2424,7 +2424,7 @@
break;
case IJavaScriptElement.PACKAGE_FRAGMENT_ROOT :
if (element instanceof LibraryFragmentRoot) {
- JarPackageFragmentRoot root = (JarPackageFragmentRoot)element;
+ LibraryFragmentRoot root = (LibraryFragmentRoot)element;
// index jar file only once (if the root is in its declaring project)
IPath jarPath = root.getPath();
switch (delta.getKind()) {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DocumentContextFragment.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DocumentContextFragment.java
index 44438f2..0366685 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DocumentContextFragment.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/DocumentContextFragment.java
@@ -164,16 +164,6 @@
/* (non-Javadoc)
* @see org.eclipse.wst.jsdt.internal.core.PackageFragment#getCompilationUnit(java.lang.String)
*/
- /**
- * @deprecated Use {@link #getJavaScriptUnit(String)} instead
- */
- public IJavaScriptUnit getCompilationUnit(String cuName) {
- return getJavaScriptUnit(cuName);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.core.PackageFragment#getCompilationUnit(java.lang.String)
- */
public IJavaScriptUnit getJavaScriptUnit(String cuName) {
return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY);
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ElementCache.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ElementCache.java
index 10d2191..d31ad32 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ElementCache.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/ElementCache.java
@@ -47,13 +47,13 @@
return false;
} else {
// We must close an entire JarPackageFragmentRoot at once.
- if (element instanceof JarPackageFragment) {
- JarPackageFragment packageFragment= (JarPackageFragment) element;
- JarPackageFragmentRoot root = (JarPackageFragmentRoot) packageFragment.getParent();
- root.close();
- } else {
+// if (element instanceof JarPackageFragment) {
+// JarPackageFragment packageFragment= (JarPackageFragment) element;
+// JarPackageFragmentRoot root = (JarPackageFragmentRoot) packageFragment.getParent();
+// root.close();
+// } else {
element.close();
- }
+// }
return true;
}
} catch (JavaScriptModelException npe) {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarEntryDirectory.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarEntryDirectory.java
deleted file mode 100644
index b673f9f..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarEntryDirectory.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.core;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.IJarEntryResource;
-
-public class JarEntryDirectory extends JarEntryResource {
- private IJarEntryResource[] children;
-
- public JarEntryDirectory(String simpleName) {
- super(simpleName);
- }
-
- public JarEntryResource clone(Object newParent) {
- JarEntryDirectory dir = new JarEntryDirectory(this.simpleName);
- dir.setParent(newParent);
- int length = this.children.length;
- if (length > 0) {
- IJarEntryResource[] newChildren = new IJarEntryResource[length];
- for (int i = 0; i < length; i++) {
- JarEntryResource child = (JarEntryResource) this.children[i];
- newChildren[i] = child.clone(dir);
- }
- dir.setChildren(newChildren);
- }
- return dir;
- }
-
- public IJarEntryResource[] getChildren() {
- return this.children;
- }
-
- public InputStream getContents() throws CoreException {
- return new ByteArrayInputStream(new byte[0]);
- }
-
- public boolean isFile() {
- return false;
- }
-
- public void setChildren(IJarEntryResource[] children) {
- this.children = children;
- }
-
- public String toString() {
- return "JarEntryDirectory["+getEntryName()+"]"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarEntryFile.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarEntryFile.java
deleted file mode 100644
index a68637d..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarEntryFile.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.core;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.IJarEntryResource;
-import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.compiler.util.Util;
-
-/**
- * A jar entry that represents a non-java file found in a JAR.
- *
- * @see org.eclipse.core.resources.IStorage
- */
-public class JarEntryFile extends JarEntryResource {
- private static final IJarEntryResource[] NO_CHILDREN = new IJarEntryResource[0];
-
- public JarEntryFile(String simpleName) {
- super(simpleName);
- }
-
- public JarEntryResource clone(Object newParent) {
- JarEntryFile file = new JarEntryFile(simpleName);
- file.setParent(newParent);
- return file;
- }
-
- public InputStream getContents() throws CoreException {
- ZipFile zipFile = null;
- try {
- zipFile = getZipFile();
- if (JavaModelManager.ZIP_ACCESS_VERBOSE) {
- System.out.println("(" + Thread.currentThread() + ") [JarEntryFile.getContents()] Creating ZipFile on " +zipFile.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- String entryName = getEntryName();
- ZipEntry zipEntry = zipFile.getEntry(entryName);
- if (zipEntry == null){
- throw new JavaScriptModelException(new JavaModelStatus(IJavaScriptModelStatusConstants.INVALID_PATH, entryName));
- }
- byte[] contents = Util.getZipEntryByteContent(zipEntry, zipFile);
- return new ByteArrayInputStream(contents);
- } catch (IOException e){
- throw new JavaScriptModelException(e, IJavaScriptModelStatusConstants.IO_EXCEPTION);
- } finally {
- // avoid leaking ZipFiles
- JavaModelManager.getJavaModelManager().closeZipFile(zipFile);
- }
- }
-
- public IJarEntryResource[] getChildren() {
- return NO_CHILDREN;
- }
-
- public boolean isFile() {
- return true;
- }
-
- public String toString() {
- return "JarEntryFile["+getEntryName()+"]"; //$NON-NLS-2$ //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarEntryResource.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarEntryResource.java
deleted file mode 100644
index c2349b4..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarEntryResource.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.core;
-
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.wst.jsdt.core.IJarEntryResource;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.internal.core.util.Util;
-
-public abstract class JarEntryResource extends PlatformObject implements IJarEntryResource {
-
- protected Object parent;
- protected String simpleName;
-
- public JarEntryResource(String simpleName) {
- this.simpleName = simpleName;
- }
-
- public abstract JarEntryResource clone(Object newParent);
-
- public boolean equals(Object obj) {
- if (! (obj instanceof JarEntryResource))
- return false;
- JarEntryResource other = (JarEntryResource) obj;
- return this.parent.equals(other.parent) && this.simpleName.equals(other.simpleName);
- }
-
- protected String getEntryName() {
- String parentEntryName;
- if (this.parent instanceof IPackageFragment) {
- String elementName = ((IPackageFragment) this.parent).getElementName();
- parentEntryName = elementName.length() == 0 ? "" : elementName .replace('.', '/') + '/'; //$NON-NLS-1$
- } else if (this.parent instanceof IPackageFragmentRoot) {
- parentEntryName = ""; //$NON-NLS-1$
- } else {
- parentEntryName = ((JarEntryDirectory) this.parent).getEntryName() + '/';
- }
- return parentEntryName + this.simpleName;
- }
-
- public IPath getFullPath() {
- return new Path(getEntryName()).makeAbsolute();
- }
-
- public String getName() {
- return this.simpleName;
- }
-
- public Object getParent() {
- return this.parent;
- }
-
- public IPackageFragmentRoot getPackageFragmentRoot() {
- if (this.parent instanceof IPackageFragment) {
- return (IPackageFragmentRoot) ((IPackageFragment) this.parent).getParent();
- } else if (this.parent instanceof IPackageFragmentRoot) {
- return (IPackageFragmentRoot) this.parent;
- } else {
- return ((JarEntryDirectory) this.parent).getPackageFragmentRoot();
- }
- }
-
- protected ZipFile getZipFile() throws CoreException {
- if (this.parent instanceof IPackageFragment) {
- JarPackageFragmentRoot root = (JarPackageFragmentRoot) ((IPackageFragment) this.parent).getParent();
- return root.getJar();
- } else if (this.parent instanceof JarPackageFragmentRoot) {
- return ((JarPackageFragmentRoot) this.parent).getJar();
- } else
- return ((JarEntryDirectory) this.parent).getZipFile();
- }
-
- public int hashCode() {
- return Util.combineHashCodes(this.simpleName.hashCode(), this.parent.hashCode());
- }
-
- public boolean isReadOnly() {
- return true;
- }
-
- public void setParent(Object parent) {
- this.parent = parent;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragment.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragment.java
deleted file mode 100644
index 5767d1d..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragment.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.core;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJarEntryResource;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.compiler.util.SuffixConstants;
-import org.eclipse.wst.jsdt.internal.core.util.Util;
-
-/**
- * A package fragment that represents a package fragment found in a JAR.
- *
- * @see org.eclipse.wst.jsdt.core.IPackageFragment
- */
-class JarPackageFragment extends PackageFragment implements SuffixConstants {
-/**
- * Constructs a package fragment that is contained within a jar or a zip.
- */
-protected JarPackageFragment(PackageFragmentRoot root, String[] names) {
- super(root, names);
-}
-/**
- * Compute the children of this package fragment. Children of jar package fragments
- * can only be IClassFile (representing .class files).
- */
-protected boolean computeChildren(OpenableElementInfo info, ArrayList entryNames) {
- if (entryNames != null && entryNames.size() > 0) {
- ArrayList vChildren = new ArrayList();
- for (Iterator iter = entryNames.iterator(); iter.hasNext();) {
- String child = (String) iter.next();
- IClassFile classFile = getClassFile(child);
- vChildren.add(classFile);
- }
- IJavaScriptElement[] children= new IJavaScriptElement[vChildren.size()];
- vChildren.toArray(children);
- info.setChildren(children);
- } else {
- info.setChildren(NO_ELEMENTS);
- }
- return true;
-}
-/**
- * Compute all the non-java resources according to the entry name found in the jar file.
- */
-/* package */ void computeNonJavaResources(String[] resNames, JarPackageFragment pkg, JarPackageFragmentInfo info, String zipName) {
- if (resNames == null) {
- info.setNonJavaResources(null);
- return;
- }
- int max = resNames.length;
- if (max == 0) {
- info.setNonJavaResources(JavaElementInfo.NO_NON_JAVA_RESOURCES);
- } else {
- HashMap jarEntries = new HashMap(); // map from IPath to IJarEntryResource
- HashMap childrenMap = new HashMap(); // map from IPath to ArrayList<IJarEntryResource>
- ArrayList topJarEntries = new ArrayList();
- for (int i = 0; i < max; i++) {
- String resName = resNames[i];
- // consider that a .java file is not a non-java resource (see bug 12246 Packages view shows .class and .java files when JAR has source)
- if (!Util.isJavaLikeFileName(resName)) {
- IPath filePath = new Path(resName);
- IPath childPath = filePath.removeFirstSegments(this.names.length);
- JarEntryFile file = new JarEntryFile(filePath.lastSegment());
- jarEntries.put(childPath, file);
- if (childPath.segmentCount() == 1) {
- file.setParent(pkg);
- topJarEntries.add(file);
- } else {
- IPath parentPath = childPath.removeLastSegments(1);
- while (parentPath.segmentCount() > 0) {
- ArrayList parentChildren = (ArrayList) childrenMap.get(parentPath);
- if (parentChildren == null) {
- Object dir = new JarEntryDirectory(parentPath.lastSegment());
- jarEntries.put(parentPath, dir);
- childrenMap.put(parentPath, parentChildren = new ArrayList());
- parentChildren.add(childPath);
- if (parentPath.segmentCount() == 1) {
- topJarEntries.add(dir);
- break;
- }
- childPath = parentPath;
- parentPath = childPath.removeLastSegments(1);
- } else {
- parentChildren.add(childPath);
- break; // all parents are already registered
- }
- }
- }
- }
- }
- Iterator entries = childrenMap.entrySet().iterator();
- while (entries.hasNext()) {
- Map.Entry entry = (Map.Entry) entries.next();
- IPath entryPath = (IPath) entry.getKey();
- ArrayList entryValue = (ArrayList) entry.getValue();
- JarEntryDirectory jarEntryDirectory = (JarEntryDirectory) jarEntries.get(entryPath);
- int size = entryValue.size();
- IJarEntryResource[] children = new IJarEntryResource[size];
- for (int i = 0; i < size; i++) {
- JarEntryResource child = (JarEntryResource) jarEntries.get(entryValue.get(i));
- child.setParent(jarEntryDirectory);
- children[i] = child;
- }
- jarEntryDirectory.setChildren(children);
- if (entryPath.segmentCount() == 1) {
- jarEntryDirectory.setParent(pkg);
- }
- }
- Object[] res = topJarEntries.toArray(new Object[topJarEntries.size()]);
- info.setNonJavaResources(res);
- }
-}
-/**
- * Returns true if this fragment contains at least one java resource.
- * Returns false otherwise.
- */
-public boolean containsJavaResources() throws JavaScriptModelException {
- return ((JarPackageFragmentInfo) getElementInfo()).containsJavaResources();
-}
-/**
- * @see org.eclipse.wst.jsdt.core.IPackageFragment
- */
-public IJavaScriptUnit createCompilationUnit(String cuName, String contents, boolean force, IProgressMonitor monitor) throws JavaScriptModelException {
- throw new JavaScriptModelException(new JavaModelStatus(IJavaScriptModelStatusConstants.READ_ONLY, this));
-}
-/**
- * @see JavaElement
- */
-protected Object createElementInfo() {
- return null; // not used for JarPackageFragments: info is created when jar is opened
-}
-/*
- * @see JavaElement#generateInfos
- */
-protected void generateInfos(Object info, HashMap newElements, IProgressMonitor pm) throws JavaScriptModelException {
- // Open my jar: this creates all the pkg infos
- Openable openableParent = (Openable)this.parent;
- if (!openableParent.isOpen()) {
- openableParent.generateInfos(openableParent.createElementInfo(), newElements, pm);
- }
-}
-/**
- * @see org.eclipse.wst.jsdt.core.IPackageFragment
- */
-public IClassFile[] getClassFiles() throws JavaScriptModelException {
- ArrayList list = getChildrenOfType(CLASS_FILE);
- IClassFile[] array= new IClassFile[list.size()];
- list.toArray(array);
- return array;
-}
-/**
- * A jar package fragment never contains compilation units.
- * @see org.eclipse.wst.jsdt.core.IPackageFragment
- * @deprecated Use {@link #getJavaScriptUnits()} instead
- */
-public IJavaScriptUnit[] getCompilationUnits() {
- return getJavaScriptUnits();
-}
-/**
- * A jar package fragment never contains compilation units.
- * @see org.eclipse.wst.jsdt.core.IPackageFragment
- */
-public IJavaScriptUnit[] getJavaScriptUnits() {
- return NO_COMPILATION_UNITS;
-}
-/**
- * A package fragment in a jar has no corresponding resource.
- *
- * @see IJavaScriptElement
- */
-public IResource getCorrespondingResource() {
- return null;
-}
-/**
- * Returns an array of non-java resources contained in the receiver.
- */
-public Object[] getNonJavaScriptResources() throws JavaScriptModelException {
- if (this.isDefaultPackage()) {
- // We don't want to show non java resources of the default package (see PR #1G58NB8)
- return JavaElementInfo.NO_NON_JAVA_RESOURCES;
- } else {
- return this.storedNonJavaResources();
- }
-}
-/**
- * Jars and jar entries are all read only
- */
-public boolean isReadOnly() {
- return true;
-}
-protected Object[] storedNonJavaResources() throws JavaScriptModelException {
- return ((JarPackageFragmentInfo) getElementInfo()).getNonJavaResources();
-}
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragmentInfo.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragmentInfo.java
deleted file mode 100644
index 7eb1e35..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragmentInfo.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.core;
-
-/**
- * Element info for JarPackageFragments.
- */
-class JarPackageFragmentInfo extends PackageFragmentInfo {
-/**
- * Returns an array of non-java resources contained in the receiver.
- */
-Object[] getNonJavaResources() {
- return this.nonJavaResources;
-}
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragmentRoot.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragmentRoot.java
deleted file mode 100644
index 0b7d192..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragmentRoot.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.core;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.internal.core.util.HashtableOfArrayToObject;
-import org.eclipse.wst.jsdt.internal.core.util.Util;
-
-/**
- * A package fragment root that corresponds to a .jar or .zip.
- *
- * <p>NOTE: The only visible entries from a .jar or .zip package fragment root
- * are .class files.
- * <p>NOTE: A jar package fragment root may or may not have an associated resource.
- *
- * @see org.eclipse.wst.jsdt.core.IPackageFragmentRoot
- * @see org.eclipse.wst.jsdt.internal.core.JarPackageFragmentRootInfo
- */
-public class JarPackageFragmentRoot extends PackageFragmentRoot {
-
- public final static ArrayList EMPTY_LIST = new ArrayList();
-
- /**
- * The path to the jar file
- * (a workspace relative path if the jar is internal,
- * or an OS path if the jar is external)
- */
- protected final IPath jarPath;
-
- /**
- * Constructs a package fragment root which is the root of the Java package directory hierarchy
- * based on a JAR file that is not contained in a <code>IJavaScriptProject</code> and
- * does not have an associated <code>IResource</code>.
- */
- protected JarPackageFragmentRoot(IPath jarPath, JavaProject project) {
- super(null, project);
- this.jarPath = jarPath;
- }
- /**
- * Constructs a package fragment root which is the root of the Java package directory hierarchy
- * based on a JAR file.
- */
- protected JarPackageFragmentRoot(IResource resource, JavaProject project) {
- super(resource, project);
- this.jarPath = resource.getFullPath();
- }
-
- /**
- * Compute the package fragment children of this package fragment root.
- * These are all of the directory zip entries, and any directories implied
- * by the path of class files contained in the jar of this package fragment root.
- * Has the side effect of opening the package fragment children.
- */
- protected boolean computeChildren(OpenableElementInfo info, Map newElements) throws JavaScriptModelException {
-
- ArrayList vChildren= new ArrayList();
- final int JAVA = 0;
- final int NON_JAVA = 1;
- ZipFile jar= null;
- try {
- jar= getJar();
-
- HashtableOfArrayToObject packageFragToTypes= new HashtableOfArrayToObject();
-
- // always create the default package
- packageFragToTypes.put(CharOperation.NO_STRINGS, new ArrayList[] { EMPTY_LIST, EMPTY_LIST });
-
- for (Enumeration e= jar.entries(); e.hasMoreElements();) {
- ZipEntry member= (ZipEntry) e.nextElement();
- initPackageFragToTypes(packageFragToTypes, member.getName(), member.isDirectory());
- }
-
- //loop through all of referenced packages, creating package fragments if necessary
- // and cache the entry names in the infos created for those package fragments
- for (int i = 0, length = packageFragToTypes.keyTable.length; i < length; i++) {
- String[] pkgName = (String[]) packageFragToTypes.keyTable[i];
- if (pkgName == null) continue;
-
- ArrayList[] entries= (ArrayList[]) packageFragToTypes.get(pkgName);
- JarPackageFragment packFrag= (JarPackageFragment) getPackageFragment(pkgName);
- JarPackageFragmentInfo fragInfo= new JarPackageFragmentInfo();
- int resLength= entries[NON_JAVA].size();
- if (resLength == 0) {
- packFrag.computeNonJavaResources(CharOperation.NO_STRINGS, packFrag, fragInfo, jar.getName());
- } else {
- String[] resNames= new String[resLength];
- entries[NON_JAVA].toArray(resNames);
- packFrag.computeNonJavaResources(resNames, packFrag, fragInfo, jar.getName());
- }
- packFrag.computeChildren(fragInfo, entries[JAVA]);
- newElements.put(packFrag, fragInfo);
- vChildren.add(packFrag);
- }
- } catch (CoreException e) {
- if (e instanceof JavaScriptModelException) throw (JavaScriptModelException)e;
- throw new JavaScriptModelException(e);
- } finally {
- JavaModelManager.getJavaModelManager().closeZipFile(jar);
- }
-
-
- IJavaScriptElement[] children= new IJavaScriptElement[vChildren.size()];
- vChildren.toArray(children);
- info.setChildren(children);
- return true;
- }
- /**
- * Returns a new element info for this element.
- */
- protected Object createElementInfo() {
- return new JarPackageFragmentRootInfo();
- }
- /**
- * A Jar is always K_BINARY.
- */
- protected int determineKind(IResource underlyingResource) {
- return IPackageFragmentRoot.K_BINARY;
- }
- /**
- * Returns true if this handle represents the same jar
- * as the given handle. Two jars are equal if they share
- * the same zip file.
- *
- * @see Object#equals
- */
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o instanceof JarPackageFragmentRoot) {
- JarPackageFragmentRoot other= (JarPackageFragmentRoot) o;
- return this.jarPath.equals(other.jarPath);
- }
- return false;
- }
- public String getElementName() {
- return this.jarPath.lastSegment();
- }
- /**
- * Returns the underlying ZipFile for this Jar package fragment root.
- *
- * @exception CoreException if an error occurs accessing the jar
- */
- public ZipFile getJar() throws CoreException {
- return JavaModelManager.getJavaModelManager().getZipFile(getPath());
- }
- /**
- * @see IPackageFragmentRoot
- */
- public int getKind() {
- return IPackageFragmentRoot.K_BINARY;
- }
- /**
- * Returns an array of non-java resources contained in the receiver.
- */
- public Object[] getNonJavaScriptResources() throws JavaScriptModelException {
- // We want to show non java resources of the default package at the root (see PR #1G58NB8)
- Object[] defaultPkgResources = ((JarPackageFragment) getPackageFragment(CharOperation.NO_STRINGS)).storedNonJavaResources();
- int length = defaultPkgResources.length;
- if (length == 0)
- return defaultPkgResources;
- Object[] nonJavaResources = new Object[length];
- for (int i = 0; i < length; i++) {
- JarEntryResource nonJavaResource = (JarEntryResource) defaultPkgResources[i];
- nonJavaResources[i] = nonJavaResource.clone(this);
- }
- return nonJavaResources;
- }
- public PackageFragment getPackageFragment(String[] pkgName) {
- return new JarPackageFragment(this, pkgName);
- }
- /**
- * @see IPackageFragmentRoot
- */
- public IPath getPath() {
- if (isExternal()) {
- return this.jarPath;
- } else {
- return super.getPath();
- }
- }
- public IResource getResource() {
- if (this.resource == null) {
- this.resource = JavaModel.getTarget(ResourcesPlugin.getWorkspace().getRoot(), this.jarPath, false);
- }
- if (this.resource instanceof IResource) {
- return super.getResource();
- } else {
- // external jar
- return null;
- }
- }
-
-
- /**
- * @see IJavaScriptElement
- */
- public IResource getUnderlyingResource() throws JavaScriptModelException {
- if (isExternal()) {
- if (!exists()) throw newNotPresentException();
- return null;
- } else {
- return super.getUnderlyingResource();
- }
- }
- public int hashCode() {
- return this.jarPath.hashCode();
- }
- private void initPackageFragToTypes(HashtableOfArrayToObject packageFragToTypes, String entryName, boolean isDirectory) {
- int lastSeparator = isDirectory ? entryName.length()-1 : entryName.lastIndexOf('/');
- String[] pkgName = Util.splitOn('/', entryName, 0, lastSeparator);
- String[] existing = null;
- int length = pkgName.length;
- int existingLength = length;
- while (existingLength >= 0) {
- existing = (String[]) packageFragToTypes.getKey(pkgName, existingLength);
- if (existing != null) break;
- existingLength--;
- }
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- IJavaScriptProject project = getJavaScriptProject();
- for (int i = existingLength; i < length; i++) {
- if (Util.isValidFolderNameForPackage(pkgName[i], project.getOption(JavaScriptCore.COMPILER_SOURCE, true), project.getOption(JavaScriptCore.COMPILER_COMPLIANCE, true))) {
- System.arraycopy(existing, 0, existing = new String[i+1], 0, i);
- existing[i] = manager.intern(pkgName[i]);
- packageFragToTypes.put(existing, new ArrayList[] { EMPTY_LIST, EMPTY_LIST });
- } else {
- // non-Java resource folder
- if (!isDirectory) {
- ArrayList[] children = (ArrayList[]) packageFragToTypes.get(existing);
- if (children[1/*NON_JAVA*/] == EMPTY_LIST) children[1/*NON_JAVA*/] = new ArrayList();
- children[1/*NON_JAVA*/].add(entryName);
- }
- return;
- }
- }
- if (isDirectory)
- return;
-
- // add classfile info amongst children
- ArrayList[] children = (ArrayList[]) packageFragToTypes.get(pkgName);
- if (org.eclipse.wst.jsdt.internal.compiler.util.Util.isClassFileName(entryName)) {
- if (children[0/*JAVA*/] == EMPTY_LIST) children[0/*JAVA*/] = new ArrayList();
- String fileName = entryName.substring(lastSeparator + 1);
- children[0/*JAVA*/].add(fileName);
- } else {
- if (children[1/*NON_JAVA*/] == EMPTY_LIST) children[1/*NON_JAVA*/] = new ArrayList();
- children[1/*NON_JAVA*/].add(entryName);
- }
-
- }
- /**
- * @see IPackageFragmentRoot
- */
- public boolean isArchive() {
- return true;
- }
- /**
- * @see IPackageFragmentRoot
- */
- public boolean isExternal() {
- return getResource() == null;
- }
- /**
- * Jars and jar entries are all read only
- */
- public boolean isReadOnly() {
- return true;
- }
-
- /**
- * Returns whether the corresponding resource or associated file exists
- */
-protected boolean resourceExists() {
- if (this.isExternal()) {
- return
- JavaModel.getTarget(
- ResourcesPlugin.getWorkspace().getRoot(),
- this.getPath(), // don't make the path relative as this is an external archive
- true) != null;
- } else {
- return super.resourceExists();
- }
-}
-protected void toStringAncestors(StringBuffer buffer) {
- if (isExternal())
- // don't show project as it is irrelevant for external jar files.
- // also see https://bugs.eclipse.org/bugs/show_bug.cgi?id=146615
- return;
- super.toStringAncestors(buffer);
-}
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragmentRootInfo.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragmentRootInfo.java
deleted file mode 100644
index 8f0c90d..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JarPackageFragmentRootInfo.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.core;
-
-/**
- * The element info for <code>JarPackageFragmentRoot</code>s.
- */
-class JarPackageFragmentRootInfo extends PackageFragmentRootInfo {
-/**
- * Returns an array of non-java resources contained in the receiver.
- */
-public Object[] getNonJavaResources() {
- fNonJavaResources = NO_NON_JAVA_RESOURCES;
- return fNonJavaResources;
-}
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelManager.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelManager.java
index 1615b73..1b33eba 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelManager.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelManager.java
@@ -82,18 +82,17 @@
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
import org.eclipse.wst.jsdt.core.IAccessRule;
import org.eclipse.wst.jsdt.core.IClassFile;
import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
-import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptModel;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatus;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
import org.eclipse.wst.jsdt.core.IParent;
@@ -102,10 +101,11 @@
import org.eclipse.wst.jsdt.core.JavaScriptConventions;
import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
+import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer;
import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
-import org.eclipse.wst.jsdt.core.compiler.ValidationParticipant;
import org.eclipse.wst.jsdt.core.compiler.IProblem;
+import org.eclipse.wst.jsdt.core.compiler.ValidationParticipant;
import org.eclipse.wst.jsdt.core.compiler.libraries.LibraryLocation;
import org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.wst.jsdt.internal.codeassist.CompletionEngine;
@@ -3007,11 +3007,11 @@
for(Iterator it = newElements.entrySet().iterator(); it.hasNext(); ) {
Map.Entry entry = (Map.Entry)it.next();
IJavaScriptElement element = (IJavaScriptElement)entry.getKey();
- if( element instanceof JarPackageFragmentRoot || element instanceof LibraryFragmentRoot ){
- Object info = entry.getValue();
- it.remove();
- this.cache.putInfo(element, info);
- }
+// if( element instanceof JarPackageFragmentRoot || element instanceof LibraryFragmentRoot ){
+// Object info = entry.getValue();
+// it.remove();
+// this.cache.putInfo(element, info);
+// }
}
Iterator iterator = newElements.entrySet().iterator();
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelStatus.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelStatus.java
index b41aa38..b01ebfa 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelStatus.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaModelStatus.java
@@ -412,13 +412,6 @@
return severity;
}
/**
- * @see IJavaScriptModelStatus#getString()
- * @deprecated
- */
- public String getString() {
- return string;
- }
- /**
* @see IJavaScriptModelStatus#isDoesNotExist()
*/
public boolean isDoesNotExist() {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaProject.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaProject.java
index 61b3e8e..65a47c8 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaProject.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaProject.java
@@ -55,14 +55,14 @@
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptModelMarker;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatus;
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
import org.eclipse.wst.jsdt.core.IRegion;
@@ -643,7 +643,7 @@
}
else
{
- root = new JarPackageFragmentRoot(entryPath, this);
+// root = new JarPackageFragmentRoot(entryPath, this);
}
}
@@ -1770,7 +1770,7 @@
switch (resource.getType()) {
case IResource.FILE:
if (org.eclipse.wst.jsdt.internal.compiler.util.Util.isArchiveFileName(resource.getName())) {
- return new JarPackageFragmentRoot(resource, this);
+// return new JarPackageFragmentRoot(resource, this);
} else {
return null;
}
@@ -1821,14 +1821,6 @@
/**
* @see IJavaScriptProject
- * @deprecated
- */
- public IPackageFragmentRoot[] getPackageFragmentRoots(IIncludePathEntry entry) {
- return findPackageFragmentRoots(entry);
- }
-
- /**
- * @see IJavaScriptProject
*/
public IPackageFragment[] getPackageFragments() throws JavaScriptModelException {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaProjectElementInfo.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaProjectElementInfo.java
index 4517881..57ce581 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaProjectElementInfo.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/JavaProjectElementInfo.java
@@ -249,7 +249,7 @@
IJavaScriptElement[] frags = null;
try {
if (!root.isOpen()) {
- PackageFragmentRootInfo info = root.isArchive() ? new JarPackageFragmentRootInfo() : new PackageFragmentRootInfo();
+ PackageFragmentRootInfo info = new PackageFragmentRootInfo();
((PackageFragmentRoot) root).computeChildren(info, new HashMap());
frags = info.children;
} else
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LibraryPackageFragment.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LibraryPackageFragment.java
index 4c98475..851df5f 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LibraryPackageFragment.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LibraryPackageFragment.java
@@ -93,14 +93,6 @@
/**
* A jar package fragment never contains compilation units.
* @see org.eclipse.wst.jsdt.core.IPackageFragment
- * @deprecated Use {@link #getJavaScriptUnits()} instead
- */
-public IJavaScriptUnit[] getCompilationUnits() {
- return getJavaScriptUnits();
-}
-/**
- * A jar package fragment never contains compilation units.
- * @see org.eclipse.wst.jsdt.core.IPackageFragment
*/
public IJavaScriptUnit[] getJavaScriptUnits() {
return NO_COMPILATION_UNITS;
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LookupScopeElementInfo.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LookupScopeElementInfo.java
index 09d452e..55c12c2 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LookupScopeElementInfo.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/LookupScopeElementInfo.java
@@ -13,8 +13,8 @@
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.internal.core.util.HashtableOfArrayToObject;
@@ -162,10 +162,10 @@
LibraryFragmentRootInfo info = new LibraryFragmentRootInfo();
((LibraryFragmentRoot) root).computeChildren(info, new HashMap());
frags = info.children;
- } else if (root.isArchive() && !root.isOpen()) {
- JarPackageFragmentRootInfo info = new JarPackageFragmentRootInfo();
- ((JarPackageFragmentRoot) root).computeChildren(info, new HashMap());
- frags = info.children;
+// } else if (root.isArchive() && !root.isOpen()) {
+// JarPackageFragmentRootInfo info = new JarPackageFragmentRootInfo();
+// ((JarPackageFragmentRoot) root).computeChildren(info, new HashMap());
+// frags = info.children;
} else if (root instanceof PackageFragmentRoot) {
PackageFragmentRootInfo info = new PackageFragmentRootInfo();
((PackageFragmentRoot) root).computeChildren(info, new HashMap());
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/MetadataFile.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/MetadataFile.java
index 4b989c7..61bd300 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/MetadataFile.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/MetadataFile.java
@@ -26,12 +26,10 @@
import org.eclipse.wst.jsdt.core.IBuffer;
import org.eclipse.wst.jsdt.core.IBufferFactory;
import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.ICodeCompletionRequestor;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.ICompletionRequestor;
import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IProblemRequestor;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.IType;
@@ -233,26 +231,11 @@
return null;
}
- public void codeComplete(int offset, ICodeCompletionRequestor requestor)
- throws JavaScriptModelException {
-
- }
-
- public void codeComplete(int offset, ICompletionRequestor requestor)
- throws JavaScriptModelException {
-
- }
-
public void codeComplete(int offset, CompletionRequestor requestor)
throws JavaScriptModelException {
}
- public void codeComplete(int offset, ICompletionRequestor requestor,
- WorkingCopyOwner owner) throws JavaScriptModelException {
-
- }
-
public void codeComplete(int offset, CompletionRequestor requestor,
WorkingCopyOwner owner) throws JavaScriptModelException {
@@ -284,13 +267,6 @@
}
}
- /**
- * @deprecated Use {@link #getFunction(String,String[])} instead
- */
- public IFunction getMethod(String selector, String[] parameterTypeSignatures) {
- return getFunction(selector, parameterTypeSignatures);
- }
-
public IFunction getFunction(String selector, String[] parameterTypeSignatures) {
return new SourceMethod(this, selector, parameterTypeSignatures);
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/PackageFragment.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/PackageFragment.java
index 169a63a..6d38a1e 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/PackageFragment.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/PackageFragment.java
@@ -244,23 +244,10 @@
return new CompilationUnit(this, cuName,superTypeName, DefaultWorkingCopyOwner.PRIMARY);
}
-/**
- * @deprecated Use {@link #getJavaScriptUnit(String)} instead
- */
-public IJavaScriptUnit getCompilationUnit(String cuName) {
- return getJavaScriptUnit(cuName);
-}
public IJavaScriptUnit getJavaScriptUnit(String cuName) {
return getCompilationUnit(cuName,null);
}
/**
- * @see IPackageFragment#getCompilationUnits()
- * @deprecated Use {@link #getJavaScriptUnits()} instead
- */
-public IJavaScriptUnit[] getCompilationUnits() throws JavaScriptModelException {
- return getJavaScriptUnits();
-}
-/**
* @see IPackageFragment#getJavaScriptUnits()
*/
public IJavaScriptUnit[] getJavaScriptUnits() throws JavaScriptModelException {
@@ -274,13 +261,6 @@
return array;
}
/**
- * @see IPackageFragment#getCompilationUnits(WorkingCopyOwner)
- * @deprecated Use {@link #getJavaScriptUnits(WorkingCopyOwner)} instead
- */
-public IJavaScriptUnit[] getCompilationUnits(WorkingCopyOwner owner) {
- return getJavaScriptUnits(owner);
-}
-/**
* @see IPackageFragment#getJavaScriptUnits(WorkingCopyOwner)
*/
public IJavaScriptUnit[] getJavaScriptUnits(WorkingCopyOwner owner) {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMapper.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMapper.java
index 5562354..b462759 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMapper.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMapper.java
@@ -32,22 +32,18 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.jsdt.core.Flags;
import org.eclipse.wst.jsdt.core.IClassFile;
import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IMember;
import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IMember;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.ISourceReference;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.ITypeParameter;
-import org.eclipse.wst.jsdt.core.JavaScriptConventions;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.Signature;
import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
@@ -366,43 +362,44 @@
final HashSet firstLevelPackageNames = new HashSet();
boolean containsADefaultPackage = false;
- if (root.isArchive()) {
- JarPackageFragmentRoot jarPackageFragmentRoot = (JarPackageFragmentRoot) root;
- IJavaScriptProject project = jarPackageFragmentRoot.getJavaScriptProject();
- String sourceLevel = null;
- String complianceLevel = null;
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- ZipFile zip = null;
- try {
- zip = manager.getZipFile(jarPackageFragmentRoot.getPath());
- for (Enumeration entries = zip.entries(); entries.hasMoreElements(); ) {
- ZipEntry entry = (ZipEntry) entries.nextElement();
- String entryName = entry.getName();
- if (!entry.isDirectory()) {
- int index = entryName.indexOf('/');
- if (index != -1 && Util.isClassFileName(entryName)) {
- String firstLevelPackageName = entryName.substring(0, index);
- if (!firstLevelPackageNames.contains(firstLevelPackageName)) {
- if (sourceLevel == null) {
- sourceLevel = project.getOption(JavaScriptCore.COMPILER_SOURCE, true);
- complianceLevel = project.getOption(JavaScriptCore.COMPILER_COMPLIANCE, true);
- }
- IStatus status = JavaScriptConventions.validatePackageName(firstLevelPackageName, sourceLevel, complianceLevel);
- if (status.isOK() || status.getSeverity() == IStatus.WARNING) {
- firstLevelPackageNames.add(firstLevelPackageName);
- }
- }
- } else if (Util.isClassFileName(entryName)) {
- containsADefaultPackage = true;
- }
- }
- }
- } catch (CoreException e) {
- // ignore
- } finally {
- manager.closeZipFile(zip); // handle null case
- }
- } else {
+// if (root.isArchive()) {
+// JarPackageFragmentRoot jarPackageFragmentRoot = (JarPackageFragmentRoot) root;
+// IJavaScriptProject project = jarPackageFragmentRoot.getJavaScriptProject();
+// String sourceLevel = null;
+// String complianceLevel = null;
+// JavaModelManager manager = JavaModelManager.getJavaModelManager();
+// ZipFile zip = null;
+// try {
+// zip = manager.getZipFile(jarPackageFragmentRoot.getPath());
+// for (Enumeration entries = zip.entries(); entries.hasMoreElements(); ) {
+// ZipEntry entry = (ZipEntry) entries.nextElement();
+// String entryName = entry.getName();
+// if (!entry.isDirectory()) {
+// int index = entryName.indexOf('/');
+// if (index != -1 && Util.isClassFileName(entryName)) {
+// String firstLevelPackageName = entryName.substring(0, index);
+// if (!firstLevelPackageNames.contains(firstLevelPackageName)) {
+// if (sourceLevel == null) {
+// sourceLevel = project.getOption(JavaScriptCore.COMPILER_SOURCE, true);
+// complianceLevel = project.getOption(JavaScriptCore.COMPILER_COMPLIANCE, true);
+// }
+// IStatus status = JavaScriptConventions.validatePackageName(firstLevelPackageName, sourceLevel, complianceLevel);
+// if (status.isOK() || status.getSeverity() == IStatus.WARNING) {
+// firstLevelPackageNames.add(firstLevelPackageName);
+// }
+// }
+// } else if (Util.isClassFileName(entryName)) {
+// containsADefaultPackage = true;
+// }
+// }
+// }
+// } catch (CoreException e) {
+// // ignore
+// } finally {
+// manager.closeZipFile(zip); // handle null case
+// }
+// } else
+ {
Object target = JavaModel.getTarget(ResourcesPlugin.getWorkspace().getRoot(), root.getPath(), true);
if (target instanceof IResource) {
IResource resource = (IResource) target;
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMethod.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMethod.java
index 2efc446..9f1a465 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMethod.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceMethod.java
@@ -134,32 +134,6 @@
return info.typeParameters;
}
-/**
- * @see IFunction#getTypeParameterSignatures()
- * @since 3.0
- * @deprecated
- */
-public String[] getTypeParameterSignatures() throws JavaScriptModelException {
- ITypeParameter[] typeParameters = getTypeParameters();
- int length = typeParameters.length;
- String[] typeParameterSignatures = new String[length];
- for (int i = 0; i < length; i++) {
- TypeParameter typeParameter = (TypeParameter) typeParameters[i];
- TypeParameterElementInfo info = (TypeParameterElementInfo) typeParameter.getElementInfo();
- char[][] bounds = info.bounds;
- if (bounds == null) {
- typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameter.getElementName(), CharOperation.NO_STRINGS);
- } else {
- int boundsLength = bounds.length;
- char[][] boundSignatures = new char[boundsLength][];
- for (int j = 0; j < boundsLength; j++) {
- boundSignatures[j] = Signature.createCharArrayTypeSignature(bounds[j], false);
- }
- typeParameterSignatures[i] = new String(Signature.createTypeParameterSignature(typeParameter.getElementName().toCharArray(), boundSignatures));
- }
- }
- return typeParameterSignatures;
-}
/*
* @see JavaElement#getPrimaryElement(boolean)
@@ -321,13 +295,6 @@
}
}
-/**
- * @deprecated Use {@link #getFunction(String,String[])} instead
- */
-public IFunction getMethod(String selector, String[] parameterTypeSignatures)
-{
- return getFunction(selector, parameterTypeSignatures);
-}
public IFunction getFunction(String selector, String[] parameterTypeSignatures)
{
return new SourceMethod(this, selector, parameterTypeSignatures);
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceType.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceType.java
index 72f1198..fa3b5ab 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceType.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SourceType.java
@@ -17,7 +17,6 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.jsdt.core.CompletionRequestor;
-import org.eclipse.wst.jsdt.core.ICompletionRequestor;
import org.eclipse.wst.jsdt.core.IField;
import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IInitializer;
@@ -70,24 +69,6 @@
}
/**
* @see IType
- * @deprecated
- */
-public void codeComplete(char[] snippet,int insertion,int position,char[][] localVariableTypeNames,char[][] localVariableNames,int[] localVariableModifiers,boolean isStatic,ICompletionRequestor requestor) throws JavaScriptModelException {
- codeComplete(snippet, insertion, position, localVariableTypeNames, localVariableNames, localVariableModifiers, isStatic, requestor, DefaultWorkingCopyOwner.PRIMARY);
-}
-/**
- * @see IType
- * @deprecated
- */
-public void codeComplete(char[] snippet,int insertion,int position,char[][] localVariableTypeNames,char[][] localVariableNames,int[] localVariableModifiers,boolean isStatic,ICompletionRequestor requestor, WorkingCopyOwner owner) throws JavaScriptModelException {
- if (requestor == null) {
- throw new IllegalArgumentException("Completion requestor cannot be null"); //$NON-NLS-1$
- }
- codeComplete(snippet, insertion, position, localVariableTypeNames, localVariableNames, localVariableModifiers, isStatic, new org.eclipse.wst.jsdt.internal.codeassist.CompletionRequestorWrapper(requestor), owner);
-
-}
-/**
- * @see IType
*/
public void codeComplete(char[] snippet,int insertion,int position,char[][] localVariableTypeNames,char[][] localVariableNames,int[] localVariableModifiers,boolean isStatic,CompletionRequestor requestor) throws JavaScriptModelException {
codeComplete(snippet, insertion, position, localVariableTypeNames, localVariableNames, localVariableModifiers, isStatic, requestor, DefaultWorkingCopyOwner.PRIMARY);
@@ -371,13 +352,6 @@
}
/**
* @see IType#getMethod
- * @deprecated Use {@link #getFunction(String,String[])} instead
- */
-public IFunction getMethod(String selector, String[] parameterTypeSignatures) {
- return getFunction(selector, parameterTypeSignatures);
-}
-/**
- * @see IType#getMethod
*/
public IFunction getFunction(String selector, String[] parameterTypeSignatures) {
return new SourceMethod(this, selector, parameterTypeSignatures);
@@ -683,30 +657,6 @@
return op.getResult();
}
/**
- * @param workingCopies the working copies that take precedence over their original compilation units
- * @param monitor the given progress monitor
- * @return a type hierarchy for this type containing this type and all of its supertypes
- * @exception JavaScriptModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
- *
- * @see IType#newSupertypeHierarchy(IWorkingCopy[], IProgressMonitor)
- * @deprecated
- */
-public ITypeHierarchy newSupertypeHierarchy(
- IWorkingCopy[] workingCopies,
- IProgressMonitor monitor)
- throws JavaScriptModelException {
-
- IJavaScriptUnit[] copies;
- if (workingCopies == null) {
- copies = null;
- } else {
- int length = workingCopies.length;
- System.arraycopy(workingCopies, 0, copies = new IJavaScriptUnit[length], 0, length);
- }
- return newSupertypeHierarchy(copies, monitor);
-}
-/**
* @see IType#newSupertypeHierarchy(WorkingCopyOwner, IProgressMonitor)
*/
public ITypeHierarchy newSupertypeHierarchy(
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/AbstractSearchScope.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/AbstractSearchScope.java
index 8496076..24c67af 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/AbstractSearchScope.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/AbstractSearchScope.java
@@ -15,43 +15,12 @@
public abstract class AbstractSearchScope implements IJavaScriptSearchScope {
-/**
- * @see IJavaScriptSearchScope#includesBinaries()
- * @deprecated
- */
-public boolean includesBinaries() {
- return true;
-}
-
-/**
- * @see IJavaScriptSearchScope#includesClasspaths()
- * @deprecated
- */
-public boolean includesClasspaths() {
- return true;
-}
-
/* (non-Javadoc)
* Process the given delta and refresh its internal state if needed.
* Returns whether the internal state was refreshed.
*/
public abstract void processDelta(IJavaScriptElementDelta delta);
-/**
- * @see IJavaScriptSearchScope#setIncludesBinaries(boolean)
- * @deprecated
- */
-public void setIncludesBinaries(boolean includesBinaries) {
- // implements interface method
-}
-
-/**
- * @see IJavaScriptSearchScope#setIncludesClasspaths(boolean)
- * @deprecated
- */
-public void setIncludesClasspaths(boolean includesClasspaths) {
- // implements interface method
-}
public boolean shouldExclude(String container, String resourceName) {
return false;
}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/IndexSelector.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/IndexSelector.java
index 5ce2f34..24794d7 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/IndexSelector.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/IndexSelector.java
@@ -19,7 +19,6 @@
import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
import org.eclipse.wst.jsdt.core.search.SearchPattern;
import org.eclipse.wst.jsdt.internal.compiler.util.SimpleSet;
-import org.eclipse.wst.jsdt.internal.core.JarPackageFragmentRoot;
import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
import org.eclipse.wst.jsdt.internal.core.JavaProject;
import org.eclipse.wst.jsdt.internal.core.LibraryFragmentRoot;
@@ -52,7 +51,7 @@
try {
IIncludePathEntry[] focusEntries = null;
if (isPolymorphicSearch) {
- JavaProject focusProject = focus instanceof JarPackageFragmentRoot ? (JavaProject) focus.getParent() : (JavaProject) focus;
+ JavaProject focusProject = (JavaProject) focus;
focusEntries = focusProject.getExpandedClasspath();
}
IJavaScriptModel model = focus.getJavaScriptModel();
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/AddJarFileToIndex.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/AddJarFileToIndex.java
deleted file mode 100644
index 558e6fc..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/AddJarFileToIndex.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.core.search.indexing;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-import org.eclipse.wst.jsdt.core.search.SearchParticipant;
-import org.eclipse.wst.jsdt.internal.compiler.util.SimpleLookupTable;
-import org.eclipse.wst.jsdt.internal.compiler.util.Util;
-import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
-import org.eclipse.wst.jsdt.internal.core.index.Index;
-import org.eclipse.wst.jsdt.internal.core.search.JavaSearchDocument;
-import org.eclipse.wst.jsdt.internal.core.search.processing.JobManager;
-
-class AddJarFileToIndex extends IndexRequest {
- IFile resource;
-
- public AddJarFileToIndex(IFile resource, IndexManager manager) {
- super(resource.getFullPath().removeLastSegments(1), manager);
- this.resource = resource;
- }
- public AddJarFileToIndex(IPath jarPath, IndexManager manager) {
- // external JAR scenario - no resource
- super(jarPath.removeLastSegments(1), manager);
- }
- public boolean equals(Object o) {
- if (o instanceof AddJarFileToIndex) {
- if (this.resource != null)
- return this.resource.equals(((AddJarFileToIndex) o).resource);
- if (this.containerPath != null)
- return this.containerPath.equals(((AddJarFileToIndex) o).containerPath);
- }
- return false;
- }
- public int hashCode() {
- if (this.resource != null)
- return this.resource.hashCode();
- if (this.containerPath != null)
- return this.containerPath.hashCode();
- return -1;
- }
- public boolean execute(IProgressMonitor progressMonitor) {
-
- if (this.isCancelled || progressMonitor != null && progressMonitor.isCanceled()) return true;
-
- try {
- // if index is already cached, then do not perform any check
- // MUST reset the IndexManager if a jar file is changed
- Index index = this.manager.getIndexForUpdate(this.containerPath, false, /*do not reuse index file*/ false /*do not create if none*/);
- if (index != null) {
- if (JobManager.VERBOSE)
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> no indexing required (index already exists) for " + this.containerPath); //$NON-NLS-1$
- return true;
- }
-
- index = this.manager.getIndexForUpdate(this.containerPath, true, /*reuse index file*/ true /*create if none*/);
- if (index == null) {
- if (JobManager.VERBOSE)
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> index could not be created for " + this.containerPath); //$NON-NLS-1$
- return true;
- }
- ReadWriteMonitor monitor = index.monitor;
- if (monitor == null) {
- if (JobManager.VERBOSE)
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> index for " + this.containerPath + " just got deleted"); //$NON-NLS-1$//$NON-NLS-2$
- return true; // index got deleted since acquired
- }
- ZipFile zip = null;
- try {
- // this path will be a relative path to the workspace in case the zipfile in the workspace otherwise it will be a path in the
- // local file system
- Path zipFilePath = null;
-
- monitor.enterWrite(); // ask permission to write
- if (resource != null) {
- URI location = this.resource.getLocationURI();
- if (location == null) return false;
- if (JavaModelManager.ZIP_ACCESS_VERBOSE)
- System.out.println("(" + Thread.currentThread() + ") [AddJarFileToIndex.execute()] Creating ZipFile on " + location.getPath()); //$NON-NLS-1$ //$NON-NLS-2$
- File file = null;
- try {
- file = org.eclipse.wst.jsdt.internal.core.util.Util.toLocalFile(location, progressMonitor);
- } catch (CoreException e) {
- if (JobManager.VERBOSE) {
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> failed to index " + location.getPath() + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$
- e.printStackTrace();
- }
- }
- if (file == null) {
- if (JobManager.VERBOSE)
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> failed to index " + location.getPath() + " because the file could not be fetched"); //$NON-NLS-1$ //$NON-NLS-2$
- return false;
- }
- zip = new ZipFile(file);
- zipFilePath = (Path) this.resource.getFullPath().makeRelative();
- // absolute path relative to the workspace
- } else {
- if (JavaModelManager.ZIP_ACCESS_VERBOSE)
- System.out.println("(" + Thread.currentThread() + ") [AddJarFileToIndex.execute()] Creating ZipFile on " + this.containerPath); //$NON-NLS-1$ //$NON-NLS-2$
- // external file -> it is ok to use toFile()
- zip = new ZipFile(this.containerPath.toFile());
- zipFilePath = (Path) this.containerPath;
- // path is already canonical since coming from a library classpath entry
- }
-
- if (this.isCancelled) {
- if (JobManager.VERBOSE)
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> indexing of " + zip.getName() + " has been cancelled"); //$NON-NLS-1$ //$NON-NLS-2$
- return false;
- }
-
- if (JobManager.VERBOSE)
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> indexing " + zip.getName()); //$NON-NLS-1$
- long initialTime = System.currentTimeMillis();
-
- String[] paths = index.queryDocumentNames(""); // all file names //$NON-NLS-1$
- if (paths != null) {
- int max = paths.length;
- /* check integrity of the existing index file
- * if the length is equal to 0, we want to index the whole jar again
- * If not, then we want to check that there is no missing entry, if
- * one entry is missing then we recreate the index
- */
- String EXISTS = "OK"; //$NON-NLS-1$
- String DELETED = "DELETED"; //$NON-NLS-1$
- SimpleLookupTable indexedFileNames = new SimpleLookupTable(max == 0 ? 33 : max + 11);
- for (int i = 0; i < max; i++)
- indexedFileNames.put(paths[i], DELETED);
- for (Enumeration e = zip.entries(); e.hasMoreElements();) {
- // iterate each entry to index it
- ZipEntry ze = (ZipEntry) e.nextElement();
- String zipEntryName = ze.getName();
- if (Util.isClassFileName(zipEntryName))
- indexedFileNames.put(zipEntryName, EXISTS);
- }
- boolean needToReindex = indexedFileNames.elementSize != max; // a new file was added
- if (!needToReindex) {
- Object[] valueTable = indexedFileNames.valueTable;
- for (int i = 0, l = valueTable.length; i < l; i++) {
- if (valueTable[i] == DELETED) {
- needToReindex = true; // a file was deleted so re-index
- break;
- }
- }
- if (!needToReindex) {
- if (JobManager.VERBOSE)
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> no indexing required (index is consistent with library) for " //$NON-NLS-1$
- + zip.getName() + " (" //$NON-NLS-1$
- + (System.currentTimeMillis() - initialTime) + "ms)"); //$NON-NLS-1$
- this.manager.saveIndex(index); // to ensure its placed into the saved state
- return true;
- }
- }
- }
-
- // Index the jar for the first time or reindex the jar in case the previous index file has been corrupted
- // index already existed: recreate it so that we forget about previous entries
- SearchParticipant participant = SearchEngine.getDefaultSearchParticipant();
- index = manager.recreateIndex(this.containerPath);
- if (index == null) {
- // failed to recreate index, see 73330
- manager.removeIndex(this.containerPath);
- return false;
- }
-
- for (Enumeration e = zip.entries(); e.hasMoreElements();) {
- if (this.isCancelled) {
- if (JobManager.VERBOSE)
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> indexing of " + zip.getName() + " has been cancelled"); //$NON-NLS-1$ //$NON-NLS-2$
- return false;
- }
-
- // iterate each entry to index it
- ZipEntry ze = (ZipEntry) e.nextElement();
- if (Util.isClassFileName(ze.getName())) {
- final byte[] classFileBytes = org.eclipse.wst.jsdt.internal.compiler.util.Util.getZipEntryByteContent(ze, zip);
- JavaSearchDocument entryDocument = new JavaSearchDocument(ze, zipFilePath, classFileBytes, participant);
- this.manager.indexDocument(entryDocument, participant, index, this.containerPath);
- }
- }
- this.manager.saveIndex(index);
- if (JobManager.VERBOSE)
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> done indexing of " //$NON-NLS-1$
- + zip.getName() + " (" //$NON-NLS-1$
- + (System.currentTimeMillis() - initialTime) + "ms)"); //$NON-NLS-1$
- } finally {
- if (zip != null) {
- if (JavaModelManager.ZIP_ACCESS_VERBOSE)
- System.out.println("(" + Thread.currentThread() + ") [AddJarFileToIndex.execute()] Closing ZipFile " + zip); //$NON-NLS-1$ //$NON-NLS-2$
- zip.close();
- }
- monitor.exitWrite(); // free write lock
- }
- } catch (IOException e) {
- if (JobManager.VERBOSE) {
- org.eclipse.wst.jsdt.internal.core.util.Util.verbose("-> failed to index " + this.containerPath + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$
- e.printStackTrace();
- }
- manager.removeIndex(this.containerPath);
- return false;
- }
- return true;
- }
- protected Integer updatedIndexState() {
- return IndexManager.REBUILDING_STATE;
- }
- public String toString() {
- return "indexing " + this.containerPath.toString(); //$NON-NLS-1$
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/IndexManager.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/IndexManager.java
index 3b8d49f..f0e47a1 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/IndexManager.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/indexing/IndexManager.java
@@ -477,8 +477,8 @@
request = new IndexAllProject(p, this);
} else if (target instanceof IFolder) {
request = new IndexBinaryFolder((IFolder) target, this);
- } else if (target instanceof IFile) {
- request = new AddJarFileToIndex((IFile) target, this);
+// } else if (target instanceof IFile) {
+// request = new AddJarFileToIndex((IFile) target, this);
} else if (target instanceof File) {
request = new AddLibraryFileToIndex(containerPath, this);
// request = new AddJarFileToIndex(containerPath, this);
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/MatchLocator.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/MatchLocator.java
index 1f04f7e..829a2b7 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/MatchLocator.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/search/matching/MatchLocator.java
@@ -24,10 +24,10 @@
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.wst.jsdt.core.IClassFile;
import org.eclipse.wst.jsdt.core.IField;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.ISourceRange;
import org.eclipse.wst.jsdt.core.IType;
@@ -125,7 +125,6 @@
import org.eclipse.wst.jsdt.internal.core.BinaryType;
import org.eclipse.wst.jsdt.internal.core.ClassFile;
import org.eclipse.wst.jsdt.internal.core.CompilationUnit;
-import org.eclipse.wst.jsdt.internal.core.JarPackageFragmentRoot;
import org.eclipse.wst.jsdt.internal.core.JavaElement;
import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
import org.eclipse.wst.jsdt.internal.core.JavaProject;
@@ -363,7 +362,7 @@
private static HashMap workingCopiesThatCanSeeFocus(org.eclipse.wst.jsdt.core.IJavaScriptUnit[] copies, IJavaScriptElement focus, boolean isPolymorphicSearch, SearchParticipant participant) {
if (copies == null) return new HashMap();
if (focus != null) {
- while (!(focus instanceof IJavaScriptProject) && !(focus instanceof JarPackageFragmentRoot)) {
+ while (!(focus instanceof IJavaScriptProject)) {
focus = focus.getParent();
}
}
@@ -410,7 +409,7 @@
public static IJavaScriptElement getProjectOrJar(IJavaScriptElement element) {
while (!(element instanceof IJavaScriptProject) &&
- !(element instanceof JarPackageFragmentRoot || element instanceof LibraryFragmentRoot)) {
+ !( element instanceof LibraryFragmentRoot)) {
element = element.getParent();
}
return element;
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/old/CodeFormatter.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/old/CodeFormatter.java
deleted file mode 100644
index c576aca..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/old/CodeFormatter.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.formatter.old;
-
-import java.util.Map;
-
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants;
-import org.eclipse.wst.jsdt.internal.compiler.parser.TerminalTokens;
-import org.eclipse.wst.jsdt.internal.formatter.DefaultCodeFormatter;
-
-/** <h2>How to format a piece of code ?</h2>
- * <ul><li>Create an instance of <code>CodeFormatter</code>
- * <li>Use the method <code>void format(aString)</code>
- * on this instance to format <code>aString</code>.
- * It will return the formatted string.</ul>
- * @deprecated
-*/
-public class CodeFormatter implements TerminalTokens, org.eclipse.wst.jsdt.core.ICodeFormatter {
-
- private Map options;
-
- public CodeFormatter(Map options) {
- if (options == null) {
- this.options = JavaScriptCore.getOptions();
- } else {
- this.options = options;
- }
- }
-
- public String format(String string, int indentLevel, int[] positions, String lineSeparator) {
- // initialize the new formatter with old options
- Map newOptions = DefaultCodeFormatterConstants.getEclipse21Settings();
-
- Object formatterNewLineOpeningBrace = this.options.get(JavaScriptCore.FORMATTER_NEWLINE_OPENING_BRACE);
- if (formatterNewLineOpeningBrace != null) {
- if (JavaScriptCore.INSERT.equals(formatterNewLineOpeningBrace)) {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.NEXT_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.NEXT_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE);
- } else {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, DefaultCodeFormatterConstants.END_OF_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, DefaultCodeFormatterConstants.END_OF_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, DefaultCodeFormatterConstants.END_OF_LINE);
- }
- }
- Object formatterNewLineControl = this.options.get(JavaScriptCore.FORMATTER_NEWLINE_CONTROL);
- if (formatterNewLineControl != null) {
- if (JavaScriptCore.INSERT.equals(formatterNewLineControl)) {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.INSERT);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.INSERT);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.INSERT);
- } else {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, JavaScriptCore.DO_NOT_INSERT);
- }
- }
- Object formatterClearBlankLines = this.options.get(JavaScriptCore.FORMATTER_CLEAR_BLANK_LINES);
- if (formatterClearBlankLines != null) {
- if (JavaScriptCore.PRESERVE_ONE.equals(formatterClearBlankLines)) {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "1"); //$NON-NLS-1$
- } else {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, "0"); //$NON-NLS-1$
- }
- }
- Object formatterNewLineElseIf = this.options.get(JavaScriptCore.FORMATTER_NEWLINE_ELSE_IF);
- if (formatterNewLineElseIf != null) {
- if (JavaScriptCore.INSERT.equals(formatterNewLineElseIf)) {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF, DefaultCodeFormatterConstants.FALSE);
- } else {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF, DefaultCodeFormatterConstants.TRUE);
- }
- }
- Object formatterNewLineEmptyBlock = this.options.get(JavaScriptCore.FORMATTER_NEWLINE_EMPTY_BLOCK);
- if (formatterNewLineEmptyBlock != null) {
- if (JavaScriptCore.INSERT.equals(formatterNewLineEmptyBlock)) {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK, JavaScriptCore.INSERT);
- } else {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK, JavaScriptCore.DO_NOT_INSERT);
- }
- }
- Object formatterCompactAssignment = this.options.get(JavaScriptCore.FORMATTER_COMPACT_ASSIGNMENT);
- if (formatterCompactAssignment != null) {
- if (JavaScriptCore.COMPACT.equals(formatterCompactAssignment)) {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, JavaScriptCore.DO_NOT_INSERT);
- } else {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, JavaScriptCore.INSERT);
- }
- }
- if (this.options.get(JavaScriptCore.FORMATTER_SPACE_CASTEXPRESSION) != null) {
- if (JavaScriptCore.INSERT.equals(this.options.get(JavaScriptCore.FORMATTER_SPACE_CASTEXPRESSION))) {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST, JavaScriptCore.INSERT);
- } else {
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST, JavaScriptCore.DO_NOT_INSERT);
- }
- }
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, this.options.get(JavaScriptCore.FORMATTER_TAB_CHAR));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, this.options.get(JavaScriptCore.FORMATTER_TAB_SIZE));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_LINE_SPLIT, this.options.get(JavaScriptCore.FORMATTER_LINE_SPLIT));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, DefaultCodeFormatterConstants.END_OF_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_OBJLIT_INITIALIZER, DefaultCodeFormatterConstants.END_OF_LINE);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, "1");//$NON-NLS-1$
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
- newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaScriptCore.INSERT);
-
- DefaultCodeFormatter defaultCodeFormatter = new DefaultCodeFormatter(newOptions);
- TextEdit textEdit = defaultCodeFormatter.format(org.eclipse.wst.jsdt.core.formatter.CodeFormatter.K_UNKNOWN, string, 0, string.length(), indentLevel, lineSeparator);
- if (positions != null && textEdit != null) {
- // update positions
- TextEdit[] edits = textEdit.getChildren();
- int textEditSize = edits.length;
- int editsIndex = 0;
- int delta = 0;
- int originalSourceLength = string.length() - 1;
- if (textEditSize != 0) {
- for (int i = 0, max = positions.length; i < max; i++) {
- int currentPosition = positions[i];
- if (currentPosition > originalSourceLength) {
- currentPosition = originalSourceLength;
- }
- ReplaceEdit currentEdit = (ReplaceEdit) edits[editsIndex];
- while (currentEdit.getOffset() <= currentPosition) {
- delta += currentEdit.getText().length() - currentEdit.getLength();
- editsIndex++;
- if (editsIndex < textEditSize) {
- currentEdit = (ReplaceEdit) edits[editsIndex];
- } else {
- break;
- }
- }
- positions[i] = currentPosition + delta;
- }
- }
- }
- return org.eclipse.wst.jsdt.internal.core.util.Util.editedString(string, textEdit);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IRuntimeContainerComparator.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IRuntimeContainerComparator.java
deleted file mode 100644
index ea2ba3e..0000000
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/IRuntimeContainerComparator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.launching;
-
-
-import org.eclipse.core.runtime.IPath;
-
-/**
- * Determines if container entries are duplicates/redundant on a runtime
- * classpath. If an <code>IClasspathContianer</code> implements this interface,
- * the <code>isDuplicate</code> method is used to determine if containers are
- * duplicates/redundant. Otherwise, containers with the same identifier are
- * considered duplicates.
- *
- * @since 2.0.1
- * @deprecated support has been added to <code>JsGlobalScopeContainerInitializer</code>
- * to handle comparison of classpath containers. Use
- * <code>JsGlobalScopeContainerInitializer.getComparisonID(IPath,IJavaScriptProject)</code>.
- * When a classpath container implements this interface, this interface is
- * used to determine equality before using the support defined in
- * <code>JsGlobalScopeContainerInitializer</code>.
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public interface IRuntimeContainerComparator {
-
- /**
- * Returns whether this container is a duplicate of the container
- * identified by the given path.
- *
- * @param containerPath the container to compare against
- * @return whether this container is a duplicate of the container
- * identified by the given path
- */
- public boolean isDuplicate(IPath containerPath);
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/plugin.xml b/bundles/org.eclipse.wst.jsdt.ui/plugin.xml
index abe3c59..db7e723 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.jsdt.ui/plugin.xml
@@ -142,10 +142,12 @@
attributeName="javadoc_location"
class="org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.JavadocAttributeConfiguration">
</classpathAttributeConfiguration>
+<!--
<classpathAttributeConfiguration
attributeName="org.eclipse.wst.jsdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY"
class="org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.NativeLibAttributeConfiguration">
- </classpathAttributeConfiguration>
+ </classpathAttributeConfiguration>
+-->
</extension>
<extension
@@ -4769,6 +4771,7 @@
class="org.eclipse.wst.jsdt.internal.ui.filters.InterfaceFilter"
id="org.eclipse.wst.jsdt.ui.TypesView.InterfaceFilter">
</filter>
+<!--
<filter
targetId="org.eclipse.wst.jsdt.ui.TypesView"
name="%HideEnum.label"
@@ -4785,6 +4788,7 @@
class="org.eclipse.wst.jsdt.internal.ui.filters.AnnotationFilter"
id="org.eclipse.wst.jsdt.ui.TypesView.AnnotationFilter">
</filter>
+-->
<filter
targetId="org.eclipse.wst.jsdt.ui.TypesView"
name="%HideClass.label"
@@ -5082,9 +5086,11 @@
<contribution
class="org.eclipse.wst.jsdt.internal.corext.refactoring.scripting.RenameCompilationUnitRefactoringContribution"
id="org.eclipse.wst.jsdt.ui.rename.compilationunit"/>
+<!--
<contribution
class="org.eclipse.wst.jsdt.internal.corext.refactoring.scripting.RenameEnumConstRefactoringContribution"
id="org.eclipse.wst.jsdt.ui.rename.enum.constant"/>
+-->
<contribution
class="org.eclipse.wst.jsdt.internal.corext.refactoring.scripting.RenameFieldRefactoringContribution"
id="org.eclipse.wst.jsdt.ui.rename.field"/>
@@ -5599,6 +5605,7 @@
name="%HideEmptyInnerPackages.label"
description="%HideEmptyInnerPackages.description"
id="org.eclipse.wst.jsdt.java.ui.filters.HideEmptyInnerPackages"/>
+<!--
<commonFilter
class="org.eclipse.wst.jsdt.internal.ui.filters.AnnotationFilter"
name="%HideAnnotation.label"
@@ -5609,6 +5616,7 @@
name="%HideEnum.label"
description="%HideEnum.description"
id="org.eclipse.wst.jsdt.java.ui.filters.HideAnnotations"/>
+-->
<commonFilter
class="org.eclipse.wst.jsdt.internal.ui.filters.InterfaceFilter"
name="%HideInterface.label"
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameEnumConstProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameEnumConstProcessor.java
deleted file mode 100644
index 2181fe7..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/rename/RenameEnumConstProcessor.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.corext.refactoring.rename;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.RefactoringArguments;
-import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.refactoring.IJavaScriptRefactorings;
-import org.eclipse.wst.jsdt.core.refactoring.descriptors.JavaScriptRefactoringDescriptor;
-import org.eclipse.wst.jsdt.core.refactoring.descriptors.RenameJavaScriptElementDescriptor;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.Checks;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.JDTRefactoringDescriptor;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.JDTRefactoringDescriptorComment;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.JavaRefactoringArguments;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.RefactoringAvailabilityTester;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.RefactoringCoreMessages;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.changes.RefactoringDescriptorChange;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.code.ScriptableRefactoring;
-import org.eclipse.wst.jsdt.internal.corext.util.Messages;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.ui.JavaScriptElementLabels;
-
-public final class RenameEnumConstProcessor extends RenameFieldProcessor {
-
- public static final String IDENTIFIER= "org.eclipse.wst.jsdt.ui.renameEnumConstProcessor"; //$NON-NLS-1$
-
- /**
- * Creates a new rename enum const processor.
- *
- * @param field
- * the enum constant, or <code>null</code> if invoked by
- * scripting
- */
- public RenameEnumConstProcessor(IField field) {
- super(field);
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameFieldProcessor#canEnableGetterRenaming()
- */
- public String canEnableGetterRenaming() throws CoreException {
- return ""; //$NON-NLS-1$
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameFieldProcessor#canEnableSetterRenaming()
- */
- public String canEnableSetterRenaming() throws CoreException {
- return ""; //$NON-NLS-1$
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.corext.refactoring.tagging.INameUpdating#checkNewElementName(java.lang.String)
- */
- public RefactoringStatus checkNewElementName(String newName) throws CoreException {
- RefactoringStatus result= Checks.checkEnumConstantName(newName);
- if (Checks.isAlreadyNamed(getField(), newName))
- result.addFatalError(RefactoringCoreMessages.RenameEnumConstRefactoring_another_name);
- if (getField().getDeclaringType().getField(newName).exists())
- result.addFatalError(RefactoringCoreMessages.RenameEnumConstRefactoring_const_already_defined);
- return result;
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameFieldProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
- */
- public Change createChange(final IProgressMonitor monitor) throws CoreException {
- Change change= super.createChange(monitor);
- if (change != null) {
- final IField field= getField();
- String project= null;
- IJavaScriptProject javaProject= field.getJavaScriptProject();
- if (javaProject != null)
- project= javaProject.getElementName();
- int flags= JavaScriptRefactoringDescriptor.JAR_MIGRATION | JavaScriptRefactoringDescriptor.JAR_REFACTORING | RefactoringDescriptor.STRUCTURAL_CHANGE;
- final IType declaring= field.getDeclaringType();
- try {
- if (!Flags.isPrivate(declaring.getFlags()))
- flags|= RefactoringDescriptor.MULTI_CHANGE;
- if (declaring.isAnonymous() || declaring.isLocal())
- flags|= JavaScriptRefactoringDescriptor.JAR_SOURCE_ATTACHMENT;
- } catch (JavaScriptModelException exception) {
- JavaScriptPlugin.log(exception);
- }
- final String description= Messages.format(RefactoringCoreMessages.RenameEnumConstProcessor_descriptor_description_short, fField.getElementName());
- final String header= Messages.format(RefactoringCoreMessages.RenameEnumConstProcessor_descriptor_description, new String[] { field.getElementName(), JavaScriptElementLabels.getElementLabel(field.getParent(), JavaScriptElementLabels.ALL_FULLY_QUALIFIED), getNewElementName()});
- final String comment= new JDTRefactoringDescriptorComment(project, this, header).asString();
- final RenameJavaScriptElementDescriptor descriptor= new RenameJavaScriptElementDescriptor(IJavaScriptRefactorings.RENAME_ENUM_CONSTANT);
- descriptor.setProject(project);
- descriptor.setDescription(description);
- descriptor.setComment(comment);
- descriptor.setFlags(flags);
- descriptor.setJavaElement(field);
- descriptor.setNewName(getNewElementName());
- descriptor.setUpdateReferences(fUpdateReferences);
- descriptor.setUpdateTextualOccurrences(fUpdateTextualMatches);
- final RefactoringDescriptorChange extended= new RefactoringDescriptorChange(descriptor, RefactoringCoreMessages.RenameEnumConstProcessor_change_name, new Change[] { change});
- extended.markAsSynthetic();
- return extended;
- }
- return change;
- }
-
- /*
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
- */
- public String getIdentifier() {
- return IDENTIFIER;
- }
-
- /*
- * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
- */
- public String getProcessorName() {
- return RefactoringCoreMessages.RenameEnumConstRefactoring_name;
- }
-
- /*
- * @see org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameFieldProcessor#initialize(org.eclipse.ltk.core.refactoring.participants.RefactoringArguments)
- */
- public RefactoringStatus initialize(RefactoringArguments arguments) {
- if (arguments instanceof JavaRefactoringArguments) {
- final JavaRefactoringArguments extended= (JavaRefactoringArguments) arguments;
- final String handle= extended.getAttribute(JDTRefactoringDescriptor.ATTRIBUTE_INPUT);
- if (handle != null) {
- final IJavaScriptElement element= JDTRefactoringDescriptor.handleToElement(extended.getProject(), handle, false);
- if (element == null || !element.exists() || element.getElementType() != IJavaScriptElement.FIELD)
- return ScriptableRefactoring.createInputFatalStatus(element, getRefactoring().getName(), IJavaScriptRefactorings.RENAME_ENUM_CONSTANT);
- else
- fField= (IField) element;
- } else
- return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JDTRefactoringDescriptor.ATTRIBUTE_INPUT));
- final String name= extended.getAttribute(JDTRefactoringDescriptor.ATTRIBUTE_NAME);
- if (name != null && !"".equals(name)) //$NON-NLS-1$
- setNewElementName(name);
- else
- return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JDTRefactoringDescriptor.ATTRIBUTE_NAME));
- final String references= extended.getAttribute(JDTRefactoringDescriptor.ATTRIBUTE_REFERENCES);
- if (references != null) {
- setUpdateReferences(Boolean.valueOf(references).booleanValue());
- } else
- return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, JDTRefactoringDescriptor.ATTRIBUTE_REFERENCES));
- final String matches= extended.getAttribute(ATTRIBUTE_TEXTUAL_MATCHES);
- if (matches != null) {
- setUpdateTextualMatches(Boolean.valueOf(matches).booleanValue());
- } else
- return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_argument_not_exist, ATTRIBUTE_TEXTUAL_MATCHES));
- } else
- return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.InitializableRefactoring_inacceptable_arguments);
- return new RefactoringStatus();
- }
-
- public boolean isApplicable() throws CoreException {
- return RefactoringAvailabilityTester.isRenameEnumConstAvailable(getField());
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameEnumConstRefactoringContribution.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameEnumConstRefactoringContribution.java
deleted file mode 100644
index 1e37c31..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/refactoring/scripting/RenameEnumConstRefactoringContribution.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.corext.refactoring.scripting;
-
-import org.eclipse.ltk.core.refactoring.Refactoring;
-import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
-import org.eclipse.wst.jsdt.core.refactoring.IJavaScriptRefactorings;
-import org.eclipse.wst.jsdt.core.refactoring.descriptors.RenameJavaScriptElementDescriptor;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.JDTRefactoringContribution;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.JavaRenameRefactoring;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameEnumConstProcessor;
-
-/**
- * Refactoring contribution for the rename enum constant refactoring.
- *
- * @since 3.2
- */
-public final class RenameEnumConstRefactoringContribution extends JDTRefactoringContribution {
-
- /**
- * {@inheritDoc}
- */
- public Refactoring createRefactoring(final RefactoringDescriptor descriptor) {
- return new JavaRenameRefactoring(new RenameEnumConstProcessor(null));
- }
-
- /**
- * {@inheritDoc}
- */
- public RefactoringDescriptor createDescriptor() {
- return new RenameJavaScriptElementDescriptor(IJavaScriptRefactorings.RENAME_ENUM_CONSTANT);
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JavaModelUtil.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JavaModelUtil.java
index 9e0fc3f..781f237 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JavaModelUtil.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/util/JavaModelUtil.java
@@ -537,55 +537,6 @@
}
/**
- * Returns the original if the given member. If the member is already
- * an original the input is returned. The returned member might not exist
- *
- * @deprecated Replace by IMember#getPrimaryElement() if <code>member</code> is not part
- * of a shared working copy owner. Also have a look at http://bugs.eclipse.org/bugs/show_bug.cgi?id=18568
- */
- public static IMember toOriginal(IMember member) {
- if (member instanceof IFunction)
- return toOriginalMethod((IFunction)member);
-
- // TODO: remove toOriginalMethod(IFunction)
-
- return (IMember) member.getPrimaryElement();
- /*IJavaScriptUnit cu= member.getCompilationUnit();
- if (cu != null && cu.isWorkingCopy())
- return (IMember)cu.getOriginal(member);
- return member;*/
- }
-
- /*
- * TODO remove if toOriginal(IMember) can be removed
- * XXX workaround for bug 18568
- * http://bugs.eclipse.org/bugs/show_bug.cgi?id=18568
- * to be removed once the bug is fixed
- */
- private static IFunction toOriginalMethod(IFunction method) {
- IJavaScriptUnit cu= method.getJavaScriptUnit();
- if (cu == null || isPrimary(cu)) {
- return method;
- }
- try{
- //use the workaround only if needed
- if (method.getDeclaringType()==null || ! method.getElementName().equals(method.getDeclaringType().getElementName()))
- return (IFunction) method.getPrimaryElement();
-
- IType originalType = (IType) toOriginal(method.getDeclaringType());
- IFunction[] methods = originalType.findMethods(method);
- boolean isConstructor = method.isConstructor();
- for (int i=0; i < methods.length; i++) {
- if (methods[i].isConstructor() == isConstructor)
- return methods[i];
- }
- return null;
- } catch (JavaScriptModelException e){
- return null;
- }
- }
-
- /**
* Returns true if a cu is a primary cu (original or shared working copy)
*/
public static boolean isPrimary(IJavaScriptUnit cu) {
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaScriptPlugin.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaScriptPlugin.java
index 9b918e6..adcb721 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaScriptPlugin.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/JavaScriptPlugin.java
@@ -38,7 +38,6 @@
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -70,7 +69,6 @@
import org.eclipse.wst.jsdt.internal.ui.javaeditor.ClassFileDocumentProvider;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitDocumentProvider;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.DocumentAdapter;
-import org.eclipse.wst.jsdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.ICompilationUnitDocumentProvider;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.WorkingCopyManager;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.saveparticipant.SaveParticipantRegistry;
@@ -162,7 +160,6 @@
/**
* @deprecated
*/
- private org.eclipse.wst.jsdt.core.IBufferFactory fBufferFactory;
private ICompilationUnitDocumentProvider fCompilationUnitDocumentProvider;
private ClassFileDocumentProvider fClassFileDocumentProvider;
private JavaScriptTextTools fJavaTextTools;
@@ -260,13 +257,6 @@
return null;
}
- /**
- * @deprecated Use EditorUtility.getDirtyEditors() instead.
- */
- public static IEditorPart[] getDirtyEditors() {
- return EditorUtility.getDirtyEditors();
- }
-
public static String getPluginId() {
return JavaScriptUI.ID_PLUGIN;
}
@@ -594,15 +584,6 @@
return window.getActivePage();
}
- /**
- * @deprecated
- */
- public synchronized org.eclipse.wst.jsdt.core.IBufferFactory getBufferFactory() {
- if (fBufferFactory == null)
- fBufferFactory= new org.eclipse.wst.jsdt.internal.ui.javaeditor.CustomBufferFactory();
- return fBufferFactory;
- }
-
public synchronized ICompilationUnitDocumentProvider getCompilationUnitDocumentProvider() {
if (fCompilationUnitDocumentProvider == null)
fCompilationUnitDocumentProvider= new CompilationUnitDocumentProvider();
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/MainTypeSelectionDialog.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/MainTypeSelectionDialog.java
deleted file mode 100644
index 19cb865..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/MainTypeSelectionDialog.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.dialogs;
-
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.TwoPaneElementSelector;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.internal.ui.IJavaHelpContextIds;
-import org.eclipse.wst.jsdt.internal.ui.JavaUIMessages;
-import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
-import org.eclipse.wst.jsdt.internal.ui.util.MainMethodSearchEngine;
-import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
-
-/**
- * A dialog to select a type from a list of types. The dialog allows
- * multiple selections.
- */
-public class MainTypeSelectionDialog extends TwoPaneElementSelector {
-
- private IRunnableContext fRunnableContext;
- private IJavaScriptSearchScope fScope;
- private int fStyle;
-
- private static class PackageRenderer extends JavaScriptElementLabelProvider {
- public PackageRenderer() {
- super(JavaScriptElementLabelProvider.SHOW_PARAMETERS | JavaScriptElementLabelProvider.SHOW_POST_QUALIFIED | JavaScriptElementLabelProvider.SHOW_ROOT);
- }
-
- public Image getImage(Object element) {
- return super.getImage(((IType)element).getPackageFragment());
- }
-
- public String getText(Object element) {
- return super.getText(((IType)element).getPackageFragment());
- }
- }
-
- /**
- * Constructor.
- */
- public MainTypeSelectionDialog(Shell shell, IRunnableContext context,
- IJavaScriptSearchScope scope, int style)
- {
- super(shell, new JavaScriptElementLabelProvider(JavaScriptElementLabelProvider.SHOW_BASICS | JavaScriptElementLabelProvider.SHOW_OVERLAY_ICONS),
- new PackageRenderer());
-
- Assert.isNotNull(context);
- Assert.isNotNull(scope);
-
- fRunnableContext= context;
- fScope= scope;
- fStyle= style;
- }
-
- /*
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.MAINTYPE_SELECTION_DIALOG);
- }
-
- /*
- * @see Window#open()
- */
- public int open() {
- MainMethodSearchEngine engine= new MainMethodSearchEngine();
- IType[] types;
- try {
- types= engine.searchMainMethods(fRunnableContext, fScope, fStyle);
- } catch (InterruptedException e) {
- return CANCEL;
- } catch (InvocationTargetException e) {
- ExceptionHandler.handle(e, JavaUIMessages.MainTypeSelectionDialog_errorTitle, e.getMessage());
- return CANCEL;
- }
-
- setElements(types);
- return super.open();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/MultiMainTypeSelectionDialog.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/MultiMainTypeSelectionDialog.java
deleted file mode 100644
index c36f527..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/dialogs/MultiMainTypeSelectionDialog.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.dialogs;
-
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.internal.ui.IJavaHelpContextIds;
-import org.eclipse.wst.jsdt.internal.ui.JavaUIMessages;
-import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
-import org.eclipse.wst.jsdt.internal.ui.util.MainMethodSearchEngine;
-import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
-
-/**
- * A dialog to select a type from a list of types. The dialog allows
- * multiple selections.
- */
-public class MultiMainTypeSelectionDialog extends ElementListSelectionDialog {
-
- private IRunnableContext fRunnableContext;
- private IJavaScriptSearchScope fScope;
- private int fStyle;
-
- /**
- * Constructor.
- */
- public MultiMainTypeSelectionDialog(Shell shell, IRunnableContext context,
- IJavaScriptSearchScope scope, int style)
- {
- super(shell, new JavaScriptElementLabelProvider(
- JavaScriptElementLabelProvider.SHOW_PARAMETERS | JavaScriptElementLabelProvider.SHOW_POST_QUALIFIED | JavaScriptElementLabelProvider.SHOW_ROOT));
-
- setMultipleSelection(true);
-
- Assert.isNotNull(context);
- Assert.isNotNull(scope);
-
- fRunnableContext= context;
- fScope= scope;
- fStyle= style;
- }
-
- /*
- * @see Window#open()
- */
- public int open() {
- MainMethodSearchEngine engine= new MainMethodSearchEngine();
- IType[] types;
- try {
- types= engine.searchMainMethods(fRunnableContext, fScope, fStyle);
- } catch (InterruptedException e) {
- return CANCEL;
- } catch (InvocationTargetException e) {
- //XX: to do
- ExceptionHandler.handle(e, JavaUIMessages.MultiMainTypeSelectionDialog_errorTitle, e.getMessage());
- return CANCEL;
- }
-
- setElements(types);
- return super.open();
- }
-
- /*
- * @see org.eclipse.jface.window.Window#configureShell(Shell)
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.MULTI_MAIN_TYPE_SELECTION_DIALOG);
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/AnnotationFilter.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/AnnotationFilter.java
deleted file mode 100644
index 8e65b36..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/AnnotationFilter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.filters;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-
-/**
- * Filters annotations.
- */
-public class AnnotationFilter extends ViewerFilter {
-
- /*
- * @see ViewerFilter
- */
- public boolean select(Viewer viewer, Object parent, Object element) {
- if (element instanceof IType) {
- try {
- return !((IType) element).isAnnotation();
- } catch (JavaScriptModelException ex) {
- return true;
- }
- }
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/EnumFilter.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/EnumFilter.java
deleted file mode 100644
index 7a920af..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/filters/EnumFilter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.filters;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-
-/**
- * Filters enums.
- */
-public class EnumFilter extends ViewerFilter {
-
- /*
- * @see ViewerFilter
- */
- public boolean select(Viewer viewer, Object parent, Object element) {
- if (element instanceof IType) {
- try {
- return !((IType) element).isEnum();
- } catch (JavaScriptModelException ex) {
- return true;
- }
- }
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ASTProvider.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ASTProvider.java
index 9f7da37..0d6bb3f 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ASTProvider.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/ASTProvider.java
@@ -527,29 +527,6 @@
}
/**
- * Returns a shared compilation unit AST for the given
- * Java element.
- * <p>
- * Clients are not allowed to modify the AST and must
- * synchronize all access to its nodes.
- * </p>
- *
- * @param je the Java element
- * @param wait <code>true</code> if the client wants to wait for the result,
- * <code>null</code> will be returned if the AST is not ready and
- * the client does not want to wait
- * @param progressMonitor the progress monitor or <code>null</code>
- * @return the AST or <code>null</code> if the AST is not available
- * @deprecated As of 3.1, use {@link #getAST(IJavaScriptElement, WAIT_FLAG, IProgressMonitor)}
- */
- public JavaScriptUnit getAST(IJavaScriptElement je, boolean wait, IProgressMonitor progressMonitor) {
- if (wait)
- return getAST(je, WAIT_YES, progressMonitor);
- else
- return getAST(je, WAIT_NO, progressMonitor);
- }
-
- /**
* Tells whether the given Java element is the one
* reported as currently being reconciled.
*
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/CustomBufferFactory.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/CustomBufferFactory.java
deleted file mode 100644
index 83423ba..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/CustomBufferFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.internal.ui.javaeditor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.jsdt.core.IBuffer;
-import org.eclipse.wst.jsdt.core.IBufferFactory;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IOpenable;
-
-
-/**
- * Creates <code>IBuffer</code>s based on documents.
- * @deprecated since 3.0 no longer used
- */
-public class CustomBufferFactory implements IBufferFactory {
-
- /*
- * @see org.eclipse.wst.jsdt.core.IBufferFactory#createBuffer(org.eclipse.wst.jsdt.core.IOpenable)
- */
- public IBuffer createBuffer(IOpenable owner) {
- if (owner instanceof IJavaScriptUnit) {
- IJavaScriptUnit unit= (IJavaScriptUnit) owner;
- IJavaScriptUnit original= unit.getPrimary();
- IResource resource= original.getResource();
- if (resource instanceof IFile) {
- return new DocumentAdapter(unit, (IFile) resource);
- }
-
- }
- return DocumentAdapter.NULL;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaNavigatorActionProvider.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaNavigatorActionProvider.java
index ed425ab..ac1c5c5 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaNavigatorActionProvider.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/navigator/JavaNavigatorActionProvider.java
@@ -17,7 +17,6 @@
import org.eclipse.ui.navigator.CommonActionProvider;
import org.eclipse.ui.navigator.ICommonActionExtensionSite;
import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
-import org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.newsourcepage.GenerateBuildPathActionGroup;
import org.eclipse.wst.jsdt.ui.actions.CCPActionGroup;
import org.eclipse.wst.jsdt.ui.actions.GenerateActionGroup;
import org.eclipse.wst.jsdt.ui.actions.JavaSearchActionGroup;
@@ -32,7 +31,6 @@
* hierarchy, call hierarchy, etc).</li>
* <li>{@link CCPActionGroup}. Contributes the Cut/Copy/Paste/Delete.</li>
* <li>{@link JavaSearchActionGroup}. Contributes the search functionality (find in workspace, project, etc).</li>
- * <li>{@link GenerateBuildPathActionGroup}. Contributes the "Build Path>" convenience submenu option.</li>
* <li>{@link GenerateActionGroup}. Contributes the "Source>" and "Generate>" submenu .</li>
* </ul>
*/
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/NativeLibrariesConfigurationBlock.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/NativeLibrariesConfigurationBlock.java
deleted file mode 100644
index 4234f25..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/NativeLibrariesConfigurationBlock.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.preferences;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.internal.corext.util.Messages;
-import org.eclipse.wst.jsdt.internal.ui.dialogs.StatusInfo;
-import org.eclipse.wst.jsdt.internal.ui.util.PixelConverter;
-import org.eclipse.wst.jsdt.internal.ui.wizards.IStatusChangeListener;
-import org.eclipse.wst.jsdt.internal.ui.wizards.NewWizardMessages;
-import org.eclipse.wst.jsdt.internal.ui.wizards.TypedElementSelectionValidator;
-import org.eclipse.wst.jsdt.internal.ui.wizards.TypedViewerFilter;
-import org.eclipse.wst.jsdt.internal.ui.wizards.dialogfields.DialogField;
-import org.eclipse.wst.jsdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
-import org.eclipse.wst.jsdt.internal.ui.wizards.dialogfields.LayoutUtil;
-import org.eclipse.wst.jsdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField;
-import org.eclipse.wst.jsdt.internal.ui.wizards.dialogfields.StringDialogField;
-
-public class NativeLibrariesConfigurationBlock {
-
- private class NativeLibrariesAdapter implements IDialogFieldListener {
- public void dialogFieldChanged(DialogField field) {
- doFieldChanged(field);
- }
- }
-
- private StringDialogField fPathField;
- private SelectionButtonDialogField fBrowseWorkspace;
- private SelectionButtonDialogField fBrowseExternal;
- private final IIncludePathEntry fEntry;
- private Shell fShell;
- private final IStatusChangeListener fListener;
- private final String fOrginalValue;
-
- public NativeLibrariesConfigurationBlock(IStatusChangeListener listener, Shell parent, String nativeLibPath, IIncludePathEntry parentEntry) {
- fListener= listener;
- fEntry= parentEntry;
-
- NativeLibrariesAdapter adapter= new NativeLibrariesAdapter();
-
- fPathField= new StringDialogField();
- fPathField.setLabelText(NewWizardMessages.NativeLibrariesDialog_location_label);
- fPathField.setDialogFieldListener(adapter);
-
- fBrowseWorkspace= new SelectionButtonDialogField(SWT.PUSH);
- fBrowseWorkspace.setLabelText(NewWizardMessages.NativeLibrariesDialog_workspace_browse);
- fBrowseWorkspace.setDialogFieldListener(adapter);
-
- fBrowseExternal= new SelectionButtonDialogField(SWT.PUSH);
- fBrowseExternal.setLabelText(NewWizardMessages.NativeLibrariesDialog_external_browse);
- fBrowseExternal.setDialogFieldListener(adapter);
-
- if (nativeLibPath != null) {
- fPathField.setText(Path.fromPortableString(nativeLibPath).toString());
- fOrginalValue= nativeLibPath;
- } else {
- fOrginalValue= ""; //$NON-NLS-1$
- }
- }
-
- public Control createContents(Composite parent) {
- fShell= parent.getShell();
-
- Composite inner= new Composite(parent, SWT.NONE);
- inner.setFont(parent.getFont());
- inner.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- int nColumns= 3;
-
- GridLayout layout= new GridLayout(nColumns, false);
- layout.marginWidth= 0;
- layout.marginWidth= 0;
- inner.setLayout(layout);
-
- PixelConverter converter= new PixelConverter(parent);
-
- Label desc= new Label(inner, SWT.WRAP);
- desc.setFont(inner.getFont());
- desc.setText(Messages.format(NewWizardMessages.NativeLibrariesDialog_description, new String[] { fEntry.getPath().lastSegment() }));
- GridData gridData= new GridData(GridData.FILL, GridData.CENTER, false, false, 3, 1);
- gridData.widthHint= converter.convertWidthInCharsToPixels(80);
- desc.setLayoutData(gridData);
-
- fPathField.doFillIntoGrid(inner, 2);
- LayoutUtil.setHorizontalGrabbing(fPathField.getTextControl(null));
- LayoutUtil.setWidthHint(fPathField.getTextControl(null), converter.convertWidthInCharsToPixels(50));
-
- fBrowseExternal.doFillIntoGrid(inner, 1);
-
- DialogField.createEmptySpace(inner, 2);
- fBrowseWorkspace.doFillIntoGrid(inner, 1);
-
- fPathField.setFocus();
-
- return parent;
- }
-
- public String getNativeLibraryPath() {
- String val= fPathField.getText();
- if (val.length() == 0) {
- return null;
- }
- return new Path(val).toPortableString();
- }
-
- final void doFieldChanged(DialogField field) {
- if (field == fBrowseExternal) {
- String res= chooseExternal();
- if (res != null) {
- fPathField.setText(res);
- }
- } else if (field == fBrowseWorkspace) {
- String res= chooseInternal();
- if (res != null) {
- fPathField.setText(res);
- }
- } else if (field == fPathField) {
- fListener.statusChanged(validatePath());
- }
- }
-
- private IStatus validatePath() {
- StatusInfo status= new StatusInfo();
- String val= fPathField.getText();
- if (val.length() == 0) {
- return status;
- }
- Path path= new Path(val);
- if (path.isAbsolute()) {
- if (!path.toFile().isDirectory()) {
- status.setWarning(NewWizardMessages.NativeLibrariesDialog_error_external_not_existing);
- return status;
- }
- } else {
- if (!(ResourcesPlugin.getWorkspace().getRoot().findMember(path) instanceof IContainer)) {
- status.setWarning(NewWizardMessages.NativeLibrariesDialog_error_internal_not_existing);
- return status;
- }
- }
- return status;
- }
-
- private String chooseExternal() {
- IPath currPath= new Path(fPathField.getText());
- if (currPath.isEmpty()) {
- currPath= fEntry.getPath();
- } else {
- currPath= currPath.removeLastSegments(1);
- }
-
- DirectoryDialog dialog= new DirectoryDialog(fShell);
- dialog.setMessage(NewWizardMessages.NativeLibrariesDialog_external_message);
- dialog.setText(NewWizardMessages.NativeLibrariesDialog_extfiledialog_text);
- dialog.setFilterPath(currPath.toOSString());
- String res= dialog.open();
- if (res != null) {
- return res;
- }
- return null;
- }
-
- /*
- * Opens a dialog to choose an internal file.
- */
- private String chooseInternal() {
- String initSelection= fPathField.getText();
-
- ILabelProvider lp= new WorkbenchLabelProvider();
- ITreeContentProvider cp= new WorkbenchContentProvider();
- Class[] acceptedClasses= new Class[] { IProject.class, IFolder.class };
- TypedElementSelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, true);
- ViewerFilter filter= new TypedViewerFilter(acceptedClasses);
-
- IResource initSel= null;
- IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
- if (initSelection.length() > 0) {
- initSel= root.findMember(new Path(initSelection));
- }
- if (initSel == null) {
- initSel= root.findMember(fEntry.getPath());
- }
-
- ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(fShell, lp, cp);
- dialog.setAllowMultiple(false);
- dialog.setValidator(validator);
- dialog.addFilter(filter);
- dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
- dialog.setTitle(NewWizardMessages.NativeLibrariesDialog_intfiledialog_title);
- dialog.setMessage(NewWizardMessages.NativeLibrariesDialog_intfiledialog_message);
- dialog.setInput(root);
- dialog.setInitialSelection(initSel);
- dialog.setHelpAvailable(false);
- if (dialog.open() == Window.OK) {
- IResource res= (IResource) dialog.getFirstResult();
- return res.getFullPath().makeRelative().toString();
- }
- return null;
- }
-
- public void performDefaults() {
- fPathField.setText(fOrginalValue);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameEnumConstWizard.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameEnumConstWizard.java
deleted file mode 100644
index 96178aa..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameEnumConstWizard.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.refactoring.reorg;
-
-import org.eclipse.ltk.core.refactoring.Refactoring;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.wst.jsdt.internal.ui.IJavaHelpContextIds;
-import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
-import org.eclipse.wst.jsdt.internal.ui.refactoring.RefactoringMessages;
-
-public final class RenameEnumConstWizard extends RenameRefactoringWizard {
-
- public RenameEnumConstWizard(Refactoring refactoring) {
- super(refactoring, RefactoringMessages.RenameEnumConstWizard_defaultPageTitle, RefactoringMessages.RenameEnumConstWizard_inputPage_description, JavaPluginImages.DESC_WIZBAN_REFACTOR_FIELD, IJavaHelpContextIds.RENAME_FIELD_WIZARD_PAGE);
- }
-
- protected RenameInputWizardPage createInputPage(String message, String initialSetting) {
- return new RenameInputWizardPage(message, IJavaHelpContextIds.RENAME_FIELD_WIZARD_PAGE, true, initialSetting) {
-
- protected RefactoringStatus validateTextField(String text) {
- return validateNewName(text);
- }
- };
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameUserInterfaceManager.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameUserInterfaceManager.java
index 70b3cfd..59374e8 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameUserInterfaceManager.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/refactoring/reorg/RenameUserInterfaceManager.java
@@ -11,7 +11,6 @@
package org.eclipse.wst.jsdt.internal.ui.refactoring.reorg;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameCompilationUnitProcessor;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameEnumConstProcessor;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameFieldProcessor;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameJavaProjectProcessor;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameLocalVariableProcessor;
@@ -40,7 +39,7 @@
put(RenameCompilationUnitProcessor.class, RenameUserInterfaceStarter.class, RenameCuWizard.class);
put(RenameTypeProcessor.class, RenameUserInterfaceStarter.class, RenameTypeWizard.class);
put(RenameFieldProcessor.class, RenameUserInterfaceStarter.class, RenameFieldWizard.class);
- put(RenameEnumConstProcessor.class, RenameUserInterfaceStarter.class, RenameEnumConstWizard.class);
+// put(RenameEnumConstProcessor.class, RenameUserInterfaceStarter.class, RenameEnumConstWizard.class);
put(RenameTypeParameterProcessor.class, RenameUserInterfaceStarter.class, RenameTypeParameterWizard.class);
put(RenameNonVirtualMethodProcessor.class, RenameMethodUserInterfaceStarter.class, RenameMethodWizard.class);
put(RenameVirtualMethodProcessor.class, RenameMethodUserInterfaceStarter.class, RenameMethodWizard.class);
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
index cc63fdd..c4c35c7 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java
@@ -39,17 +39,17 @@
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.wst.jsdt.core.dom.Assignment;
import org.eclipse.wst.jsdt.core.dom.Block;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.CatchClause;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
@@ -58,8 +58,7 @@
import org.eclipse.wst.jsdt.core.dom.InfixExpression;
import org.eclipse.wst.jsdt.core.dom.Initializer;
import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
@@ -94,8 +93,8 @@
import org.eclipse.wst.jsdt.internal.corext.refactoring.surround.SurroundWithTryCatchRefactoring;
import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil;
import org.eclipse.wst.jsdt.internal.corext.util.Messages;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
+import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.fix.CodeStyleCleanUp;
import org.eclipse.wst.jsdt.internal.ui.fix.Java50CleanUp;
import org.eclipse.wst.jsdt.internal.ui.fix.StringCleanUp;
@@ -895,18 +894,18 @@
return new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, relevance, image);
}
- public static void addValueForAnnotationProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) {
- IJavaScriptUnit cu= context.getCompilationUnit();
- ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
- if (selectedNode instanceof Annotation) {
- Annotation annotation= (Annotation) selectedNode;
- if (annotation.resolveTypeBinding() == null) {
- return;
- }
- MissingAnnotationAttributesProposal proposal= new MissingAnnotationAttributesProposal(cu, annotation, 10);
- proposals.add(proposal);
- }
- }
+// public static void addValueForAnnotationProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) {
+// IJavaScriptUnit cu= context.getCompilationUnit();
+// ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
+// if (selectedNode instanceof Annotation) {
+// Annotation annotation= (Annotation) selectedNode;
+// if (annotation.resolveTypeBinding() == null) {
+// return;
+// }
+// MissingAnnotationAttributesProposal proposal= new MissingAnnotationAttributesProposal(cu, annotation, 10);
+// proposals.add(proposal);
+// }
+// }
public static void addTypePrametersToRawTypeReference(IInvocationContext context, IProblemLocation problem, Collection proposals) {
IFix fix= Java50Fix.createRawTypeReferenceFix(context.getASTRoot(), problem);
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/MissingAnnotationAttributesProposal.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/MissingAnnotationAttributesProposal.java
deleted file mode 100644
index 2a26604..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/MissingAnnotationAttributesProposal.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.internal.ui.text.correction;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.MarkerAnnotation;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NormalAnnotation;
-import org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
-import org.eclipse.wst.jsdt.core.dom.rewrite.ListRewrite;
-import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
-
-public class MissingAnnotationAttributesProposal extends LinkedCorrectionProposal {
-
- private Annotation fAnnotation;
-
- public MissingAnnotationAttributesProposal(IJavaScriptUnit cu, Annotation annotation, int relevance) {
- super(CorrectionMessages.MissingAnnotationAttributesProposal_add_missing_attributes_label, cu, null, relevance, null);
- setImage(JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE));
-
- fAnnotation= annotation;
- Assert.isNotNull(fAnnotation.resolveTypeBinding());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.internal.ui.text.correction.ASTRewriteCorrectionProposal#getRewrite()
- */
- protected ASTRewrite getRewrite() throws CoreException {
- AST ast= fAnnotation.getAST();
-
- ASTRewrite rewrite= ASTRewrite.create(ast);
- createImportRewrite((JavaScriptUnit) fAnnotation.getRoot());
-
- ListRewrite listRewrite;
- if (fAnnotation instanceof NormalAnnotation) {
- listRewrite= rewrite.getListRewrite(fAnnotation, NormalAnnotation.VALUES_PROPERTY);
- } else {
- NormalAnnotation newAnnotation= ast.newNormalAnnotation();
- newAnnotation.setTypeName((Name) rewrite.createMoveTarget(fAnnotation.getTypeName()));
- rewrite.replace(fAnnotation, newAnnotation, null);
-
- listRewrite= rewrite.getListRewrite(newAnnotation, NormalAnnotation.VALUES_PROPERTY);
- }
- addMissingAtributes(fAnnotation.resolveTypeBinding(), listRewrite);
-
- return rewrite;
- }
-
- private void addMissingAtributes(ITypeBinding binding, ListRewrite listRewriter) {
- Set implementedAttribs= new HashSet();
- if (fAnnotation instanceof NormalAnnotation) {
- List list= ((NormalAnnotation) fAnnotation).values();
- for (int i= 0; i < list.size(); i++) {
- MemberValuePair curr= (MemberValuePair) list.get(i);
- implementedAttribs.add(curr.getName().getIdentifier());
- }
- } else if (fAnnotation instanceof SingleMemberAnnotation){
- implementedAttribs.add("value"); //$NON-NLS-1$
- }
- ASTRewrite rewriter= listRewriter.getASTRewrite();
- AST ast= rewriter.getAST();
-
- IFunctionBinding[] declaredMethods= binding.getDeclaredMethods();
- for (int i= 0; i < declaredMethods.length; i++) {
- IFunctionBinding curr= declaredMethods[i];
- if (!implementedAttribs.contains(curr.getName()) && curr.getDefaultValue() == null) {
- MemberValuePair pair= ast.newMemberValuePair();
- pair.setName(ast.newSimpleName(curr.getName()));
- pair.setValue(newDefaultExpression(ast, curr.getReturnType()));
- listRewriter.insertLast(pair, null);
-
- addLinkedPosition(rewriter.track(pair.getName()), false, "val_name_" + i); //$NON-NLS-1$
- addLinkedPosition(rewriter.track(pair.getValue()), false, "val_type_" + i); //$NON-NLS-1$
- }
- }
- }
-
- private Expression newDefaultExpression(AST ast, ITypeBinding type) {
- if (type.isPrimitive()) {
- String name= type.getName();
- if ("boolean".equals(name)) { //$NON-NLS-1$
- return ast.newBooleanLiteral(false);
- } else {
- return ast.newNumberLiteral("0"); //$NON-NLS-1$
- }
- }
- if (type == ast.resolveWellKnownType("java.lang.String")) { //$NON-NLS-1$
- return ast.newStringLiteral();
- }
- if (type.isArray()) {
- ArrayInitializer initializer= ast.newArrayInitializer();
- initializer.expressions().add(newDefaultExpression(ast, type.getElementType()));
- return initializer;
- }
- if (type.isAnnotation()) {
- MarkerAnnotation annotation= ast.newMarkerAnnotation();
- annotation.setTypeName(ast.newName(getImportRewrite().addImport(type)));
- return annotation;
- }
- return ast.newNullLiteral();
- }
-
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewAnnotationMemberProposal.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewAnnotationMemberProposal.java
deleted file mode 100644
index 16a7a7a..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/NewAnnotationMemberProposal.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.internal.ui.text.correction;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnnotationTypeMemberDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ChildListPropertyDescriptor;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.Type;
-import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
-import org.eclipse.wst.jsdt.core.dom.rewrite.ListRewrite;
-import org.eclipse.wst.jsdt.internal.corext.dom.ASTNodeFactory;
-import org.eclipse.wst.jsdt.internal.corext.dom.ASTNodes;
-
-/**
- *
- */
-public class NewAnnotationMemberProposal extends LinkedCorrectionProposal {
-
- private static final String KEY_NAME= "name"; //$NON-NLS-1$
- private static final String KEY_TYPE= "type"; //$NON-NLS-1$
-
- private final ASTNode fInvocationNode;
- private final ITypeBinding fSenderBinding;
-
- public NewAnnotationMemberProposal(String label, IJavaScriptUnit targetCU, ASTNode invocationNode, ITypeBinding binding, int relevance, Image image) {
- super(label, targetCU, null, relevance, image);
- fInvocationNode= invocationNode;
- fSenderBinding= binding;
- }
-
- protected ASTRewrite getRewrite() throws CoreException {
- JavaScriptUnit astRoot= ASTResolving.findParentCompilationUnit(fInvocationNode);
- ASTNode typeDecl= astRoot.findDeclaringNode(fSenderBinding);
- ASTNode newTypeDecl= null;
- if (typeDecl != null) {
- newTypeDecl= typeDecl;
- } else {
- astRoot= ASTResolving.createQuickFixAST(getCompilationUnit(), null);
- newTypeDecl= astRoot.findDeclaringNode(fSenderBinding.getKey());
- }
- createImportRewrite(astRoot);
-
- if (newTypeDecl instanceof AnnotationTypeDeclaration) {
- ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST());
-
- AnnotationTypeMemberDeclaration newStub= getStub(rewrite, (AnnotationTypeDeclaration) newTypeDecl);
-
- ChildListPropertyDescriptor property= ASTNodes.getBodyDeclarationsProperty(newTypeDecl);
- List members= (List) newTypeDecl.getStructuralProperty(property);
- int insertIndex= members.size();
-
- ListRewrite listRewriter= rewrite.getListRewrite(newTypeDecl, property);
- listRewriter.insertAt(newStub, insertIndex, null);
-
- return rewrite;
- }
- return null;
- }
-
- private AnnotationTypeMemberDeclaration getStub(ASTRewrite rewrite, AnnotationTypeDeclaration targetTypeDecl) throws CoreException {
- AST ast= targetTypeDecl.getAST();
-
- AnnotationTypeMemberDeclaration decl= ast.newAnnotationTypeMemberDeclaration();
-
- SimpleName newNameNode= getNewName(rewrite);
-
- decl.modifiers().addAll(ASTNodeFactory.newModifiers(ast, evaluateModifiers(targetTypeDecl)));
-
- ModifierCorrectionSubProcessor.installLinkedVisibilityProposals(getLinkedProposalModel(), rewrite, decl.modifiers(), true);
-
- decl.setName(newNameNode);
-
- Type returnType= getNewType(rewrite);
- decl.setType(returnType);
- return decl;
- }
-
-
- private Type getNewType(ASTRewrite rewrite) {
- AST ast= rewrite.getAST();
- Type newTypeNode= null;
- ITypeBinding binding= null;
- if (fInvocationNode.getLocationInParent() == MemberValuePair.NAME_PROPERTY) {
- Expression value= ((MemberValuePair) fInvocationNode.getParent()).getValue();
- binding= value.resolveTypeBinding();
- } else if (fInvocationNode instanceof Expression) {
- binding= ((Expression) fInvocationNode).resolveTypeBinding();
- }
- if (binding != null) {
- newTypeNode= getImportRewrite().addImport(binding, ast);
- }
- if (newTypeNode == null) {
- newTypeNode= ast.newSimpleType(ast.newSimpleName("String")); //$NON-NLS-1$
- }
- addLinkedPosition(rewrite.track(newTypeNode), false, KEY_TYPE);
- return newTypeNode;
- }
-
- private int evaluateModifiers(AnnotationTypeDeclaration targetTypeDecl) {
- List methodDecls= targetTypeDecl.bodyDeclarations();
- for (int i= 0; i < methodDecls.size(); i++) {
- Object curr= methodDecls.get(i);
- if (curr instanceof AnnotationTypeMemberDeclaration) {
- return ((AnnotationTypeMemberDeclaration) curr).getModifiers();
- }
- }
- return 0;
- }
-
- private SimpleName getNewName(ASTRewrite rewrite) {
- AST ast= rewrite.getAST();
- String name;
- if (fInvocationNode.getLocationInParent() == MemberValuePair.NAME_PROPERTY) {
- name= ((SimpleName) fInvocationNode).getIdentifier();
- if (ast == fInvocationNode.getAST()) {
- addLinkedPosition(rewrite.track(fInvocationNode), true, KEY_NAME);
- }
- } else {
- name= "value"; //$NON-NLS-1$
- }
-
-
- SimpleName newNameNode= ast.newSimpleName(name);
- addLinkedPosition(rewrite.track(newNameNode), false, KEY_NAME);
- return newNameNode;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java
index a12a653..4d584b4 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java
@@ -257,9 +257,9 @@
case IProblem.UndefinedConstructor:
UnresolvedElementsSubProcessor.getConstructorProposals(context, problem, proposals);
break;
- case IProblem.UndefinedAnnotationMember:
- UnresolvedElementsSubProcessor.getAnnotationMemberProposals(context, problem, proposals);
- break;
+// case IProblem.UndefinedAnnotationMember:
+// UnresolvedElementsSubProcessor.getAnnotationMemberProposals(context, problem, proposals);
+// break;
case IProblem.ParameterMismatch:
UnresolvedElementsSubProcessor.getMethodProposals(context, problem, true, proposals);
break;
@@ -384,9 +384,9 @@
case IProblem.AbstractMethodMustBeImplemented:
LocalCorrectionsSubProcessor.addUnimplementedMethodsProposals(context, problem, proposals);
break;
- case IProblem.MissingValueForAnnotationMember:
- LocalCorrectionsSubProcessor.addValueForAnnotationProposals(context, problem, proposals);
- break;
+// case IProblem.MissingValueForAnnotationMember:
+// LocalCorrectionsSubProcessor.addValueForAnnotationProposals(context, problem, proposals);
+// break;
case IProblem.BodyForNativeMethod:
ModifierCorrectionSubProcessor.addNativeMethodProposals(context, problem, proposals);
break;
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java
index 9d1ee22..c067282 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java
@@ -19,9 +19,9 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
@@ -29,32 +29,28 @@
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTMatcher;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.Annotation;
import org.eclipse.wst.jsdt.core.dom.ArrayType;
import org.eclipse.wst.jsdt.core.dom.Assignment;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.CastExpression;
import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
import org.eclipse.wst.jsdt.core.dom.Expression;
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
+import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
import org.eclipse.wst.jsdt.core.dom.IBinding;
import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.IPackageBinding;
import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.MemberValuePair;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.Modifier;
import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NormalAnnotation;
import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
import org.eclipse.wst.jsdt.core.dom.QualifiedName;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleMemberAnnotation;
import org.eclipse.wst.jsdt.core.dom.StructuralPropertyDescriptor;
import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
@@ -77,8 +73,8 @@
import org.eclipse.wst.jsdt.internal.corext.util.Messages;
import org.eclipse.wst.jsdt.internal.corext.util.QualifiedTypeNameHistory;
import org.eclipse.wst.jsdt.internal.corext.util.TypeFilter;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
+import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.ChangeDescription;
import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.EditDescription;
import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.InsertDescription;
@@ -1555,53 +1551,53 @@
proposals.add(new RenameNodeCompletionProposal(label, context.getCompilationUnit(), offset, length, lengthId, 7));
}
- public static void getAnnotationMemberProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
- JavaScriptUnit astRoot= context.getASTRoot();
- IJavaScriptUnit cu= context.getCompilationUnit();
- ASTNode selectedNode= problem.getCoveringNode(astRoot);
-
- Annotation annotation;
- String memberName;
- if (selectedNode.getLocationInParent() == MemberValuePair.NAME_PROPERTY) {
- if (selectedNode.getParent().getLocationInParent() != NormalAnnotation.VALUES_PROPERTY) {
- return;
- }
- annotation= (Annotation) selectedNode.getParent().getParent();
- memberName= ((SimpleName) selectedNode).getIdentifier();
- } else if (selectedNode.getLocationInParent() == SingleMemberAnnotation.VALUE_PROPERTY) {
- annotation= (Annotation) selectedNode.getParent();
- memberName= "value"; //$NON-NLS-1$
- } else {
- return;
- }
-
- ITypeBinding annotBinding= annotation.resolveTypeBinding();
- if (annotBinding == null) {
- return;
- }
-
-
- if (annotation instanceof NormalAnnotation) {
- // similar names
- IFunctionBinding[] otherMembers= annotBinding.getDeclaredMethods();
- for (int i= 0; i < otherMembers.length; i++) {
- IFunctionBinding binding= otherMembers[i];
- String curr= binding.getName();
- int relevance= NameMatcher.isSimilarName(memberName, curr) ? 6 : 3;
- String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_UnresolvedElementsSubProcessor_changetoattribute_description, curr);
- proposals.add(new RenameNodeCompletionProposal(label, cu, problem.getOffset(), problem.getLength(), curr, relevance));
- }
- }
-
- if (annotBinding.isFromSource()) {
- IJavaScriptUnit targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, annotBinding);
- if (targetCU != null) {
- String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_UnresolvedElementsSubProcessor_createattribute_description, memberName);
- Image image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PUBLIC);
- proposals.add(new NewAnnotationMemberProposal(label, targetCU, selectedNode, annotBinding, 5, image));
- }
- }
- }
+// public static void getAnnotationMemberProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
+// JavaScriptUnit astRoot= context.getASTRoot();
+// IJavaScriptUnit cu= context.getCompilationUnit();
+// ASTNode selectedNode= problem.getCoveringNode(astRoot);
+//
+// Annotation annotation;
+// String memberName;
+// if (selectedNode.getLocationInParent() == MemberValuePair.NAME_PROPERTY) {
+// if (selectedNode.getParent().getLocationInParent() != NormalAnnotation.VALUES_PROPERTY) {
+// return;
+// }
+// annotation= (Annotation) selectedNode.getParent().getParent();
+// memberName= ((SimpleName) selectedNode).getIdentifier();
+// } else if (selectedNode.getLocationInParent() == SingleMemberAnnotation.VALUE_PROPERTY) {
+// annotation= (Annotation) selectedNode.getParent();
+// memberName= "value"; //$NON-NLS-1$
+// } else {
+// return;
+// }
+//
+// ITypeBinding annotBinding= annotation.resolveTypeBinding();
+// if (annotBinding == null) {
+// return;
+// }
+//
+//
+// if (annotation instanceof NormalAnnotation) {
+// // similar names
+// IFunctionBinding[] otherMembers= annotBinding.getDeclaredMethods();
+// for (int i= 0; i < otherMembers.length; i++) {
+// IFunctionBinding binding= otherMembers[i];
+// String curr= binding.getName();
+// int relevance= NameMatcher.isSimilarName(memberName, curr) ? 6 : 3;
+// String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_UnresolvedElementsSubProcessor_changetoattribute_description, curr);
+// proposals.add(new RenameNodeCompletionProposal(label, cu, problem.getOffset(), problem.getLength(), curr, relevance));
+// }
+// }
+//
+// if (annotBinding.isFromSource()) {
+// IJavaScriptUnit targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, annotBinding);
+// if (targetCU != null) {
+// String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_UnresolvedElementsSubProcessor_createattribute_description, memberName);
+// Image image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PUBLIC);
+// proposals.add(new NewAnnotationMemberProposal(label, targetCU, selectedNode, annotBinding, 5, image));
+// }
+// }
+// }
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
index 177e6b0..1b58270 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/typehierarchy/TypeHierarchyViewPart.java
@@ -411,17 +411,6 @@
}
/**
- * @return The input type
- * @deprecated
- */
- public IType getInput() {
- if (fInputElement instanceof IType) {
- return (IType) fInputElement;
- }
- return null;
- }
-
- /**
* Sets the input to a new type
* @param type The new input type
* @deprecated
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/MainMethodSearchEngine.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/MainMethodSearchEngine.java
deleted file mode 100644
index d184457..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/util/MainMethodSearchEngine.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.util;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.wst.jsdt.core.IFunction;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchConstants;
-import org.eclipse.wst.jsdt.core.search.IJavaScriptSearchScope;
-import org.eclipse.wst.jsdt.core.search.SearchEngine;
-import org.eclipse.wst.jsdt.core.search.SearchMatch;
-import org.eclipse.wst.jsdt.core.search.SearchPattern;
-import org.eclipse.wst.jsdt.core.search.SearchRequestor;
-import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil;
-import org.eclipse.wst.jsdt.internal.corext.util.SearchUtils;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.ui.IJavaScriptElementSearchConstants;
-
-public class MainMethodSearchEngine{
-
- private static class MethodCollector extends SearchRequestor {
- private List fResult;
- private int fStyle;
-
- public MethodCollector(List result, int style) {
- Assert.isNotNull(result);
- fResult= result;
- fStyle= style;
- }
-
- private boolean considerExternalJars() {
- return (fStyle & IJavaScriptElementSearchConstants.CONSIDER_EXTERNAL_JARS) != 0;
- }
-
- private boolean considerBinaries() {
- return (fStyle & IJavaScriptElementSearchConstants.CONSIDER_BINARIES) != 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.wst.jsdt.core.search.SearchMatch)
- */
- public void acceptSearchMatch(SearchMatch match) throws CoreException {
- Object enclosingElement= match.getElement();
- if (enclosingElement instanceof IFunction) { // defensive code
- try {
- IFunction curr= (IFunction) enclosingElement;
- if (curr.isMainMethod()) {
- if (!considerExternalJars()) {
- IPackageFragmentRoot root= JavaModelUtil.getPackageFragmentRoot(curr);
- if (root == null || root.isArchive()) {
- return;
- }
- }
- if (!considerBinaries() && curr.isBinary()) {
- return;
- }
- fResult.add(curr.getDeclaringType());
- }
- } catch (JavaScriptModelException e) {
- JavaScriptPlugin.log(e.getStatus());
- }
- }
- }
- }
-
- /**
- * Searches for all main methods in the given scope.
- * Valid styles are IJavaScriptElementSearchConstants.CONSIDER_BINARIES and
- * IJavaScriptElementSearchConstants.CONSIDER_EXTERNAL_JARS
- */
- public IType[] searchMainMethods(IProgressMonitor pm, IJavaScriptSearchScope scope, int style) throws CoreException {
- List typesFound= new ArrayList(200);
-
- SearchPattern pattern= SearchPattern.createPattern("main(String[]) void", //$NON-NLS-1$
- IJavaScriptSearchConstants.METHOD, IJavaScriptSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
- SearchRequestor requestor= new MethodCollector(typesFound, style);
- new SearchEngine().search(pattern, SearchUtils.getDefaultSearchParticipants(), scope, requestor, pm);
-
- return (IType[]) typesFound.toArray(new IType[typesFound.size()]);
- }
-
-
-
- /**
- * Searches for all main methods in the given scope.
- * Valid styles are IJavaScriptElementSearchConstants.CONSIDER_BINARIES and
- * IJavaScriptElementSearchConstants.CONSIDER_EXTERNAL_JARS
- */
- public IType[] searchMainMethods(IRunnableContext context, final IJavaScriptSearchScope scope, final int style) throws InvocationTargetException, InterruptedException {
- int allFlags= IJavaScriptElementSearchConstants.CONSIDER_EXTERNAL_JARS | IJavaScriptElementSearchConstants.CONSIDER_BINARIES;
- Assert.isTrue((style | allFlags) == allFlags);
-
- final IType[][] res= new IType[1][];
-
- IRunnableWithProgress runnable= new IRunnableWithProgress() {
- public void run(IProgressMonitor pm) throws InvocationTargetException {
- try {
- res[0]= searchMainMethods(pm, scope, style);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- };
- context.run(true, true, runnable);
-
- return res[0];
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/NativeLibAttributeConfiguration.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/NativeLibAttributeConfiguration.java
deleted file mode 100644
index ffcc09f..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/NativeLibAttributeConfiguration.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
-import org.eclipse.wst.jsdt.internal.ui.wizards.NewWizardMessages;
-import org.eclipse.wst.jsdt.launching.JavaRuntime;
-import org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration;
-
-
-public class NativeLibAttributeConfiguration extends ClasspathAttributeConfiguration {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration#getImageDescriptor(org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public ImageDescriptor getImageDescriptor(ClasspathAttributeAccess attribute) {
- return JavaPluginImages.DESC_OBJS_NATIVE_LIB_PATH_ATTRIB;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration#getNameLabel(org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public String getNameLabel(ClasspathAttributeAccess attribute) {
- return NewWizardMessages.CPListLabelProvider_native_library_path;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration#getValueLabel(org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public String getValueLabel(ClasspathAttributeAccess attribute) {
- String arg= attribute.getClasspathAttribute().getValue();
- if (arg == null) {
- arg= NewWizardMessages.CPListLabelProvider_none;
- }
- return arg;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration#canEdit(org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public boolean canEdit(ClasspathAttributeAccess attribute) {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration#canRemove(org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public boolean canRemove(ClasspathAttributeAccess attribute) {
- return attribute.getClasspathAttribute().getValue() != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration#performEdit(org.eclipse.swt.widgets.Shell, org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public IIncludePathAttribute performEdit(Shell shell, ClasspathAttributeAccess attribute) {
- NativeLibrariesDialog dialog= new NativeLibrariesDialog(shell, attribute.getClasspathAttribute().getValue(), attribute.getParentClasspassEntry());
- if (dialog.open() == Window.OK) {
- return JavaScriptCore.newIncludepathAttribute(JavaRuntime.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY, dialog.getNativeLibraryPath());
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration#performRemove(org.eclipse.wst.jsdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttributeAccess)
- */
- public IIncludePathAttribute performRemove(ClasspathAttributeAccess attribute) {
- return JavaScriptCore.newIncludepathAttribute(JavaRuntime.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY, null);
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/NativeLibrariesDialog.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/NativeLibrariesDialog.java
deleted file mode 100644
index 977a95b..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/NativeLibrariesDialog.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.internal.ui.preferences.NativeLibrariesConfigurationBlock;
-import org.eclipse.wst.jsdt.internal.ui.wizards.IStatusChangeListener;
-import org.eclipse.wst.jsdt.internal.ui.wizards.NewWizardMessages;
-
-/**
- *
- */
-public class NativeLibrariesDialog extends StatusDialog {
-
- private final NativeLibrariesConfigurationBlock fConfigurationBlock;
-
- public NativeLibrariesDialog(Shell parent, String nativeLibPath, IIncludePathEntry parentEntry) {
- super(parent);
- setTitle(NewWizardMessages.NativeLibrariesDialog_title);
-
- setShellStyle(getShellStyle() | SWT.RESIZE);
-
- IStatusChangeListener listener= new IStatusChangeListener() {
- public void statusChanged(IStatus status) {
- updateStatus(status);
- }
- };
-
- fConfigurationBlock= new NativeLibrariesConfigurationBlock(listener, parent, nativeLibPath, parentEntry);
- setHelpAvailable(false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite composite= (Composite) super.createDialogArea(parent);
- Control inner= fConfigurationBlock.createContents(composite);
- inner.setLayoutData(new GridData(GridData.FILL_BOTH));
- applyDialogFont(composite);
- return composite;
- }
-
- public String getNativeLibraryPath() {
- return fConfigurationBlock.getNativeLibraryPath();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/AddArchiveToBuildpathAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/AddArchiveToBuildpathAction.java
deleted file mode 100644
index e046657..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/AddArchiveToBuildpathAction.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.newsourcepage;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.internal.corext.buildpath.BuildpathDelta;
-import org.eclipse.wst.jsdt.internal.corext.buildpath.CPJavaProject;
-import org.eclipse.wst.jsdt.internal.corext.buildpath.ClasspathModifier;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
-import org.eclipse.wst.jsdt.internal.ui.wizards.NewWizardMessages;
-import org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.CPListElement;
-import org.eclipse.wst.jsdt.ui.wizards.BuildPathDialogAccess;
-
-//SelectedElements iff enabled: IJavaScriptProject && size==1
-public class AddArchiveToBuildpathAction extends BuildpathModifierAction {
-
- private final IRunnableContext fContext;
-
- public AddArchiveToBuildpathAction(IWorkbenchSite site) {
- this(site, null, PlatformUI.getWorkbench().getProgressService());
- }
-
- public AddArchiveToBuildpathAction(IRunnableContext context, ISetSelectionTarget selectionTarget) {
- this(null, selectionTarget, context);
- }
-
- private AddArchiveToBuildpathAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
- super(site, selectionTarget, BuildpathModifierAction.ADD_LIB_TO_BP);
-
- fContext= context;
-
- setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddJarCP_label);
- setImageDescriptor(JavaPluginImages.DESC_OBJS_EXTJAR);
- setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddJarCP_tooltip);
- }
-
- /**
- * {@inheritDoc}
- */
- public String getDetailedDescription() {
- return NewWizardMessages.PackageExplorerActionGroup_FormText_Default_toBuildpath_archives;
- }
-
- /**
- * {@inheritDoc}
- */
- public void run() {
-
- final Shell shell= getShell();
- final IPath[] selected= BuildPathDialogAccess.chooseExternalJAREntries(shell);
- if (selected == null)
- return;
-
- try {
- final IJavaScriptProject javaProject= (IJavaScriptProject)getSelectedElements().get(0);
- IStatus status= ClasspathModifier.checkAddExternalJarsPrecondition(selected, CPJavaProject.createFromExisting(javaProject));
- if (status.getSeverity() == IStatus.ERROR) {
- MessageDialog.openError(getShell(), NewWizardMessages.AddArchiveToBuildpathAction_InfoTitle, status.getMessage());
- return;
- } else if (status.getSeverity() == IStatus.INFO) {
- MessageDialog.openInformation(getShell(), NewWizardMessages.AddArchiveToBuildpathAction_InfoTitle, status.getMessage());
- } else if (status.getSeverity() == IStatus.WARNING) {
- MessageDialog.openWarning(getShell(), NewWizardMessages.AddArchiveToBuildpathAction_InfoTitle, status.getMessage());
- }
-
- final IRunnableWithProgress runnable= new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- List result= addExternalJars(selected, javaProject, monitor);
- if (result.size() > 0)
- selectAndReveal(new StructuredSelection(result));
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- };
- fContext.run(false, false, runnable);
- } catch (final InvocationTargetException e) {
- if (e.getCause() instanceof CoreException) {
- showExceptionDialog((CoreException)e.getCause(), NewWizardMessages.AddArchiveToBuildpathAction_ErrorTitle);
- } else {
- JavaScriptPlugin.log(e);
- }
- } catch (CoreException e) {
- showExceptionDialog(e, NewWizardMessages.AddArchiveToBuildpathAction_ErrorTitle);
- JavaScriptPlugin.log(e);
- } catch (InterruptedException e) {
- }
- }
-
- private List addExternalJars(IPath[] jarPaths, IJavaScriptProject project, IProgressMonitor monitor) throws CoreException {
- if (monitor == null)
- monitor= new NullProgressMonitor();
- try {
- monitor.beginTask(NewWizardMessages.ClasspathModifier_Monitor_AddToBuildpath, 4);
-
- CPJavaProject cpProject= CPJavaProject.createFromExisting(project);
- BuildpathDelta delta= ClasspathModifier.addExternalJars(jarPaths, cpProject);
- ClasspathModifier.commitClassPath(cpProject, new SubProgressMonitor(monitor, 4));
-
- informListeners(delta);
-
- List addedEntries= delta.getAddedEntries();
- List result= new ArrayList(addedEntries.size());
- for (int i= 0; i < addedEntries.size(); i++) {
- IIncludePathEntry entry= ((CPListElement) addedEntries.get(i)).getClasspathEntry();
- IJavaScriptElement elem= project.findPackageFragmentRoot(entry.getPath());
- if (elem != null) {
- result.add(elem);
- }
- }
- monitor.worked(1);
- return result;
- } finally {
- monitor.done();
- }
- }
-
- protected boolean canHandle(IStructuredSelection selection) {
- if (selection.size() != 1)
- return false;
-
- Object first= selection.getFirstElement();
- if (!(first instanceof IJavaScriptProject))
- return false;
-
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/AddLibraryToBuildpathAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/AddLibraryToBuildpathAction.java
deleted file mode 100644
index 9d01c8f..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/AddLibraryToBuildpathAction.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.newsourcepage;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.corext.buildpath.BuildpathDelta;
-import org.eclipse.wst.jsdt.internal.corext.buildpath.ClasspathModifier;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
-import org.eclipse.wst.jsdt.internal.ui.actions.WorkbenchRunnableAdapter;
-import org.eclipse.wst.jsdt.internal.ui.packageview.JsGlobalScopeContainer;
-import org.eclipse.wst.jsdt.internal.ui.util.PixelConverter;
-import org.eclipse.wst.jsdt.internal.ui.wizards.NewWizardMessages;
-import org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.CPListElement;
-import org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.JsGlobalScopeContainerWizard;
-
-//SelectedElements: IJavaScriptProject && size == 1
-public class AddLibraryToBuildpathAction extends BuildpathModifierAction {
-
- public AddLibraryToBuildpathAction(IWorkbenchSite site) {
- this(site, null, PlatformUI.getWorkbench().getProgressService());
- }
-
- public AddLibraryToBuildpathAction(IRunnableContext context, ISetSelectionTarget selectionTarget) {
- this(null, selectionTarget, context);
- }
-
- private AddLibraryToBuildpathAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
- super(site, selectionTarget, BuildpathModifierAction.ADD_LIB_TO_BP);
-
- setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddLibCP_label);
- setImageDescriptor(JavaPluginImages.DESC_OBJS_LIBRARY);
- setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddLibCP_tooltip);
- }
-
- /**
- * {@inheritDoc}
- */
- public String getDetailedDescription() {
- return NewWizardMessages.PackageExplorerActionGroup_FormText_Default_toBuildpath_library;
- }
-
- /**
- * {@inheritDoc}
- */
- public void run() {
- final IJavaScriptProject project= (IJavaScriptProject)getSelectedElements().get(0);
-
- Shell shell= getShell();
- if (shell == null) {
- shell= JavaScriptPlugin.getActiveWorkbenchShell();
- }
-
- IIncludePathEntry[] classpath;
- try {
- classpath= project.getRawIncludepath();
- } catch (JavaScriptModelException e1) {
- showExceptionDialog(e1, NewWizardMessages.AddLibraryToBuildpathAction_ErrorTitle);
- return;
- }
-
- JsGlobalScopeContainerWizard wizard= new JsGlobalScopeContainerWizard((IIncludePathEntry) null, project, classpath) {
-
- /**
- * {@inheritDoc}
- */
- public boolean performFinish() {
- if (super.performFinish()) {
- IWorkspaceRunnable op= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException, OperationCanceledException {
- try {
- finishPage(monitor);
- } catch (InterruptedException e) {
- throw new OperationCanceledException(e.getMessage());
- }
- }
- };
- try {
- ISchedulingRule rule= null;
- Job job= Job.getJobManager().currentJob();
- if (job != null)
- rule= job.getRule();
- IRunnableWithProgress runnable= null;
- if (rule != null)
- runnable= new WorkbenchRunnableAdapter(op, rule, true);
- else
- runnable= new WorkbenchRunnableAdapter(op, ResourcesPlugin.getWorkspace().getRoot());
- getContainer().run(false, true, runnable);
- } catch (InvocationTargetException e) {
- JavaScriptPlugin.log(e);
- return false;
- } catch (InterruptedException e) {
- return false;
- }
- return true;
- }
- return false;
- }
-
- private void finishPage(IProgressMonitor pm) throws InterruptedException {
- IIncludePathEntry[] selected= getNewEntries();
- if (selected != null) {
- try {
- pm.beginTask(NewWizardMessages.ClasspathModifier_Monitor_AddToBuildpath, 4);
-
- List addedEntries= new ArrayList();
- for (int i= 0; i < selected.length; i++) {
- addedEntries.add(new CPListElement(project, IIncludePathEntry.CPE_CONTAINER, selected[i].getPath(), null));
- }
-
- pm.worked(1);
- if (pm.isCanceled())
- throw new InterruptedException();
-
- List existingEntries= ClasspathModifier.getExistingEntries(project);
- ClasspathModifier.setNewEntry(existingEntries, addedEntries, project, new SubProgressMonitor(pm, 1));
- if (pm.isCanceled())
- throw new InterruptedException();
-
- ClasspathModifier.commitClassPath(existingEntries, project, new SubProgressMonitor(pm, 1));
-
- BuildpathDelta delta= new BuildpathDelta(getToolTipText());
- delta.setNewEntries((CPListElement[])existingEntries.toArray(new CPListElement[existingEntries.size()]));
- informListeners(delta);
-
- List result= new ArrayList(addedEntries.size());
- for (int i= 0; i < addedEntries.size(); i++) {
- result.add(new JsGlobalScopeContainer(project, selected[i]));
- }
- selectAndReveal(new StructuredSelection(result));
-
- pm.worked(1);
- } catch (CoreException e) {
- showExceptionDialog(e, NewWizardMessages.AddLibraryToBuildpathAction_ErrorTitle);
- } finally {
- pm.done();
- }
- }
- }
- };
- wizard.setNeedsProgressMonitor(true);
-
- WizardDialog dialog= new WizardDialog(shell, wizard);
- PixelConverter converter= new PixelConverter(shell);
- dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20));
- dialog.create();
- dialog.open();
- }
-
- protected boolean canHandle(IStructuredSelection selection) {
- if (selection.size() != 1)
- return false;
-
- if (!(selection.getFirstElement() instanceof IJavaScriptProject))
- return false;
-
- return true;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ConfigureBuildPathAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ConfigureBuildPathAction.java
deleted file mode 100644
index 6733732..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ConfigureBuildPathAction.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Matt McCutchen - Bug 148313 [build path] "Configure Build Path" incorrectly appears for non-Java projects
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.newsourcepage;
-
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil;
-import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
-import org.eclipse.wst.jsdt.internal.ui.packageview.JsGlobalScopeContainer;
-import org.eclipse.wst.jsdt.internal.ui.packageview.PackageFragmentRootContainer;
-import org.eclipse.wst.jsdt.internal.ui.preferences.BuildPathsPropertyPage;
-import org.eclipse.wst.jsdt.internal.ui.wizards.NewWizardMessages;
-
-//SelectedElements iff enabled: (IJavaScriptElement || JsGlobalScopeContainer || IAdaptable) && size == 1
-public class ConfigureBuildPathAction extends BuildpathModifierAction {
-
- public ConfigureBuildPathAction(IWorkbenchSite site) {
- super(site, null, BuildpathModifierAction.CONFIGURE_BUILD_PATH);
-
- setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_ConfigureBP_label);
- setImageDescriptor(JavaPluginImages.DESC_ELCL_CONFIGURE_BUILDPATH);
- setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_ConfigureBP_tooltip);
- setDisabledImageDescriptor(JavaPluginImages.DESC_DLCL_CONFIGURE_BUILDPATH);
- }
-
- /**
- * {@inheritDoc}
- */
- public String getDetailedDescription() {
- return null;
- }
-
- public void run() {
- IProject project= null;
- Object firstElement= getSelectedElements().get(0);
- HashMap data= new HashMap();
-
- if (firstElement instanceof IJavaScriptElement) {
- IJavaScriptElement element= (IJavaScriptElement) firstElement;
- IPackageFragmentRoot root= (IPackageFragmentRoot) element.getAncestor(IJavaScriptElement.PACKAGE_FRAGMENT_ROOT);
- if (root != null) {
- try {
- data.put(BuildPathsPropertyPage.DATA_REVEAL_ENTRY, root.getRawIncludepathEntry());
- } catch (JavaScriptModelException e) {
- // ignore
- }
- }
- project= element.getJavaScriptProject().getProject();
- } else if (firstElement instanceof PackageFragmentRootContainer) {
- PackageFragmentRootContainer container= (PackageFragmentRootContainer) firstElement;
- project= container.getJavaProject().getProject();
- IIncludePathEntry entry= container instanceof JsGlobalScopeContainer ? ((JsGlobalScopeContainer) container).getClasspathEntry() : JavaScriptCore.newLibraryEntry(new Path("/x/y"), null, null); //$NON-NLS-1$
- data.put(BuildPathsPropertyPage.DATA_REVEAL_ENTRY, entry);
- } else {
- project= ((IResource) ((IAdaptable) firstElement).getAdapter(IResource.class)).getProject();
- }
- PreferencesUtil.createPropertyDialogOn(getShell(), project, BuildPathsPropertyPage.PROP_ID, null, data).open();
- }
-
- protected boolean canHandle(IStructuredSelection elements) {
- if (elements.size() != 1)
- return false;
-
- Object firstElement= elements.getFirstElement();
-
- if (firstElement instanceof IJavaScriptElement) {
- IJavaScriptElement element= (IJavaScriptElement) firstElement;
- IPackageFragmentRoot root= JavaModelUtil.getPackageFragmentRoot(element);
- if (root != null && root != element && root.isArchive()) {
- return false;
- }
- IJavaScriptProject project= element.getJavaScriptProject();
- if (project == null)
- return false;
-
- return project.getProject() != null;
- } else if (firstElement instanceof PackageFragmentRootContainer) {
- return true;
- } else if (firstElement instanceof IAdaptable) {
- IResource res= (IResource) ((IAdaptable) firstElement).getAdapter(IResource.class);
- if (res == null)
- return false;
-
- IProject project = res.getProject();
- if (project == null || !project.isOpen())
- return false;
-
- try {
- return project.hasNature(JavaScriptCore.NATURE_ID);
- } catch (CoreException e) {
- return false;
- }
- }
- return false;
- }
-
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/GenerateBuildPathActionGroup.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/GenerateBuildPathActionGroup.java
deleted file mode 100644
index 1b34a40..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/GenerateBuildPathActionGroup.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.newsourcepage;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.ui.part.Page;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.wst.jsdt.internal.ui.actions.ActionMessages;
-import org.eclipse.wst.jsdt.internal.ui.wizards.NewWizardMessages;
-import org.eclipse.wst.jsdt.ui.IContextMenuConstants;
-
-/**
- * Action group that adds the source and generate actions to a part's context
- * menu and installs handlers for the corresponding global menu actions.
- *
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- *
- * @since 3.1
- */
-public class GenerateBuildPathActionGroup extends ActionGroup {
- /**
- * Pop-up menu: id of the source sub menu (value <code>org.eclipse.wst.jsdt.ui.buildpath.menu</code>).
- *
- * @since 3.1
- */
- public static final String MENU_ID= "org.eclipse.wst.jsdt.ui.buildpath.menu"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: id of the build path (add /remove) group of the build path sub menu (value
- * <code>buildpathGroup</code>).
- *
- * @since 3.1
- */
- public static final String GROUP_BUILDPATH= "buildpathGroup"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: id of the filter (include / exclude) group of the build path sub menu (value
- * <code>filterGroup</code>).
- *
- * @since 3.1
- */
- public static final String GROUP_FILTER= "filterGroup"; //$NON-NLS-1$
-
- /**
- * Pop-up menu: id of the customize (filters / output folder) group of the build path sub menu (value
- * <code>customizeGroup</code>).
- *
- * @since 3.1
- */
- public static final String GROUP_CUSTOMIZE= "customizeGroup"; //$NON-NLS-1$
-
- private static class NoActionAvailable extends Action {
- public NoActionAvailable() {
- setEnabled(false);
- setText(NewWizardMessages.GenerateBuildPathActionGroup_no_action_available);
- }
- }
- private Action fNoActionAvailable= new NoActionAvailable();
-
-// private class UpdateJarFileAction extends JarImportWizardAction implements IUpdate {
-//
-// public UpdateJarFileAction() {
-// setText(ActionMessages.GenerateBuildPathActionGroup_update_jar_text);
-// setDescription(ActionMessages.GenerateBuildPathActionGroup_update_jar_description);
-// setToolTipText(ActionMessages.GenerateBuildPathActionGroup_update_jar_tooltip);
-// setImageDescriptor(JavaPluginImages.DESC_OBJS_JAR);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.JARIMPORT_WIZARD_PAGE);
-// }
-//
-// /**
-// * {@inheritDoc}
-// */
-// public void update() {
-// final IWorkbenchPart part= fSite.getPage().getActivePart();
-// if (part != null)
-// setActivePart(this, part);
-// selectionChanged(this, fSite.getSelectionProvider().getSelection());
-// }
-// }
-
- private IWorkbenchSite fSite;
- private List/*<Action>*/ fActions;
-
- private String fGroupName= IContextMenuConstants.GROUP_REORGANIZE;
-
- /**
- * Creates a new <code>GenerateActionGroup</code>. The group
- * requires that the selection provided by the page's selection provider
- * is of type <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
- *
- * @param page the page that owns this action group
- */
- public GenerateBuildPathActionGroup(Page page) {
- this(page.getSite());
- }
-
- /**
- * Creates a new <code>GenerateActionGroup</code>. The group
- * requires that the selection provided by the part's selection provider
- * is of type <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
- *
- * @param part the view part that owns this action group
- */
- public GenerateBuildPathActionGroup(IViewPart part) {
- this(part.getSite());
- }
-
- private GenerateBuildPathActionGroup(IWorkbenchSite site) {
- fSite= site;
- fActions= new ArrayList();
-
- final CreateLinkedSourceFolderAction addLinkedSourceFolderAction= new CreateLinkedSourceFolderAction(site);
- fActions.add(addLinkedSourceFolderAction);
-
- final CreateSourceFolderAction addSourceFolderAction= new CreateSourceFolderAction(site);
- fActions.add(addSourceFolderAction);
-
- final AddFolderToBuildpathAction addFolder= new AddFolderToBuildpathAction(site);
- fActions.add(addFolder);
-
- final AddSelectedLibraryToBuildpathAction addSelectedLibrary= new AddSelectedLibraryToBuildpathAction(site);
- fActions.add(addSelectedLibrary);
-
- final RemoveFromBuildpathAction remove= new RemoveFromBuildpathAction(site);
- fActions.add(remove);
-
- final AddArchiveToBuildpathAction addArchive= new AddArchiveToBuildpathAction(site);
- fActions.add(addArchive);
-
- final AddLibraryToBuildpathAction addLibrary= new AddLibraryToBuildpathAction(site);
- fActions.add(addLibrary);
-
-// final UpdateJarFileAction updateAction= new UpdateJarFileAction();
-// fActions.add(updateAction);
-
- final ExcludeFromBuildpathAction exclude= new ExcludeFromBuildpathAction(site);
- fActions.add(exclude);
-
- final IncludeToBuildpathAction include= new IncludeToBuildpathAction(site);
- fActions.add(include);
-
- final EditFilterAction editFilterAction= new EditFilterAction(site);
- fActions.add(editFilterAction);
-
-// final EditOutputFolderAction editOutput= new EditOutputFolderAction(site);
-// fActions.add(editOutput);
-
- final ConfigureBuildPathAction configure= new ConfigureBuildPathAction(site);
- fActions.add(configure);
-
- final ISelectionProvider provider= fSite.getSelectionProvider();
- for (Iterator iter= fActions.iterator(); iter.hasNext();) {
- Action action= (Action)iter.next();
- if (action instanceof ISelectionChangedListener) {
- provider.addSelectionChangedListener((ISelectionChangedListener)action);
- }
- }
-
- }
-
- /* (non-Javadoc)
- * Method declared in ActionGroup
- */
- public void fillActionBars(IActionBars actionBar) {
- super.fillActionBars(actionBar);
- setGlobalActionHandlers(actionBar);
- }
-
- /* (non-Javadoc)
- * Method declared in ActionGroup
- */
- public void fillContextMenu(IMenuManager menu) {
- super.fillContextMenu(menu);
- if (!canOperateOnSelection())
- return;
- String menuText= ActionMessages.BuildPath_label;
- IMenuManager subMenu= new MenuManager(menuText, MENU_ID);
- subMenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- fillViewSubMenu(manager);
- }
- });
- subMenu.setRemoveAllWhenShown(true);
- subMenu.add(new ConfigureBuildPathAction(fSite));
- menu.appendToGroup(fGroupName, subMenu);
- }
-
- private void fillViewSubMenu(IMenuManager source) {
- int added= 0;
- int i=0;
- for (Iterator iter= fActions.iterator(); iter.hasNext();) {
- Action action= (Action)iter.next();
- if (action instanceof IUpdate)
- ((IUpdate) action).update();
-
- if (i == 2)
- source.add(new Separator(GROUP_BUILDPATH));
- else if (i == 8)
- source.add(new Separator(GROUP_FILTER));
- else if (i == 10)
- source.add(new Separator(GROUP_CUSTOMIZE));
- added+= addAction(source, action);
- i++;
- }
-
- if (added == 0) {
- source.add(fNoActionAvailable);
- }
- }
-
- private void setGlobalActionHandlers(IActionBars actionBar) {
- // TODO implement
- }
-
- private int addAction(IMenuManager menu, IAction action) {
- if (action != null && action.isEnabled()) {
- menu.add(action);
- return 1;
- }
- return 0;
- }
-
- private boolean canOperateOnSelection() {
- ISelection sel= fSite.getSelectionProvider().getSelection();
- if (!(sel instanceof IStructuredSelection))
- return false;
- IStructuredSelection selection= (IStructuredSelection)sel;
- for (Iterator iter= selection.iterator(); iter.hasNext();) {
- Object element= iter.next();
- if (element instanceof IWorkingSet)
- return false;
- }
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public void dispose() {
- if (fActions != null) {
- final ISelectionProvider provider= fSite.getSelectionProvider();
- for (Iterator iter= fActions.iterator(); iter.hasNext();) {
- Action action= (Action)iter.next();
- if (action instanceof ISelectionChangedListener)
- provider.removeSelectionChangedListener((ISelectionChangedListener) action);
- }
- }
- fActions= null;
- super.dispose();
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ResetAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ResetAction.java
deleted file mode 100644
index 5081f4b..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ResetAction.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.newsourcepage;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.corext.buildpath.BuildpathDelta;
-import org.eclipse.wst.jsdt.internal.corext.buildpath.ClasspathModifier;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.wizards.NewWizardMessages;
-import org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.CPListElement;
-import org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.CPListElementAttribute;
-
-//Warning: This is unused and untested code. Images and descriptions are missing too.
-//SelectedElements iff enabled: IJavaScriptProject || IPackageFragmentRoot || CPListElementAttribute
-public class ResetAction extends BuildpathModifierAction {
-
- private final IRunnableContext fContext;
-
- public ResetAction(IWorkbenchSite site) {
- this(site, null, PlatformUI.getWorkbench().getProgressService());
- }
-
- public ResetAction(IRunnableContext context, ISetSelectionTarget selectionTarget) {
- this(null, selectionTarget, context);
- }
-
- public ResetAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
- super(site, selectionTarget, BuildpathModifierAction.RESET);
-
- fContext= context;
-
- setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Reset_tooltip);
- setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Reset_tooltip);
- }
-
- /**
- * {@inheritDoc}
- */
- public String getDetailedDescription() {
- if (!isEnabled())
- return null;
-
- Iterator iterator= getSelectedElements().iterator();
- Object p= iterator.next();
- while (iterator.hasNext()) {
- Object q= iterator.next();
- if (
- (p instanceof CPListElementAttribute && !(q instanceof CPListElementAttribute)) ||
- (q instanceof CPListElementAttribute && !(p instanceof CPListElementAttribute))
- ) {
- return NewWizardMessages.PackageExplorerActionGroup_FormText_Default_Reset;
- }
- p= q;
- }
- if (p instanceof CPListElementAttribute) {
- return NewWizardMessages.PackageExplorerActionGroup_FormText_SetOutputToDefault;
- } else {
- return NewWizardMessages.PackageExplorerActionGroup_FormText_ResetFilters;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void run() {
- final IRunnableWithProgress runnable= new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- Object firstElement= getSelectedElements().get(0);
- IJavaScriptProject project= null;
- if (firstElement instanceof IJavaScriptProject) {
- project= (IJavaScriptProject)firstElement;
- } else if (firstElement instanceof IPackageFragmentRoot) {
- project= ((IPackageFragmentRoot)firstElement).getJavaScriptProject();
- } else {
- project= ((CPListElementAttribute)firstElement).getParent().getJavaProject();
- }
-
- List result= reset(getSelectedElements(), project, monitor);
- selectAndReveal(new StructuredSelection(result));
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- };
- try {
- fContext.run(false, false, runnable);
- } catch (InvocationTargetException e) {
- if (e.getCause() instanceof CoreException) {
- showExceptionDialog((CoreException)e.getCause(), ""); //$NON-NLS-1$
- } else {
- JavaScriptPlugin.log(e);
- }
- } catch (InterruptedException e) {
- }
- }
-
- private List reset(List selection, IJavaScriptProject project, IProgressMonitor monitor) throws JavaScriptModelException {
- if (monitor == null)
- monitor= new NullProgressMonitor();
- try {
- monitor.beginTask(NewWizardMessages.ClasspathModifier_Monitor_Resetting, selection.size());
- List entries= ClasspathModifier.getExistingEntries(project);
- List result= new ArrayList();
- for (int i= 0; i < selection.size(); i++) {
- Object element= selection.get(i);
- if (element instanceof IJavaScriptElement) {
- IJavaScriptElement javaElement= (IJavaScriptElement) element;
- IPackageFragmentRoot root;
- if (element instanceof IJavaScriptProject)
- root= project.getPackageFragmentRoot(project.getResource());
- else
- root= (IPackageFragmentRoot) element;
- CPListElement entry= ClasspathModifier.getClasspathEntry(entries, root);
- ClasspathModifier.resetFilters(javaElement, entry, project, new SubProgressMonitor(monitor, 1));
- result.add(javaElement);
- } else {
- CPListElement selElement= ((CPListElementAttribute) element).getParent();
- CPListElement entry= ClasspathModifier.getClasspathEntry(entries, selElement);
- CPListElementAttribute outputFolder= ClasspathModifier.resetOutputFolder(entry, project);
- result.add(outputFolder);
- }
- }
-
- ClasspathModifier.commitClassPath(entries, project, null);
-
- BuildpathDelta delta= new BuildpathDelta(getToolTipText());
- delta.setNewEntries((CPListElement[])entries.toArray(new CPListElement[entries.size()]));
- informListeners(delta);
-
- return result;
- } finally {
- monitor.done();
- }
- }
-
- protected boolean canHandle(IStructuredSelection elements) {
- try {
- for (Iterator iterator= elements.iterator(); iterator.hasNext();) {
- Object element= iterator.next();
- if (element instanceof IJavaScriptProject) {
- IJavaScriptProject project= (IJavaScriptProject)element;
- if (!project.isOnIncludepath(project))
- return false;
-
- IIncludePathEntry entry= ClasspathModifier.getClasspathEntryFor(project.getPath(), project, IIncludePathEntry.CPE_SOURCE);
- if (entry.getInclusionPatterns().length == 0 && entry.getExclusionPatterns().length == 0)
- return false;
-
- return true;
- } else if (element instanceof IPackageFragmentRoot) {
- if (ClasspathModifier.filtersSet((IPackageFragmentRoot)element))
- return true;
- } else if (element instanceof CPListElementAttribute) {
- if (!ClasspathModifier.isDefaultOutputFolder((CPListElementAttribute)element))
- return true;
- } else {
- return false;
- }
- }
- } catch (JavaScriptModelException e) {
- return false;
- }
- return false;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ResetAllOutputFoldersAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ResetAllOutputFoldersAction.java
deleted file mode 100644
index bbc7d4b..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/buildpaths/newsourcepage/ResetAllOutputFoldersAction.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.newsourcepage;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.part.ISetSelectionTarget;
-import org.eclipse.wst.jsdt.core.IIncludePathEntry;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.corext.buildpath.BuildpathDelta;
-import org.eclipse.wst.jsdt.internal.corext.buildpath.ClasspathModifier;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.wizards.NewWizardMessages;
-import org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.CPListElement;
-import org.eclipse.wst.jsdt.internal.ui.wizards.buildpaths.CPListElementAttribute;
-
-public class ResetAllOutputFoldersAction extends BuildpathModifierAction {
-
- private final IRunnableContext fContext;
- private final IJavaScriptProject fJavaProject;
-
-
- public ResetAllOutputFoldersAction(IRunnableContext context, IJavaScriptProject project, ISetSelectionTarget selectionTarget) {
- this(null, selectionTarget, context, project);
- }
-
- public ResetAllOutputFoldersAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context, IJavaScriptProject javaProject) {
- super(site, selectionTarget, BuildpathModifierAction.RESET_ALL_OUTPUT_FOLDERS);
-
- fContext= context;
- fJavaProject= javaProject;
-
- setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Reset_tooltip);
- setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Reset_tooltip);
- }
-
- /**
- * {@inheritDoc}
- */
- public String getDetailedDescription() {
- return NewWizardMessages.PackageExplorerActionGroup_FormText_Default_ResetAllOutputFolders;
- }
-
- /**
- * {@inheritDoc}
- */
- public void run() {
- final IRunnableWithProgress runnable= new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- resetOutputFolders(fJavaProject, monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- };
- try {
- fContext.run(false, false, runnable);
- } catch (InvocationTargetException e) {
- if (e.getCause() instanceof CoreException) {
- showExceptionDialog((CoreException)e.getCause(), NewWizardMessages.RemoveFromBuildpathAction_ErrorTitle);
- } else {
- JavaScriptPlugin.log(e);
- }
- } catch (InterruptedException e) {
- }
- }
-
- private List resetOutputFolders(IJavaScriptProject project, IProgressMonitor monitor) throws JavaScriptModelException {
- if (monitor == null)
- monitor= new NullProgressMonitor();
- try {
- IPackageFragmentRoot[] roots= project.getPackageFragmentRoots();
- monitor.beginTask(NewWizardMessages.ClasspathModifier_Monitor_ResetOutputFolder, roots.length + 10);
- List entries= new ArrayList();
- for (int i= 0; i < roots.length; i++) {
- monitor.worked(1);
- if (roots[i].isArchive())
- continue;
- IIncludePathEntry entry= roots[i].getRawIncludepathEntry();
- CPListElement element= CPListElement.createFromExisting(entry, project);
- CPListElementAttribute outputFolder= new CPListElementAttribute(element, CPListElement.OUTPUT, element.getAttribute(CPListElement.OUTPUT), true);
- entries.add(outputFolder);
- }
- return reset(entries, project, new SubProgressMonitor(monitor, 10));
- } finally {
- monitor.done();
- }
- }
-
- private List reset(List selection, IJavaScriptProject project, IProgressMonitor monitor) throws JavaScriptModelException {
- if (monitor == null)
- monitor= new NullProgressMonitor();
- try {
- monitor.beginTask(NewWizardMessages.ClasspathModifier_Monitor_Resetting, selection.size());
- List entries= ClasspathModifier.getExistingEntries(project);
- List result= new ArrayList();
- for (int i= 0; i < selection.size(); i++) {
- Object element= selection.get(i);
- if (element instanceof IJavaScriptElement) {
- IJavaScriptElement javaElement= (IJavaScriptElement) element;
- IPackageFragmentRoot root;
- if (element instanceof IJavaScriptProject)
- root= project.getPackageFragmentRoot(project.getResource());
- else
- root= (IPackageFragmentRoot) element;
- CPListElement entry= ClasspathModifier.getClasspathEntry(entries, root);
- ClasspathModifier.resetFilters(javaElement, entry, project, new SubProgressMonitor(monitor, 1));
- result.add(javaElement);
- } else {
- CPListElement selElement= ((CPListElementAttribute) element).getParent();
- CPListElement entry= ClasspathModifier.getClasspathEntry(entries, selElement);
- CPListElementAttribute outputFolder= ClasspathModifier.resetOutputFolder(entry, project);
- result.add(outputFolder);
- }
- }
-
- ClasspathModifier.commitClassPath(entries, project, null);
-
- BuildpathDelta delta= new BuildpathDelta(getToolTipText());
- delta.setNewEntries((CPListElement[])entries.toArray(new CPListElement[entries.size()]));
- informListeners(delta);
-
- return result;
- } finally {
- monitor.done();
- }
- }
-
- protected boolean canHandle(IStructuredSelection elements) {
- return true;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/ListDialogField.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/ListDialogField.java
index 18d2e9d..1ce79dd 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/ListDialogField.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/wizards/dialogfields/ListDialogField.java
@@ -31,7 +31,6 @@
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
@@ -938,13 +937,6 @@
if (fListAdapter != null) {
fListAdapter.doubleClicked(this);
}
- }
-
- /**
- * @deprecated Use {@link #setViewerComparator(ViewerComparator)} instead}
- */
- public void setViewerSorter(ViewerSorter sorter) {
- setViewerComparator(sorter);
}
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IJavaScriptElementSearchConstants.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IJavaScriptElementSearchConstants.java
index 49063b9..7a6b6cf 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IJavaScriptElementSearchConstants.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/IJavaScriptElementSearchConstants.java
@@ -32,15 +32,6 @@
public static final int CONSIDER_INTERFACES= 1 << 2;
/**
- * Search scope constant indicating that both classes and interfaces
- * should be considered. Equivalent to
- * <code>CONSIDER_CLASSES | CONSIDER_INTERFACES</code>.
- *
- * @deprecated use CONSIDER_ALL_TYPES or CONSIDER_CLASSES_AND_INTERFACES instead
- */
- public static final int CONSIDER_TYPES= CONSIDER_CLASSES | CONSIDER_INTERFACES;
-
- /**
* Search scope constant (bit mask) indicating that binaries should be considered.
* Used when opening certain kinds of selection dialogs.
*/
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ITypeHierarchyViewPart.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ITypeHierarchyViewPart.java
index d677d40..9d05b1d 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ITypeHierarchyViewPart.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/ITypeHierarchyViewPart.java
@@ -100,16 +100,6 @@
* Returns the input element of this type hierarchy view.
*
* @return the input element, or <code>null</code> if no input element is set
- * @see #setInput(IType)
- * @deprecated use getInputElement instead
- */
- public IType getInput();
-
-
- /**
- * Returns the input element of this type hierarchy view.
- *
- * @return the input element, or <code>null</code> if no input element is set
* @see #setInputElement(IJavaScriptElement)
*
* @since 2.0
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaElementSorter.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaElementSorter.java
index 9a18f55..c8f7d94 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaElementSorter.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaElementSorter.java
@@ -38,18 +38,6 @@
fComparator= new JavaScriptElementComparator();
}
- /**
- * @deprecated Bug 22518. Method never used: does not override ViewerSorter#isSorterProperty(Object, String).
- * Method could be removed, but kept for API compatibility.
- *
- * @param element the element
- * @param property the property
- * @return always <code>true</code>
- */
- public boolean isSorterProperty(Object element, Object property) {
- return true;
- }
-
/*
* @see ViewerSorter#category
*/
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptElementContentProvider.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptElementContentProvider.java
deleted file mode 100644
index 2c612ff..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptElementContentProvider.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.ui;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.wst.jsdt.core.ElementChangedEvent;
-import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IElementChangedListener;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptElementDelta;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.JavaScriptCore;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-
-/**
- * A tree content provider for Java elements. It extends the
- * StandardJavaScriptElementContentProvider with support for listening to changes.
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- * * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * @deprecated use the StandardJavaScriptElementContentProvider instead
- * @see StandardJavaScriptElementContentProvider
- */
-public class JavaScriptElementContentProvider extends StandardJavaScriptElementContentProvider implements ITreeContentProvider, IElementChangedListener {
-
- /** The tree viewer */
- protected TreeViewer fViewer;
- /** The input object */
- protected Object fInput;
-
- /* (non-Javadoc)
- * Method declared on IContentProvider.
- */
- public void dispose() {
- super.dispose();
- JavaScriptCore.removeElementChangedListener(this);
- }
-
- /* (non-Javadoc)
- * Method declared on IContentProvider.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- super.inputChanged(viewer, oldInput, newInput);
- fViewer= (TreeViewer)viewer;
- if (oldInput == null && newInput != null) {
- JavaScriptCore.addElementChangedListener(this);
- } else if (oldInput != null && newInput == null) {
- JavaScriptCore.removeElementChangedListener(this);
- }
- fInput= newInput;
- }
- /**
- * Creates a new content provider for Java elements.
- */
- public JavaScriptElementContentProvider() {
- }
-
- /**
- * Creates a new content provider for Java elements.
- *
- * @param provideMembers if <code>true</code> members below compilation units
- * and class files are provided.
- * @param provideWorkingCopy if <code>true</code> the element provider provides
- * working copies for members of compilation units which have an associated working
- * copy. Otherwise only original elements are provided.
- *
- * @since 2.0
- */
- public JavaScriptElementContentProvider(boolean provideMembers, boolean provideWorkingCopy) {
- super(provideMembers, provideWorkingCopy);
- }
-
- /* (non-Javadoc)
- * Method declared on IElementChangedListener.
- */
- public void elementChanged(final ElementChangedEvent event) {
- try {
- processDelta(event.getDelta());
- } catch(JavaScriptModelException e) {
- JavaScriptPlugin.log(e);
- }
- }
-
- /**
- * Processes a delta recursively. When more than two children are affected the
- * tree is fully refreshed starting at this node. The delta is processed in the
- * current thread but the viewer updates are posted to the UI thread.
- *
- * @param delta the delta to be processed
- *
- * @throws JavaScriptModelException if an error occurs while processing the delta
- */
- protected void processDelta(IJavaScriptElementDelta delta) throws JavaScriptModelException {
- int kind= delta.getKind();
- int flags= delta.getFlags();
- IJavaScriptElement element= delta.getElement();
-
- if (element instanceof IJavaScriptUnit) {
- if (!getProvideWorkingCopy())
- return;
-
- IJavaScriptUnit cu= (IJavaScriptUnit) element;
- if (!JavaModelUtil.isPrimary(cu) || !isOnIncludePath((IJavaScriptUnit)element)) {
- return;
- }
- }
-
- // handle open and closing of a solution or project
- if (((flags & IJavaScriptElementDelta.F_CLOSED) != 0) || ((flags & IJavaScriptElementDelta.F_OPENED) != 0)) {
- postRefresh(element);
- return;
- }
-
- if (kind == IJavaScriptElementDelta.REMOVED) {
- Object parent= internalGetParent(element);
- postRemove(element);
- if (parent instanceof IPackageFragment)
- updatePackageIcon((IPackageFragment)parent);
- // we are filtering out empty subpackages, so we
- // a package becomes empty we remove it from the viewer.
- if (isPackageFragmentEmpty(element.getParent())) {
- if (fViewer.testFindItem(parent) != null)
- postRefresh(internalGetParent(parent));
- }
- return;
- }
-
- if (kind == IJavaScriptElementDelta.ADDED) {
- Object parent= internalGetParent(element);
- // we are filtering out empty subpackages, so we
- // have to handle additions to them specially.
- if (parent instanceof IPackageFragment) {
- Object grandparent= internalGetParent(parent);
- // 1GE8SI6: ITPJUI:WIN98 - Rename is not shown in Packages View
- // avoid posting a refresh to an invisible parent
- if (parent.equals(fInput)) {
- postRefresh(parent);
- } else {
- // refresh from grandparent if parent isn't visible yet
- if (fViewer.testFindItem(parent) == null)
- postRefresh(grandparent);
- else {
- postRefresh(parent);
- }
- }
- } else {
- postAdd(parent, element);
- }
- }
-
- if (element instanceof IJavaScriptUnit) {
- if (kind == IJavaScriptElementDelta.CHANGED) {
- postRefresh(element);
- return;
- }
- }
- // we don't show the contents of a compilation or IClassFile, so don't go any deeper
- if ((element instanceof IJavaScriptUnit) || (element instanceof IClassFile))
- return;
-
- // the contents of an external JAR has changed
- if (element instanceof IPackageFragmentRoot && ((flags & IJavaScriptElementDelta.F_ARCHIVE_CONTENT_CHANGED) != 0))
- postRefresh(element);
-
- if (isClassPathChange(delta)) {
- // throw the towel and do a full refresh of the affected java project.
- postRefresh(element.getJavaScriptProject());
- }
-
- if (delta.getResourceDeltas() != null) {
- IResourceDelta[] rd= delta.getResourceDeltas();
- for (int i= 0; i < rd.length; i++) {
- processResourceDelta(rd[i], element);
- }
- }
-
- IJavaScriptElementDelta[] affectedChildren= delta.getAffectedChildren();
- if (affectedChildren.length > 1) {
- // a package fragment might become non empty refresh from the parent
- if (element instanceof IPackageFragment) {
- IJavaScriptElement parent= (IJavaScriptElement)internalGetParent(element);
- // 1GE8SI6: ITPJUI:WIN98 - Rename is not shown in Packages View
- // avoid posting a refresh to an invisible parent
- if (element.equals(fInput)) {
- postRefresh(element);
- } else {
- postRefresh(parent);
- }
- return;
- }
- // more than one child changed, refresh from here downwards
- if (element instanceof IPackageFragmentRoot)
- postRefresh(skipProjectPackageFragmentRoot((IPackageFragmentRoot)element));
- else
- postRefresh(element);
- return;
- }
- for (int i= 0; i < affectedChildren.length; i++) {
- processDelta(affectedChildren[i]);
- }
- }
-
- private boolean isOnIncludePath(IJavaScriptUnit element) {
- IJavaScriptProject project= element.getJavaScriptProject();
- if (project == null || !project.exists())
- return false;
- return project.isOnIncludepath(element);
- }
-
-
- /*
- * Updates the package icon
- */
- private void updatePackageIcon(final IJavaScriptElement element) {
- postRunnable(new Runnable() {
- public void run() {
- // 1GF87WR: ITPUI:ALL - SWTEx + NPE closing a workbench window.
- Control ctrl= fViewer.getControl();
- if (ctrl != null && !ctrl.isDisposed())
- fViewer.update(element, new String[]{IBasicPropertyConstants.P_IMAGE});
- }
- });
- }
-
- /*
- * Process resource deltas
- */
- private void processResourceDelta(IResourceDelta delta, Object parent) {
- int status= delta.getKind();
- IResource resource= delta.getResource();
- // filter out changes affecting the output folder
- if (resource == null)
- return;
-
- // this could be optimized by handling all the added children in the parent
- if ((status & IResourceDelta.REMOVED) != 0) {
- if (parent instanceof IPackageFragment)
- // refresh one level above to deal with empty package filtering properly
- postRefresh(internalGetParent(parent));
- else
- postRemove(resource);
- }
- if ((status & IResourceDelta.ADDED) != 0) {
- if (parent instanceof IPackageFragment)
- // refresh one level above to deal with empty package filtering properly
- postRefresh(internalGetParent(parent));
- else
- postAdd(parent, resource);
- }
- IResourceDelta[] affectedChildren= delta.getAffectedChildren();
-
- if (affectedChildren.length > 1) {
- // more than one child changed, refresh from here downwards
- postRefresh(resource);
- return;
- }
-
- for (int i= 0; i < affectedChildren.length; i++)
- processResourceDelta(affectedChildren[i], resource);
- }
-
- private void postRefresh(final Object root) {
- postRunnable(new Runnable() {
- public void run() {
- // 1GF87WR: ITPUI:ALL - SWTEx + NPE closing a workbench window.
- Control ctrl= fViewer.getControl();
- if (ctrl != null && !ctrl.isDisposed())
- fViewer.refresh(root);
- }
- });
- }
-
- private void postAdd(final Object parent, final Object element) {
- postRunnable(new Runnable() {
- public void run() {
- // 1GF87WR: ITPUI:ALL - SWTEx + NPE closing a workbench window.
- Control ctrl= fViewer.getControl();
- if (ctrl != null && !ctrl.isDisposed())
- fViewer.add(parent, element);
- }
- });
- }
-
- private void postRemove(final Object element) {
- postRunnable(new Runnable() {
- public void run() {
- // 1GF87WR: ITPUI:ALL - SWTEx + NPE closing a workbench window.
- Control ctrl= fViewer.getControl();
- if (ctrl != null && !ctrl.isDisposed())
- fViewer.remove(element);
- }
- });
- }
-
- private void postRunnable(final Runnable r) {
- Control ctrl= fViewer.getControl();
- if (ctrl != null && !ctrl.isDisposed()) {
- ctrl.getDisplay().asyncExec(r);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptUI.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptUI.java
index e4324e3..ce18039 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptUI.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/JavaScriptUI.java
@@ -17,7 +17,6 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Shell;
@@ -42,8 +41,6 @@
import org.eclipse.wst.jsdt.internal.ui.JavaUIMessages;
import org.eclipse.wst.jsdt.internal.ui.SharedImages;
import org.eclipse.wst.jsdt.internal.ui.dialogs.FilteredTypesSelectionDialog;
-import org.eclipse.wst.jsdt.internal.ui.dialogs.MainTypeSelectionDialog;
-import org.eclipse.wst.jsdt.internal.ui.dialogs.MultiMainTypeSelectionDialog;
import org.eclipse.wst.jsdt.internal.ui.dialogs.PackageSelectionDialog;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.wst.jsdt.internal.ui.util.BusyIndicatorRunnableContext;
@@ -243,23 +240,6 @@
public static String ID_MEMBERS_VIEW= "org.eclipse.wst.jsdt.ui.MembersView"; //$NON-NLS-1$
/**
- * The class org.eclipse.debug.core.model.IProcess allows attaching
- * String properties to processes. The Java UI contributes a property
- * page for IProcess that will show the contents of the property
- * with this key.
- * The intent of this property is to show the command line a process
- * was launched with.
- * @deprecated
- */
- public final static String ATTR_CMDLINE= "org.eclipse.wst.jsdt.ui.launcher.cmdLine"; //$NON-NLS-1$
-
-
- /**
- * @deprecated Constant introduced to avoid deprecated warning
- */
- private final static int DEPRECATED_CONSIDER_TYPES= IJavaScriptElementSearchConstants.CONSIDER_TYPES;
-
- /**
* Returns the shared images for the Java UI.
*
* @return the shared images manager
@@ -562,8 +542,6 @@
elementKinds= IJavaScriptSearchConstants.CLASS_AND_INTERFACE;
} else if (style == IJavaScriptElementSearchConstants.CONSIDER_CLASSES_AND_ENUMS) {
elementKinds= IJavaScriptSearchConstants.CLASS_AND_ENUM;
- } else if (style == DEPRECATED_CONSIDER_TYPES) {
- elementKinds= IJavaScriptSearchConstants.CLASS_AND_INTERFACE;
} else {
throw new IllegalArgumentException("Invalid style constant."); //$NON-NLS-1$
}
@@ -574,62 +552,8 @@
return dialog;
}
- /**
- * Creates a selection dialog that lists all types in the given scope containing
- * a standard <code>main</code> method.
- * The caller is responsible for opening the dialog with <code>Window.open</code>,
- * and subsequently extracting the selected type(s) (of type
- * <code>IType</code>) via <code>SelectionDialog.getResult</code>.
- *
- * @param parent the parent shell of the dialog to be created
- * @param context the runnable context used to show progress when the dialog
- * is being populated
- * @param scope the scope that limits which types are included
- * @param style flags defining the style of the dialog; the only valid values are
- * <code>IJavaScriptElementSearchConstants.CONSIDER_BINARIES</code>,
- * <code>CONSIDER_EXTERNAL_JARS</code>, or their bitwise OR, or <code>0</code>
- * @param multipleSelection <code>true</code> if multiple selection is allowed
- * @param filter the initial pattern to filter the set of types containing a main method. For
- * example "App" shows all types starting with "app". The meta character '?' representing
- * any character and '*' representing any string are supported. Clients can pass an empty
- * string if no filtering is required.
- * @return a new selection dialog
- *
- * @since 2.0
- */
- public static SelectionDialog createMainTypeDialog(Shell parent, IRunnableContext context, IJavaScriptSearchScope scope, int style, boolean multipleSelection, String filter) {
- if (multipleSelection) {
- MultiMainTypeSelectionDialog dialog= new MultiMainTypeSelectionDialog(parent, context, scope, style);
- dialog.setFilter(filter);
- return dialog;
- } else {
- MainTypeSelectionDialog dialog= new MainTypeSelectionDialog(parent, context, scope, style);
- dialog.setFilter(filter);
- return dialog;
- }
- }
- /**
- * Creates a selection dialog that lists all types in the given scope containing
- * a standard <code>main</code> method.
- * The caller is responsible for opening the dialog with <code>Window.open</code>,
- * and subsequently extracting the selected type(s) (of type
- * <code>IType</code>) via <code>SelectionDialog.getResult</code>.
- *
- * @param parent the parent shell of the dialog to be created
- * @param context the runnable context used to show progress when the dialog
- * is being populated
- * @param scope the scope that limits which types are included
- * @param style flags defining the style of the dialog; the only valid values are
- * <code>IJavaScriptElementSearchConstants.CONSIDER_BINARIES</code>,
- * <code>CONSIDER_EXTERNAL_JARS</code>, or their bitwise OR, or <code>0</code>
- * @param multipleSelection <code>true</code> if multiple selection is allowed
- * @return a new selection dialog
- */
- public static SelectionDialog createMainTypeDialog(Shell parent, IRunnableContext context, IJavaScriptSearchScope scope, int style, boolean multipleSelection) {
- return createMainTypeDialog(parent, context, scope, style, multipleSelection, "");//$NON-NLS-1$
- }
-
+
/**
* Opens an editor on the given Java element in the active page. Valid elements are all Java elements that are {@link ISourceReference}.
* For elements inside a compilation unit or class file, the parent is opened in the editor is opened and the element revealed.
@@ -673,22 +597,6 @@
}
/**
- * Reveals the source range of the given source reference element in the
- * given editor. No checking is done if the editor displays a compilation unit or
- * class file that contains the given source reference. The editor simply reveals
- * the source range denoted by the given source reference.
- *
- * @param part the editor displaying the compilation unit or class file
- * @param element the source reference element defining the source range to be revealed
- *
- * @deprecated use <code>revealInEditor(IEditorPart, IJavaScriptElement)</code> instead
- */
- public static void revealInEditor(IEditorPart part, ISourceReference element) {
- if (element instanceof IJavaScriptElement)
- revealInEditor(part, (IJavaScriptElement) element);
- }
-
- /**
* Reveals the given java element in the given editor. If the element is not an instance
* of <code>ISourceReference</code> this method result in a NOP. If it is a source
* reference no checking is done if the editor displays a compilation unit or class file that
@@ -730,64 +638,6 @@
}
/**
- * Answers the shared working copies currently registered for the Java plug-in.
- * Note that the returned array can include working copies that are
- * not on the class path of a Java project.
- *
- * @return the list of shared working copies
- *
- * @see org.eclipse.wst.jsdt.core.JavaScriptCore#getSharedWorkingCopies(org.eclipse.wst.jsdt.core.IBufferFactory)
- * @since 2.0
- * @deprecated Use {@link JavaScriptCore#getWorkingCopies(org.eclipse.wst.jsdt.core.WorkingCopyOwner)} instead with <code>null</code> as
- * argument for owner.
- */
- public static org.eclipse.wst.jsdt.core.IWorkingCopy[] getSharedWorkingCopies() {
- return JavaScriptCore.getSharedWorkingCopies(getBufferFactory());
- }
-
- /**
- * Answers the shared working copies that are on the class path of a Java
- * project currently registered for the Java plug-in.
- *
- *
- * @return the list of shared working copies
- *
- * @see #getSharedWorkingCopies()
- * @since 2.1
- * @deprecated Use {@link JavaScriptCore#getWorkingCopies(org.eclipse.wst.jsdt.core.WorkingCopyOwner)} instead and filter the list
- * with {@link IJavaScriptProject#isOnIncludepath(IJavaScriptElement)}.
- */
- public static org.eclipse.wst.jsdt.core.IWorkingCopy[] getSharedWorkingCopiesOnClasspath() {
- org.eclipse.wst.jsdt.core.IWorkingCopy[] wcs= getSharedWorkingCopies();
- List result= new ArrayList(wcs.length);
- for (int i = 0; i < wcs.length; i++) {
- org.eclipse.wst.jsdt.core.IWorkingCopy wc= wcs[i];
- if (wc instanceof IJavaScriptElement) {
- IJavaScriptElement je= (IJavaScriptElement)wc;
- if (je.getJavaScriptProject().isOnIncludepath(je)) {
- result.add(wc);
- }
- }
- }
- return (org.eclipse.wst.jsdt.core.IWorkingCopy[])result.toArray(new org.eclipse.wst.jsdt.core.IWorkingCopy[result.size()]);
- }
-
- /**
- * Returns the buffer factory for the Java UI plug-in.
- *
- * @return the buffer factory for the Java UI plug-in
- *
- * @see org.eclipse.wst.jsdt.core.IBufferFactory
- * @since 2.0
- * @deprecated {@link org.eclipse.wst.jsdt.core.IBufferFactory} has been replaced by {@link org.eclipse.wst.jsdt.core.WorkingCopyOwner}.
- * The Java UI plug-in uses the <i>primary working copy owner</i> that can be accessed with <code>null</code> in
- * API's that require an owner
- */
- public static org.eclipse.wst.jsdt.core.IBufferFactory getBufferFactory() {
- return JavaScriptPlugin.getDefault().getBufferFactory();
- }
-
- /**
* Returns the DocumentProvider used for Java compilation units.
*
* @return the DocumentProvider for Java compilation units.
@@ -800,59 +650,6 @@
}
/**
- * Sets the Javadoc location for an archive with the given path.
- *
- * @param archivePath the path of the library; this can be an workspace path
- * or an external path in case of an external library.
- * @param url the Javadoc location to set. This location should contain index.html and
- * a file 'package-list'. <code>null</code> clears the current documentation
- * location.
- * @deprecated Javadoc is now attached to the classpath entry.
- * Evaluate the libraries classpath entry and reconfigure the Javadoc location there.
- *
- * @since 2.0
- */
- public static void setLibraryJSdocLocation(IPath archivePath, URL url) {
- // deprecated
- }
-
- /**
- * Sets the Javadoc locations for archives with the given paths.
- *
- * @param archivePaths the paths of the libraries. can be workspace paths
- * or external paths in case of an external library.
- * @param urls the Javadoc locations to set. Each location corresponds to the archive path of the same index. A location should contain index.html and
- * a file 'package-list'. <code>null</code> is a valid location entry and clears the current documentation
- * location. The length of the location array must be equals to the number of archive paths passed.
- *
- * @deprecated Javadoc is now attached to the classpath entry.
- * Evaluate the libraries classpath entry and reconfigure the Javadoc location there.
- *
- * @since 3.0
- */
- public static void setLibraryJavadocLocations(IPath[] archivePaths, URL[] urls) {
- // deprecated
- }
-
- /**
- * Returns the Javadoc location for an archive or <code>null</code> if no
- * location is available.
- *
- * @param archivePath the path of the library. This can be an workspace path
- * or an external path in case of an external library.
- * @return the Javadoc location for an archive or <code>null</code>.
- *
- * @deprecated Javadoc is now attached to the classpath entry. Use {@link #getJSdocBaseLocation(IJavaScriptElement)}
- * with the archive's {@link IPackageFragmentRoot} or use {@link #getLibraryJSdocLocation(IIncludePathEntry)}
- * with the archive's {@link IIncludePathEntry}.
- *
- * @since 2.0
- */
- public static URL getLibraryJSdocLocation(IPath archivePath) {
- return null;
- }
-
- /**
* Returns the Javadoc location for library's classpath entry or <code>null</code> if no
* location is available. Note that only classpath entries of kind {@link IIncludePathEntry#CPE_LIBRARY} and
* {@link IIncludePathEntry#CPE_VARIABLE} support Javadoc locations.
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/OverrideIndicatorLabelDecorator.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/OverrideIndicatorLabelDecorator.java
index 4d95bd4..057feee 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/OverrideIndicatorLabelDecorator.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/OverrideIndicatorLabelDecorator.java
@@ -19,24 +19,22 @@
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IType;
-import org.eclipse.wst.jsdt.core.ITypeHierarchy;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
+import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
+import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
import org.eclipse.wst.jsdt.core.dom.SimpleName;
import org.eclipse.wst.jsdt.internal.corext.dom.Bindings;
import org.eclipse.wst.jsdt.internal.corext.dom.NodeFinder;
-import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil;
import org.eclipse.wst.jsdt.internal.corext.util.JdtFlags;
import org.eclipse.wst.jsdt.internal.corext.util.MethodOverrideTester;
import org.eclipse.wst.jsdt.internal.corext.util.SuperTypeHierarchyCache;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.JavaPluginImages;
+import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider;
import org.eclipse.wst.jsdt.internal.ui.viewsupport.ImageDescriptorRegistry;
import org.eclipse.wst.jsdt.internal.ui.viewsupport.ImageImageDescriptor;
@@ -191,42 +189,6 @@
return -1;
}
- /**
- * Note: This method is for internal use only. Clients should not call this method.
- * @param type The declaring type of the method to decorate.
- * @param hierarchy The type hierarchy of the declaring type.
- * @param name The name of the method to find.
- * @param paramTypes The parameter types of the method to find.
- * @return The resulting decoration.
- * @throws JavaScriptModelException
- * @deprecated Not used anymore. This method is not accurate for methods in generic types.
- */
- protected int findInHierarchy(IType type, ITypeHierarchy hierarchy, String name, String[] paramTypes) throws JavaScriptModelException {
- IType superClass= hierarchy.getSuperclass(type);
- if (superClass != null) {
- IFunction res= JavaModelUtil.findMethodInHierarchy(hierarchy, superClass, name, paramTypes, false);
- if (res != null && !Flags.isPrivate(res.getFlags()) && JavaModelUtil.isVisibleInHierarchy(res, type.getPackageFragment())) {
- if (JdtFlags.isAbstract(res)) {
- return JavaScriptElementImageDescriptor.IMPLEMENTS;
- } else {
- return JavaScriptElementImageDescriptor.OVERRIDES;
- }
- }
- }
- IType[] interfaces= hierarchy.getSuperInterfaces(type);
- for (int i= 0; i < interfaces.length; i++) {
- IFunction res= JavaModelUtil.findMethodInHierarchy(hierarchy, interfaces[i], name, paramTypes, false);
- if (res != null) {
- if (JdtFlags.isAbstract(res)) {
- return JavaScriptElementImageDescriptor.IMPLEMENTS;
- } else {
- return JavaScriptElementImageDescriptor.OVERRIDES;
- }
- }
- }
- return 0;
- }
-
/* (non-Javadoc)
* @see IBaseLabelProvider#addListener(ILabelProviderListener)
*/
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/PreferenceConstants.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/PreferenceConstants.java
index 084f4e6..583b785 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/PreferenceConstants.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/PreferenceConstants.java
@@ -72,16 +72,6 @@
public static final String APPEARANCE_METHOD_TYPEPARAMETERS= "org.eclipse.wst.jsdt.ui.methodtypeparametesr";//$NON-NLS-1$
/**
- * A named preference that controls if override indicators are rendered in the UI.
- * <p>
- * Value is of type <code>Boolean</code>: if <code>true</code> override
- * indicators are rendered
- * </p>
- * @deprecated Override Indicator is now controlled on the platform's decorator preference page
- */
- public static final String APPEARANCE_OVERRIDE_INDICATOR= "org.eclipse.wst.jsdt.ui.overrideindicator";//$NON-NLS-1$
-
- /**
* A named preference that controls if quick assist light bulbs are shown.
* <p>
* Value is of type <code>Boolean</code>: if <code>true</code> light bulbs are shown
@@ -276,37 +266,6 @@
public static final String CODEGEN_ADD_COMMENTS= "org.eclipse.wst.jsdt.ui.javadoc"; //$NON-NLS-1$
/**
- * A named preference that controls if a comment stubs will be added
- * automatically to newly created types and methods.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- * @deprecated Use CODEGEN_ADD_COMMENTS instead (Name is more precise).
- */
- public static final String CODEGEN__JAVADOC_STUBS= CODEGEN_ADD_COMMENTS;
-
- /**
- * A named preference that controls if a non-javadoc comment gets added to methods generated via the
- * "Override Methods" operation.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- * @deprecated New code template story: user can
- * specify the overriding method comment.
- */
- public static final String CODEGEN__NON_JAVADOC_COMMENTS= "org.eclipse.wst.jsdt.ui.seecomments"; //$NON-NLS-1$
-
- /**
- * A named preference that controls if a file comment gets added to newly created files.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- * @deprecated New code template story: user can
- * specify the new file code template.
- */
- public static final String CODEGEN__FILE_COMMENTS= "org.eclipse.wst.jsdt.ui.filecomments"; //$NON-NLS-1$
-
- /**
* A named preference that controls whether to add a override annotation for newly created methods
* <p>
* Value is of type <code>Boolean</code>.
@@ -373,24 +332,6 @@
public static final String SHOW_CU_CHILDREN= "org.eclipse.wst.jsdt.ui.packages.cuchildren"; //$NON-NLS-1$
/**
- * A named preference that controls whether the package explorer's selection is linked to the active editor.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- * @deprecated Since 3.3. Not used anymore. Package view always restores with the last recently used setting.
- */
- public static final String LINK_PACKAGES_TO_EDITOR= "org.eclipse.wst.jsdt.ui.packages.linktoeditor"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether the hierarchy view's selection is linked to the active editor.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- * @deprecated Since 3.3. Not used anymore. Type hierarchy view always restores with the last recently used setting.
- */
- public static final String LINK_TYPEHIERARCHY_TO_EDITOR= "org.eclipse.wst.jsdt.ui.packages.linktypehierarchytoeditor"; //$NON-NLS-1$
-
- /**
* A named preference that controls whether the projects view's selection is
* linked to the active editor.
* <p>
@@ -643,15 +584,6 @@
public static final String ID_JAVADOC_HOVER= "org.eclipse.wst.jsdt.ui.JavadocHover"; //$NON-NLS-1$
/**
- * The id of the problem hover contributed for extension point
- * <code>javaEditorTextHovers</code>.
- *
- * @since 2.1
- * @deprecated as of 3.0, this hover is no longer available
- */
- public static final String ID_PROBLEM_HOVER= "org.eclipse.wst.jsdt.ui.ProblemHover"; //$NON-NLS-1$
-
- /**
* A named preference that controls whether bracket matching highlighting is turned on or off.
* <p>
* Value is of type <code>Boolean</code>.
@@ -2469,19 +2401,6 @@
public static final String EDITOR_SMART_TAB= "smart_tab"; //$NON-NLS-1$
/**
- * A named preference that controls whether Java comments should be
- * spell checked.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- *
- * @deprecated since 3.1, use {@link org.eclipse.ui.texteditor.spelling.SpellingService#PREFERENCE_SPELLING_ENABLED}
- * and {@link org.eclipse.ui.texteditor.spelling.SpellingService#PREFERENCE_SPELLING_ENGINE}
- * @since 3.0
- */
- public final static String SPELLING_CHECK_SPELLING= "spelling_check_spelling"; //$NON-NLS-1$
-
- /**
* A named preference that controls whether words containing digits should
* be skipped during spell checking.
* <p>
@@ -2624,123 +2543,6 @@
public final static String SPELLING_ENABLE_CONTENTASSIST= "spelling_enable_contentassist"; //$NON-NLS-1$
/**
- * A named preference that controls whether code snippets are formatted
- * in Javadoc comments.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- *
- * @since 3.0
- * @deprecated As of 3.1, replaced by {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_FORMAT_SOURCE}
- */
- public final static String FORMATTER_COMMENT_FORMATSOURCE= "comment_format_source_code"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether description of Javadoc
- * parameters are indented.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- *
- * @since 3.0
- * @deprecated As of 3.1, replaced by {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_INDENT_PARAMETER_DESCRIPTION}
- */
- public final static String FORMATTER_COMMENT_INDENTPARAMETERDESCRIPTION= "comment_indent_parameter_description"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether the header comment of
- * a Java source file is formatted.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- *
- * @since 3.0
- * @deprecated As of 3.1, replaced by {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_FORMAT_HEADER}
- */
- public final static String FORMATTER_COMMENT_FORMATHEADER= "comment_format_header"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether Javadoc root tags
- * are indented.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- *
- * @since 3.0
- * @deprecated As of 3.1, replaced by {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_INDENT_ROOT_TAGS}
- */
- public final static String FORMATTER_COMMENT_INDENTROOTTAGS= "comment_indent_root_tags"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether Javadoc comments
- * are formatted by the content formatter.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- *
- * @since 3.0
- * @deprecated As of 3.1, replaced by {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_FORMAT}
- */
- public final static String FORMATTER_COMMENT_FORMAT= "comment_format_comments"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether a new line is inserted
- * after Javadoc root tag parameters.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- *
- * @since 3.0
- * @deprecated As of 3.1, replaced by {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER}
- */
- public final static String FORMATTER_COMMENT_NEWLINEFORPARAMETER= "comment_new_line_for_parameter"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether an empty line is inserted before
- * the Javadoc root tag block.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- *
- * @since 3.0
- * @deprecated As of 3.1, replaced by {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS}
- */
- public final static String FORMATTER_COMMENT_SEPARATEROOTTAGS= "comment_separate_root_tags"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether blank lines are cleared during formatting.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- *
- * @since 3.0
- * @deprecated As of 3.1, replaced by {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_CLEAR_BLANK_LINES}
- */
- public final static String FORMATTER_COMMENT_CLEARBLANKLINES= "comment_clear_blank_lines"; //$NON-NLS-1$
-
- /**
- * A named preference that controls the line length of comments.
- * <p>
- * Value is of type <code>Integer</code>. The value must be at least 4 for reasonable formatting.
- * </p>
- *
- * @since 3.0
- * @deprecated As of 3.1, replaced by {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_LINE_LENGTH}
- */
- public final static String FORMATTER_COMMENT_LINELENGTH= "comment_line_length"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether HTML tags are formatted.
- * <p>
- * Value is of type <code>Boolean</code>.
- * </p>
- *
- * @since 3.0
- * @deprecated As of 3.1, replaced by {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMMENT_FORMAT_HTML}
- */
- public final static String FORMATTER_COMMENT_FORMATHTML= "comment_format_html"; //$NON-NLS-1$
-
- /**
* A named preference that controls if the Java code assist gets auto activated.
* <p>
* Value is of type <code>Boolean</code>.
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/StandardJavaScriptElementContentProvider.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/StandardJavaScriptElementContentProvider.java
index df6f019..a323b2e 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/StandardJavaScriptElementContentProvider.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/StandardJavaScriptElementContentProvider.java
@@ -78,16 +78,6 @@
}
/**
- *@deprecated Use {@link #StandardJavaScriptElementContentProvider(boolean)} instead.
- * Since 3.0 compilation unit children are always provided as working copies. The Java Model
- * does not support the 'original' mode anymore.
- */
- public StandardJavaScriptElementContentProvider(boolean provideMembers, boolean provideWorkingCopy) {
- this(provideMembers);
- }
-
-
- /**
* Creates a new <code>StandardJavaScriptElementContentProvider</code>.
*
* @param provideMembers if <code>true</code> members below compilation units
@@ -130,14 +120,6 @@
return fProvideWorkingCopy;
}
- /**
- * @deprecated Since 3.0 compilation unit children are always provided from the working copy. The Java model
- * offers a unified world and does not support the 'original' mode anymore.
- */
- public void setProvideWorkingCopy(boolean b) {
- fProvideWorkingCopy= b;
- }
-
/* (non-Javadoc)
* @see IWorkingCopyProvider#providesWorkingCopies()
*/
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindStringsToExternalizeAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindStringsToExternalizeAction.java
deleted file mode 100644
index 8d02628..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/FindStringsToExternalizeAction.java
+++ /dev/null
@@ -1,457 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.ui.actions;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.compiler.InvalidInputException;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.NLSElement;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.NLSLine;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.NLSRefactoring;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.NLSScanner;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.reorg.ReorgUtils;
-import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil;
-import org.eclipse.wst.jsdt.internal.corext.util.Messages;
-import org.eclipse.wst.jsdt.internal.ui.IJavaHelpContextIds;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.actions.ActionMessages;
-import org.eclipse.wst.jsdt.internal.ui.refactoring.RefactoringSaveHelper;
-import org.eclipse.wst.jsdt.internal.ui.refactoring.actions.ListDialog;
-import org.eclipse.wst.jsdt.internal.ui.refactoring.actions.RefactoringStarter;
-import org.eclipse.wst.jsdt.internal.ui.refactoring.nls.ExternalizeWizard;
-import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
-import org.eclipse.wst.jsdt.ui.JavaScriptElementLabelProvider;
-
-/**
- * Find all strings in a package or project that are not externalized yet.
- * <p>
- * The action is applicable to selections containing projects or packages.
- *
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- *
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- * @deprecated use {@link ExternalizeStringsAction} instead
- */
-public class FindStringsToExternalizeAction extends SelectionDispatchAction {
-
- private NonNLSElement[] fElements;
-
- /**
- * Creates a new <code>FindStringsToExternalizeAction</code>. The action
- * requires that the selection provided by the site's selection provider is of type
- * <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
- *
- * @param site the site providing context information for this action
- */
- public FindStringsToExternalizeAction(IWorkbenchSite site) {
- super(site);
- setText(ActionMessages.FindStringsToExternalizeAction_label);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.FIND_STRINGS_TO_EXTERNALIZE_ACTION);
- }
-
- /* (non-Javadoc)
- * Method declared on SelectionDispatchAction.
- */
- public void selectionChanged(IStructuredSelection selection) {
- try {
- setEnabled(computeEnablementState(selection));
- } catch (JavaScriptModelException e) {
- if (JavaModelUtil.isExceptionToBeLogged(e))
- JavaScriptPlugin.log(e);
- setEnabled(false);//no UI - happens on selection changes
- }
- }
-
- private boolean computeEnablementState(IStructuredSelection selection) throws JavaScriptModelException {
- if (selection.isEmpty())
- return false;
- for (Iterator iter= selection.iterator(); iter.hasNext();) {
- Object element= iter.next();
- if (!(element instanceof IJavaScriptElement))
- return false;
- IJavaScriptElement javaElement= (IJavaScriptElement)element;
- if (! javaElement.exists() || javaElement.isReadOnly())
- return false;
- int elementType= javaElement.getElementType();
- if (elementType != IJavaScriptElement.PACKAGE_FRAGMENT &&
- elementType != IJavaScriptElement.PACKAGE_FRAGMENT_ROOT &&
- elementType != IJavaScriptElement.JAVASCRIPT_PROJECT)
- return false;
- if (elementType == IJavaScriptElement.PACKAGE_FRAGMENT_ROOT){
- IPackageFragmentRoot root= (IPackageFragmentRoot)javaElement;
- if (root.isExternal() || ReorgUtils.isClassFolder(root))
- return false;
- }
- }
- return true;
- }
-
- /* (non-Javadoc)
- * Method declared on SelectionDispatchAction.
- */
- public void run(final IStructuredSelection selection) {
- try {
- PlatformUI.getWorkbench().getProgressService().run(true, true, createRunnable(selection));
- } catch(InvocationTargetException e) {
- ExceptionHandler.handle(e, getShell(),
- ActionMessages.FindStringsToExternalizeAction_dialog_title,
- ActionMessages.FindStringsToExternalizeAction_error_message);
- return;
- } catch(InterruptedException e) {
- // OK
- return;
- }
- showResults();
- }
-
- private IRunnableWithProgress createRunnable(final IStructuredSelection selection) {
- return new IRunnableWithProgress() {
- public void run(IProgressMonitor pm) throws InvocationTargetException {
- try {
- fElements= doRun(selection, pm);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- };
- }
-
- private NonNLSElement[] doRun(IStructuredSelection selection, IProgressMonitor pm) throws CoreException {
- List elements= getSelectedElementList(selection);
- if (elements == null || elements.isEmpty())
- return new NonNLSElement[0];
-
- pm.beginTask(ActionMessages.FindStringsToExternalizeAction_find_strings, elements.size());
-
- try{
- List l= new ArrayList();
- for (Iterator iter= elements.iterator(); iter.hasNext();) {
- IJavaScriptElement element= (IJavaScriptElement) iter.next();
- if (element.getElementType() == IJavaScriptElement.PACKAGE_FRAGMENT)
- l.addAll(analyze((IPackageFragment) element, new SubProgressMonitor(pm, 1)));
- else if (element.getElementType() == IJavaScriptElement.PACKAGE_FRAGMENT_ROOT)
- l.addAll(analyze((IPackageFragmentRoot) element, new SubProgressMonitor(pm, 1)));
- if (element.getElementType() == IJavaScriptElement.JAVASCRIPT_PROJECT)
- l.addAll(analyze((IJavaScriptProject) element, new SubProgressMonitor(pm, 1)));
- }
- return (NonNLSElement[]) l.toArray(new NonNLSElement[l.size()]);
- } finally{
- pm.done();
- }
- }
-
- private void showResults() {
- if (noStrings())
- MessageDialog.openInformation(getShell(), getDialogTitle(), ActionMessages.FindStringsToExternalizeAction_noStrings);
- else
- new NonNLSListDialog(getShell(), fElements, countStrings()).open();
- }
-
- private boolean noStrings() {
- if (fElements != null) {
- for (int i= 0; i < fElements.length; i++) {
- if (fElements[i].count != 0)
- return false;
- }
- }
- return true;
- }
-
- /*
- * returns List of Strings
- */
- private List analyze(IPackageFragment pack, IProgressMonitor pm) throws CoreException {
- try{
- if (pack == null)
- return new ArrayList(0);
-
- IJavaScriptUnit[] cus= pack.getJavaScriptUnits();
-
- pm.beginTask("", cus.length); //$NON-NLS-1$
- pm.setTaskName(pack.getElementName());
-
- List l= new ArrayList(cus.length);
- for (int i= 0; i < cus.length; i++){
- pm.subTask(cus[i].getElementName());
- NonNLSElement element= analyze(cus[i]);
- if (element != null)
- l.add(element);
- pm.worked(1);
- if (pm.isCanceled())
- throw new OperationCanceledException();
- }
- return l;
- } finally {
- pm.done();
- }
- }
-
- /*
- * returns List of Strings
- */
- private List analyze(IPackageFragmentRoot sourceFolder, IProgressMonitor pm) throws CoreException {
- try{
- IJavaScriptElement[] children= sourceFolder.getChildren();
- pm.beginTask("", children.length); //$NON-NLS-1$
- pm.setTaskName(sourceFolder.getElementName());
- List result= new ArrayList();
- for (int i= 0; i < children.length; i++) {
- IJavaScriptElement iJavaElement= children[i];
- if (iJavaElement.getElementType() == IJavaScriptElement.PACKAGE_FRAGMENT){
- IPackageFragment pack= (IPackageFragment)iJavaElement;
- if (! pack.isReadOnly())
- result.addAll(analyze(pack, new SubProgressMonitor(pm, 1)));
- else
- pm.worked(1);
- } else
- pm.worked(1);
- }
- return result;
- } finally{
- pm.done();
- }
- }
-
- /*
- * returns List of Strings
- */
- private List analyze(IJavaScriptProject project, IProgressMonitor pm) throws CoreException {
- try{
- IPackageFragment[] packs= project.getPackageFragments();
- pm.beginTask("", packs.length); //$NON-NLS-1$
- List result= new ArrayList();
- for (int i= 0; i < packs.length; i++) {
- if (! packs[i].isReadOnly())
- result.addAll(analyze(packs[i], new SubProgressMonitor(pm, 1)));
- else
- pm.worked(1);
- }
- return result;
- } finally{
- pm.done();
- }
- }
-
- private int countStrings() {
- int found= 0;
- if (fElements != null) {
- for (int i= 0; i < fElements.length; i++)
- found+= fElements[i].count;
- }
- return found;
- }
-
- private NonNLSElement analyze(IJavaScriptUnit cu) throws CoreException {
- int count= countNonExternalizedStrings(cu);
- if (count == 0)
- return null;
- else
- return new NonNLSElement(cu, count);
- }
-
- private int countNonExternalizedStrings(IJavaScriptUnit cu) throws CoreException {
- try{
- NLSLine[] lines= NLSScanner.scan(cu);
- int result= 0;
- for (int i= 0; i < lines.length; i++) {
- result += countNonExternalizedStrings(lines[i]);
- }
- return result;
- } catch (InvalidInputException e) {
- throw new CoreException(new Status(IStatus.ERROR, JavaScriptPlugin.getPluginId(), IStatus.ERROR,
- Messages.format(ActionMessages.FindStringsToExternalizeAction_error_cannotBeParsed, cu.getElementName()),
- e));
- }
- }
-
- private int countNonExternalizedStrings(NLSLine line){
- int result= 0;
- NLSElement[] elements= line.getElements();
- for (int i= 0; i < elements.length; i++){
- if (! elements[i].hasTag())
- result++;
- }
- return result;
- }
-
- /**
- * returns <code>List</code> of <code>IPackageFragments</code>, <code>IPackageFragmentRoots</code> or
- * <code>IJavaProjects</code> (all entries are of the same kind)
- */
- private static List getSelectedElementList(IStructuredSelection selection) {
- if (selection == null)
- return null;
-
- return selection.toList();
- }
-
- //-------private classes --------------
-
- private static class NonNLSListDialog extends ListDialog {
-
- private static final int OPEN_BUTTON_ID= IDialogConstants.CLIENT_ID + 1;
-
- private Button fOpenButton;
-
- NonNLSListDialog(Shell parent, NonNLSElement[] input, int count) {
- super(parent);
- setInput(Arrays.asList(input));
- setTitle(ActionMessages.FindStringsToExternalizeAction_dialog_title);
- setMessage(Messages.format(ActionMessages.FindStringsToExternalizeAction_non_externalized, new Object[] {new Integer(count)} ));
- setContentProvider(new ArrayContentProvider());
- setLabelProvider(createLabelProvider());
- }
-
- public void create() {
- setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN);
- super.create();
- }
-
- protected Point getInitialSize() {
- return getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite result= (Composite)super.createDialogArea(parent);
- getTableViewer().addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event){
- if (fOpenButton != null){
- fOpenButton.setEnabled(! getTableViewer().getSelection().isEmpty());
- }
- }
- });
- getTableViewer().getTable().addSelectionListener(new SelectionAdapter(){
- public void widgetDefaultSelected(SelectionEvent e) {
- NonNLSElement element= (NonNLSElement)e.item.getData();
- openWizard(element.cu);
- }
- });
- getTableViewer().getTable().setFocus();
- applyDialogFont(result);
- return result;
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- fOpenButton= createButton(parent, OPEN_BUTTON_ID, ActionMessages.FindStringsToExternalizeAction_button_label, true);
- fOpenButton.setEnabled(false);
-
- //looks like a 'close' but it a 'cancel'
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CLOSE_LABEL, false);
- }
-
- protected void buttonPressed(int buttonId) {
- if (buttonId != OPEN_BUTTON_ID){
- super.buttonPressed(buttonId);
- return;
- }
- ISelection s= getTableViewer().getSelection();
- if (s instanceof IStructuredSelection){
- IStructuredSelection ss= (IStructuredSelection)s;
- if (ss.getFirstElement() instanceof NonNLSElement)
- openWizard(((NonNLSElement)ss.getFirstElement()).cu);
- }
- }
-
- private void openWizard(IJavaScriptUnit unit) {
- try {
- if (unit != null && unit.exists()) {
- NLSRefactoring refactoring= NLSRefactoring.create(unit);
- if (refactoring != null)
- new RefactoringStarter().activate(refactoring, new ExternalizeWizard(refactoring), getShell(), ActionMessages.ExternalizeStringsAction_dialog_title, RefactoringSaveHelper.SAVE_NON_JAVA_UPDATES);
- }
- } catch (JavaScriptModelException e) {
- ExceptionHandler.handle(e,
- ActionMessages.FindStringsToExternalizeAction_dialog_title,
- ActionMessages.FindStringsToExternalizeAction_error_message);
- }
- }
-
- private static LabelProvider createLabelProvider() {
- return new JavaScriptElementLabelProvider(JavaScriptElementLabelProvider.SHOW_DEFAULT){
- public String getText(Object element) {
- NonNLSElement nlsel= (NonNLSElement)element;
- String elementName= nlsel.cu.getResource().getFullPath().toString();
- return Messages.format(
- ActionMessages.FindStringsToExternalizeAction_foundStrings,
- new Object[] {new Integer(nlsel.count), elementName} );
- }
- public Image getImage(Object element) {
- return super.getImage(((NonNLSElement)element).cu);
- }
- };
- }
-
- /*
- * @see org.eclipse.jface.window.Window#configureShell(Shell)
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.NONNLS_DIALOG);
- }
-
-
- }
-
- private static class NonNLSElement{
- IJavaScriptUnit cu;
- int count;
- NonNLSElement(IJavaScriptUnit cu, int count){
- this.cu= cu;
- this.count= count;
- }
- }
-
- private String getDialogTitle() {
- return ActionMessages.FindStringsToExternalizeAction_dialog_title;
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/IJavaEditorActionDefinitionIds.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/IJavaEditorActionDefinitionIds.java
index 08fbd1b..72a0b87 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/IJavaEditorActionDefinitionIds.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/IJavaEditorActionDefinitionIds.java
@@ -85,13 +85,6 @@
*/
public static final String SELECT_LAST= "org.eclipse.wst.jsdt.ui.edit.text.java.select.last"; //$NON-NLS-1$
- /**
- * Action definition ID of the edit -> correction assist proposal action
- * (value <code>"org.eclipse.wst.jsdt.ui.edit.text.java.correction.assist.proposals"</code>).
- *
- * @deprecated As of 3.2, replaced by {@link ITextEditorActionDefinitionIds#QUICK_ASSIST}
- */
- public static final String CORRECTION_ASSIST_PROPOSALS= QUICK_ASSIST;
/**
@@ -102,13 +95,6 @@
public static final String CONTENT_ASSIST_COMPLETE_PREFIX= "org.eclipse.wst.jsdt.ui.edit.text.java.complete.prefix"; //$NON-NLS-1$
/**
- * Action definition ID of the edit -> show Javadoc action
- * (value <code>"org.eclipse.wst.jsdt.ui.edit.text.java.show.javadoc"</code>).
- * @deprecated As of 3.3, replaced by {@link ITextEditorActionDefinitionIds#SHOW_INFORMATION}
- */
- public static final String SHOW_JAVADOC= "org.eclipse.wst.jsdt.ui.edit.text.java.show.javadoc"; //$NON-NLS-1$
-
- /**
* Action definition ID of the navigate -> Show Outline action
* (value <code>"org.eclipse.wst.jsdt.ui.edit.text.java.show.outline"</code>).
*
@@ -266,29 +252,6 @@
public static final String EXTERNALIZE_STRINGS= "org.eclipse.wst.jsdt.ui.edit.text.java.externalize.strings"; //$NON-NLS-1$
/**
- * Action definition ID of the source -> find strings to externalize action
- * (value <code>"org.eclipse.wst.jsdt.ui.edit.text.java.find.strings.to.externalize"</code>).
- *
- * @since 3.0
- * @deprecated Use {@link IJavaEditorActionDefinitionIds#EXTERNALIZE_STRINGS} instead
- */
- public static final String FIND_STRINGS_TO_EXTERNALIZE= "org.eclipse.wst.jsdt.ui.edit.text.java.find.strings.to.externalize"; //$NON-NLS-1$
-
- /**
- * Note: this id is for internal use only.
- * @deprecated as of 3.0 replaced by {@link org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds#GOTO_NEXT_ANNOTATION}
- */
- public static final String SHOW_NEXT_PROBLEM= "org.eclipse.wst.jsdt.ui.edit.text.java.show.next.problem"; //$NON-NLS-1$
-
- /**
- * Note: this id is for internal use only.
- * @deprecated as of 3.0 replaced by {@link org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds#GOTO_PREVIOUS_ANNOTATION}
- */
- public static final String SHOW_PREVIOUS_PROBLEM= "org.eclipse.wst.jsdt.ui.edit.text.java.show.previous.problem"; //$NON-NLS-1$
-
- // refactor
-
- /**
* Action definition ID of the refactor -> pull up action
* (value <code>"org.eclipse.wst.jsdt.ui.edit.text.java.pull.up"</code>).
*/
@@ -351,13 +314,6 @@
public static final String INTRODUCE_FACTORY= "org.eclipse.wst.jsdt.ui.edit.text.java.introduce.factory"; //$NON-NLS-1$
/**
- * Action definition ID of the refactor -> inline local variable action
- * (value <code>"org.eclipse.wst.jsdt.ui.edit.text.java.inline.local.variable"</code>).
- * @deprecated Use INLINE
- */
- public static final String INLINE_LOCAL_VARIABLE= "org.eclipse.wst.jsdt.ui.edit.text.java.inline.local.variable"; //$NON-NLS-1$
-
- /**
* Action definition ID of the refactor -> self encapsulate field action
* (value <code>"org.eclipse.wst.jsdt.ui.edit.text.java.self.encapsulate.field"</code>).
*/
@@ -637,13 +593,6 @@
// miscellaneous
/**
- * Action definition ID of the toggle presentation tool bar button action
- * (value <code>"org.eclipse.wst.jsdt.ui.edit.text.java.toggle.presentation"</code>).
- * @deprecated as of 3.0 replaced by {@link org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds#TOGGLE_SHOW_SELECTED_ELEMENT_ONLY}
- */
- public static final String TOGGLE_PRESENTATION= "org.eclipse.wst.jsdt.ui.edit.text.java.toggle.presentation"; //$NON-NLS-1$
-
- /**
* Action definition ID of the toggle text hover tool bar button action
* (value <code>"org.eclipse.wst.jsdt.ui.edit.text.java.toggle.text.hover"</code>).
*/
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/JdtActionConstants.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/JdtActionConstants.java
index 539125c..3a698b5 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/JdtActionConstants.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/JdtActionConstants.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.wst.jsdt.ui.actions;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
/**
* Action ids for standard actions, for groups in the menu bar, and
@@ -88,13 +87,6 @@
// Edit menu
/**
- * Edit menu: name of standard Show Javadoc global action
- * (value <code>"org.eclipse.wst.jsdt.ui.actions.ShowJavaDoc"</code>).
- * @deprecated As of 3.3, replaced by {@link ITextEditorActionConstants#SHOW_INFORMATION}
- */
- public static final String SHOW_JAVA_DOC= "org.eclipse.wst.jsdt.ui.actions.ShowJavaDoc"; //$NON-NLS-1$
-
- /**
* Edit menu: name of standard Code Assist global action
* (value <code>"org.eclipse.wst.jsdt.ui.actions.ContentAssist"</code>).
*/
@@ -240,14 +232,6 @@
public static final String ADD_JAVA_DOC_COMMENT= "org.eclipse.wst.jsdt.ui.actions.AddJavaDocComment"; //$NON-NLS-1$
/**
- * Source menu: name of standard Find Strings to Externalize global action
- * (value <code>"org.eclipse.wst.jsdt.ui.actions.FindStringsToExternalize"</code>).
- *
- * @deprecated Use {@link JdtActionConstants#EXTERNALIZE_STRINGS} instead
- */
- public static final String FIND_STRINGS_TO_EXTERNALIZE= "org.eclipse.wst.jsdt.ui.actions.FindStringsToExternalize"; //$NON-NLS-1$
-
- /**
* Source menu: name of standard Externalize Strings global action
* (value <code>"org.eclipse.wst.jsdt.ui.actions.ExternalizeStrings"</code>).
*/
@@ -320,13 +304,6 @@
public static final String RENAME= "org.eclipse.wst.jsdt.ui.actions.Rename"; //$NON-NLS-1$
/**
- * Refactor menu: name of standard Inline Temp global action
- * (value <code>"org.eclipse.wst.jsdt.ui.actions.InlineTemp"</code>).
- * @deprecated Use INLINE
- */
- public static final String INLINE_TEMP= "org.eclipse.wst.jsdt.ui.actions.InlineTemp"; //$NON-NLS-1$
-
- /**
* Refactor menu: name of standard Extract Temp global action
* (value <code>"org.eclipse.wst.jsdt.ui.actions.ExtractTemp"</code>).
*/
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenExternalJavadocAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenExternalJavadocAction.java
index 9672597..2ad40c4 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenExternalJavadocAction.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenExternalJavadocAction.java
@@ -16,7 +16,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
@@ -73,24 +72,6 @@
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.OPEN_EXTERNAL_JAVADOC_ACTION);
}
- /**
- * Creates a new <code>OpenExternalJavadocAction</code>. The action requires
- * that the selection provided by the given selection provider is of type <code>
- * org.eclipse.jface.viewers.IStructuredSelection</code>.
- *
- * @param site the site providing additional context information for this action
- * @param provider a special selection provider which is used instead
- * of the site's selection provider or <code>null</code> to use the site's
- * selection provider
- *
- * @since 3.2
- * @deprecated Use {@link #setSpecialSelectionProvider(ISelectionProvider)} instead. This API will be
- * removed after 3.2 M5.
- */
- public OpenExternalJavadocAction(IWorkbenchSite site, ISelectionProvider provider) {
- this(site);
- setSpecialSelectionProvider(provider);
- }
/**
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenJavaBrowsingPerspectiveAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenJavaBrowsingPerspectiveAction.java
deleted file mode 100644
index ff76506..0000000
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenJavaBrowsingPerspectiveAction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.ui.actions;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.wst.jsdt.internal.ui.IJavaHelpContextIds;
-import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
-import org.eclipse.wst.jsdt.internal.ui.actions.ActionMessages;
-import org.eclipse.wst.jsdt.internal.ui.util.ExceptionHandler;
-import org.eclipse.wst.jsdt.ui.JavaScriptUI;
-
-/**
- * Action to programmatically open a Java perspective.
- *
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- *
- *
- * Provisional API: This class/interface is part of an interim API that is still under development and expected to
- * change significantly before reaching stability. It is being made available at this early stage to solicit feedback
- * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
- * (repeatedly) as the API evolves.
- */
-public class OpenJavaBrowsingPerspectiveAction extends Action {
-
- /**
- * Create a new <code>OpenJavaBrowsingPerspectiveAction</code>.
- */
- public OpenJavaBrowsingPerspectiveAction() {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.OPEN_JAVA_BROWSING_PERSPECTIVE_ACTION);
- }
-
- public void run() {
- IWorkbench workbench= JavaScriptPlugin.getDefault().getWorkbench();
- IWorkbenchWindow window= workbench.getActiveWorkbenchWindow();
- IWorkbenchPage page= window.getActivePage();
- IAdaptable input;
- if (page != null)
- input= page.getInput();
- else
- input= ResourcesPlugin.getWorkspace().getRoot();
- try {
- workbench.showPerspective(JavaScriptUI.ID_BROWSING_PERSPECTIVE, window, input);
- } catch (WorkbenchException e) {
- ExceptionHandler.handle(e, window.getShell(),
- ActionMessages.OpenJavaBrowsingPerspectiveAction_dialog_title,
- ActionMessages.OpenJavaBrowsingPerspectiveAction_error_open_failed);
- }
- }
-}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenSuperImplementationAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenSuperImplementationAction.java
index 06fc9d1..15fa787 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenSuperImplementationAction.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenSuperImplementationAction.java
@@ -13,13 +13,12 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.jsdt.core.Flags;
-import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.internal.corext.util.Messages;
@@ -69,24 +68,6 @@
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.OPEN_SUPER_IMPLEMENTATION_ACTION);
}
- /**
- * Creates a new <code>OpenSuperImplementationAction</code>. The action requires
- * that the selection provided by the given selection provider is of type <code>
- * org.eclipse.jface.viewers.IStructuredSelection</code>.
- *
- * @param site the site providing context information for this action
- * @param provider a special selection provider which is used instead
- * of the site's selection provider or <code>null</code> to use the site's
- * selection provider
- *
- * @since 3.2
- * @deprecated Use {@link #setSpecialSelectionProvider(ISelectionProvider)} instead. This API will be
- * removed after 3.2 M5.
- */
- public OpenSuperImplementationAction(IWorkbenchSite site, ISelectionProvider provider) {
- this(site);
- setSpecialSelectionProvider(provider);
- }
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenTypeHierarchyAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenTypeHierarchyAction.java
index a14d078..4b85113 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenTypeHierarchyAction.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/OpenTypeHierarchyAction.java
@@ -19,14 +19,13 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.jsdt.core.IClassFile;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IImportDeclaration;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
@@ -79,26 +78,6 @@
}
/**
- * Creates a new <code>OpenTypeHierarchyAction</code>. The action requires
- * that the selection provided by the given selection provider is of type <code>
- * org.eclipse.jface.viewers.IStructuredSelection</code>.
- *
- * @param site the site providing context information for this action
- * @param provider a special selection provider which is used instead
- * of the site's selection provider or <code>null</code> to use the site's
- * selection provider
- *
- * @since 3.2
- * @deprecated Use {@link #setSpecialSelectionProvider(ISelectionProvider)} instead. This API will be
- * removed after 3.2 M5.
- */
- public OpenTypeHierarchyAction(IWorkbenchSite site, ISelectionProvider provider) {
- this(site);
- setSpecialSelectionProvider(provider);
- }
-
-
- /**
* Note: This constructor is for internal use only. Clients should not call this constructor.
* @param editor the Java editor
*/
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/SelectionDispatchAction.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/SelectionDispatchAction.java
index 89af1ef..dc5fb2f 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/SelectionDispatchAction.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/actions/SelectionDispatchAction.java
@@ -67,28 +67,6 @@
}
/**
- * Creates a new action with no text and no image
- *
- * <p>
- * Configure the action later using the set methods.
- * </p>
- *
- * @param site the site this action is working on
- * @param provider a special selection provider which is used
- * instead of the site's selection provider or <code>null</code> to use the site's
- * selection provider. Clients can for example use a {@link ConvertingSelectionProvider}
- * to first convert a selection before passing it to the action.
- *
- * @since 3.2
- * @deprecated Use {@link #setSpecialSelectionProvider(ISelectionProvider)} instead. This constructor will be
- * removed after 3.2 M5.
- */
- protected SelectionDispatchAction(IWorkbenchSite site, ISelectionProvider provider) {
- this(site);
- setSpecialSelectionProvider(provider);
- }
-
- /**
* Returns the site owning this action.
*
* @return the site owning this action
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/refactoring/IRefactoringProcessorIds.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/refactoring/IRefactoringProcessorIds.java
index 111b852..3ef0e72 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/refactoring/IRefactoringProcessorIds.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/refactoring/IRefactoringProcessorIds.java
@@ -11,7 +11,6 @@
package org.eclipse.wst.jsdt.ui.refactoring;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameCompilationUnitProcessor;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameEnumConstProcessor;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameFieldProcessor;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameJavaProjectProcessor;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameMethodProcessor;
@@ -160,17 +159,17 @@
*/
public static String RENAME_FIELD_PROCESSOR= RenameFieldProcessor.IDENTIFIER;
- /**
- * Processor ID of the rename enum constant processor
- * (value <code>"org.eclipse.wst.jsdt.ui.renameEnumConstProcessor"</code>).
- *
- * The rename filed processor loads the following participants:
- * <ul>
- * <li>participants registered for renaming <code>IField</code>.</li>
- * </ul>
- * @since 3.1
- */
- public static String RENAME_ENUM_CONSTANT_PROCESSOR= RenameEnumConstProcessor.IDENTIFIER;
+// /**
+// * Processor ID of the rename enum constant processor
+// * (value <code>"org.eclipse.wst.jsdt.ui.renameEnumConstProcessor"</code>).
+// *
+// * The rename filed processor loads the following participants:
+// * <ul>
+// * <li>participants registered for renaming <code>IField</code>.</li>
+// * </ul>
+// * @since 3.1
+// */
+// public static String RENAME_ENUM_CONSTANT_PROCESSOR= RenameEnumConstProcessor.IDENTIFIER;
/**
* Processor ID of the rename resource processor
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/refactoring/RenameSupport.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/refactoring/RenameSupport.java
index 72ca196..aa23fb2 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/refactoring/RenameSupport.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/refactoring/RenameSupport.java
@@ -22,11 +22,11 @@
import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IField;
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.ILocalVariable;
import org.eclipse.wst.jsdt.core.IFunction;
+import org.eclipse.wst.jsdt.core.IJavaScriptProject;
+import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
+import org.eclipse.wst.jsdt.core.ILocalVariable;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
import org.eclipse.wst.jsdt.core.IType;
@@ -36,7 +36,6 @@
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.JavaRenameRefactoring;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.MethodChecks;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameCompilationUnitProcessor;
-import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameEnumConstProcessor;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameFieldProcessor;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameJavaProjectProcessor;
import org.eclipse.wst.jsdt.internal.corext.refactoring.rename.RenameLocalVariableProcessor;
@@ -49,7 +48,6 @@
import org.eclipse.wst.jsdt.internal.corext.refactoring.tagging.INameUpdating;
import org.eclipse.wst.jsdt.internal.corext.refactoring.tagging.IReferenceUpdating;
import org.eclipse.wst.jsdt.internal.corext.refactoring.tagging.ITextUpdating;
-import org.eclipse.wst.jsdt.internal.corext.util.JdtFlags;
import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
import org.eclipse.wst.jsdt.internal.ui.JavaUIMessages;
import org.eclipse.wst.jsdt.internal.ui.refactoring.RefactoringExecutionHelper;
@@ -206,22 +204,6 @@
/** Flag indicating that references are to be updated as well. */
public static final int UPDATE_REFERENCES= 1 << 0;
- /**
- * Flag indicating that Javadoc comments are to be updated as well.
- * @deprecated use UPDATE_REFERENCES or UPDATE_TEXTUAL_MATCHES or both.
- */
- public static final int UPDATE_JAVADOC_COMMENTS= 1 << 1;
- /**
- * Flag indicating that regular comments are to be updated as well.
- * @deprecated use UPDATE_TEXTUAL_MATCHES
- */
- public static final int UPDATE_REGULAR_COMMENTS= 1 << 2;
- /**
- * Flag indicating that string literals are to be updated as well.
- * @deprecated use UPDATE_TEXTUAL_MATCHES
- */
- public static final int UPDATE_STRING_LITERALS= 1 << 3;
-
/**
* Flag indicating that textual matches in comments and in string literals
* are to be updated as well.
@@ -396,14 +378,10 @@
* the {@link RenameSupport}.
*/
public static RenameSupport create(IField field, String newName, int flags) throws CoreException {
- if (JdtFlags.isEnum(field))
- return new RenameSupport(new RenameEnumConstProcessor(field), newName, flags);
- else {
final RenameFieldProcessor processor= new RenameFieldProcessor(field);
processor.setRenameGetter(updateGetterMethod(flags));
processor.setRenameSetter(updateSetterMethod(flags));
return new RenameSupport(processor, newName, flags);
- }
}
/**
@@ -468,7 +446,7 @@
}
private static boolean updateTextualMatches(int flags) {
- int TEXT_UPDATES= UPDATE_TEXTUAL_MATCHES | UPDATE_REGULAR_COMMENTS | UPDATE_STRING_LITERALS;
+ int TEXT_UPDATES= UPDATE_TEXTUAL_MATCHES;
return (flags & TEXT_UPDATES) != 0;
}
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/IJavaScriptColorConstants.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/IJavaScriptColorConstants.java
index f2c7048..5151838 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/IJavaScriptColorConstants.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/IJavaScriptColorConstants.java
@@ -92,14 +92,6 @@
String JAVA_DEFAULT= "java_default"; //$NON-NLS-1$
/**
- * The color key for the Java built-in types such as <code>int</code> and <code>char</code> in Java code
- * (value <code>"java_type"</code>).
- *
- * @deprecated no longer used, replaced by <code>JAVA_KEYWORD</code>
- */
- String JAVA_TYPE= "java_type"; //$NON-NLS-1$
-
- /**
* The color key for annotations
* (value <code>"java_annotation"</code>).
*
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/JavaScriptSourceViewerConfiguration.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/JavaScriptSourceViewerConfiguration.java
index c915b23..c6930bd 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/JavaScriptSourceViewerConfiguration.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/JavaScriptSourceViewerConfiguration.java
@@ -16,7 +16,6 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.wst.jsdt.internal.ui.text.html.HTMLTextPresenter;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.AbstractInformationControlManager;
import org.eclipse.jface.text.DefaultInformationControl;
@@ -75,6 +74,7 @@
import org.eclipse.wst.jsdt.internal.ui.text.SingleTokenJavaScanner;
import org.eclipse.wst.jsdt.internal.ui.text.comment.CommentFormattingStrategy;
import org.eclipse.wst.jsdt.internal.ui.text.correction.JavaCorrectionAssistant;
+import org.eclipse.wst.jsdt.internal.ui.text.html.HTMLTextPresenter;
import org.eclipse.wst.jsdt.internal.ui.text.java.ContentAssistProcessor;
import org.eclipse.wst.jsdt.internal.ui.text.java.JavaAutoIndentStrategy;
import org.eclipse.wst.jsdt.internal.ui.text.java.JavaCodeScanner;
@@ -93,7 +93,6 @@
import org.eclipse.wst.jsdt.internal.ui.text.javadoc.JavadocCompletionProcessor;
import org.eclipse.wst.jsdt.internal.ui.typehierarchy.HierarchyInformationControl;
import org.eclipse.wst.jsdt.ui.JavaScriptUI;
-import org.eclipse.wst.jsdt.ui.PreferenceConstants;
import org.eclipse.wst.jsdt.ui.actions.IJavaEditorActionDefinitionIds;
@@ -110,23 +109,6 @@
*/
public class JavaScriptSourceViewerConfiguration extends TextSourceViewerConfiguration {
- /**
- * Preference key used to look up display tab width.
- *
- * @since 2.0
- * @deprecated As of 3.0, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants#EDITOR_TAB_WIDTH}
- */
- public final static String PREFERENCE_TAB_WIDTH= PreferenceConstants.EDITOR_TAB_WIDTH;
-
- /**
- * Preference key for inserting spaces rather than tabs.
- *
- * @since 2.0
- * @deprecated as of 3.1 use {@link org.eclipse.wst.jsdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_TAB_CHAR}
- */
- public final static String SPACES_FOR_TABS= PreferenceConstants.EDITOR_SPACES_FOR_TABS;
-
-
private JavaScriptTextTools fJavaTextTools;
private ITextEditor fTextEditor;
/**
@@ -177,7 +159,7 @@
* <p>
* Creates a Java source viewer configuration in the new setup without text tools. Clients are
* allowed to call {@link JavaScriptSourceViewerConfiguration#handlePropertyChangeEvent(PropertyChangeEvent)}
- * and disallowed to call {@link JavaScriptSourceViewerConfiguration#getPreferenceStore()} on the resulting
+ * on the resulting
* Java source viewer configuration.
* </p>
*
@@ -196,27 +178,6 @@
}
/**
- * Creates a new Java source viewer configuration for viewers in the given editor
- * using the given Java tools.
- *
- * @param tools the Java text tools to be used
- * @param editor the editor in which the configured viewer(s) will reside, or <code>null</code> if none
- * @see JavaScriptTextTools
- * @deprecated As of 3.0, replaced by {@link JavaScriptSourceViewerConfiguration#JavaSourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String)}
- */
- public JavaScriptSourceViewerConfiguration(JavaScriptTextTools tools, ITextEditor editor) {
- super(createPreferenceStore(tools));
- fJavaTextTools= tools;
- fColorManager= tools.getColorManager();
- fCodeScanner= (AbstractJavaScanner) fJavaTextTools.getCodeScanner();
- fMultilineCommentScanner= (AbstractJavaScanner) fJavaTextTools.getMultilineCommentScanner();
- fSinglelineCommentScanner= (AbstractJavaScanner) fJavaTextTools.getSinglelineCommentScanner();
- fStringScanner= (AbstractJavaScanner) fJavaTextTools.getStringScanner();
- fJavaDocScanner= (AbstractJavaScanner) fJavaTextTools.getJavaDocScanner();
- fTextEditor= editor;
- }
-
- /**
* Returns the Java source code scanner for this configuration.
*
* @return the Java source code scanner
@@ -283,23 +244,6 @@
}
/**
- * Returns the preference store used by this configuration to initialize
- * the individual bits and pieces.
- * <p>
- * Clients are not allowed to call this method if the new setup without
- * text tools is in use.</p>
- *
- * @return the preference store used to initialize this configuration
- * @see JavaScriptSourceViewerConfiguration#JavaSourceViewerConfiguration(IColorManager, IPreferenceStore, ITextEditor, String)
- * @since 2.0
- * @deprecated As of 3.0
- */
- protected IPreferenceStore getPreferenceStore() {
- Assert.isTrue(!isNewSetup());
- return fJavaTextTools.getPreferenceStore();
- }
-
- /**
* @return <code>true</code> iff the new setup without text tools is in use.
*
* @since 3.0
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/JavaScriptTextTools.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/JavaScriptTextTools.java
index 9fcfeb4..bff8802 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/JavaScriptTextTools.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/text/JavaScriptTextTools.java
@@ -17,7 +17,6 @@
import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.rules.FastPartitioner;
import org.eclipse.jface.text.rules.IPartitionTokenScanner;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.wst.jsdt.internal.ui.text.FastJavaPartitionScanner;
@@ -215,62 +214,6 @@
}
/**
- * Returns a scanner which is configured to scan Java source code.
- *
- * @return a Java source code scanner
- * @deprecated As of 3.0, replaced by {@link JavaScriptSourceViewerConfiguration#getCodeScanner()}
- */
- public RuleBasedScanner getCodeScanner() {
- return fCodeScanner;
- }
-
- /**
- * Returns a scanner which is configured to scan Java multi-line comments.
- *
- * @return a Java multi-line comment scanner
- * @since 2.0
- * @deprecated As of 3.0, replaced by {@link JavaScriptSourceViewerConfiguration#getMultilineCommentScanner()}
- */
- public RuleBasedScanner getMultilineCommentScanner() {
- return fMultilineCommentScanner;
- }
-
- /**
- * Returns a scanner which is configured to scan Java single-line comments.
- *
- * @return a Java single-line comment scanner
- * @since 2.0
- * @deprecated As of 3.0, replaced by {@link JavaScriptSourceViewerConfiguration#getSinglelineCommentScanner()}
- */
- public RuleBasedScanner getSinglelineCommentScanner() {
- return fSinglelineCommentScanner;
- }
-
- /**
- * Returns a scanner which is configured to scan Java strings.
- *
- * @return a Java string scanner
- * @since 2.0
- * @deprecated As of 3.0, replaced by {@link JavaScriptSourceViewerConfiguration#getStringScanner()}
- */
- public RuleBasedScanner getStringScanner() {
- return fStringScanner;
- }
-
- /**
- * Returns a scanner which is configured to scan JavaDoc compliant comments.
- * <p>
- * Note that the start sequence "/**" and the corresponding end sequence
- * are part of the Javadoc comment.</p>
- *
- * @return a Javadoc scanner
- * @deprecated As of 3.0, replaced by {@link JavaScriptSourceViewerConfiguration#getJavaDocScanner()}
- */
- public RuleBasedScanner getJavaDocScanner() {
- return fJavaDocScanner;
- }
-
- /**
* Returns a scanner which is configured to scan
* Java-specific partitions, which are multi-line comments,
* Javadoc comments, and regular Java source code.
@@ -293,37 +236,6 @@
}
/**
- * Returns the names of the document position categories used by the document
- * partitioners created by this object to manage their partition information.
- * <p>
- * If the partitioners don't use document position categories, the returned
- * result is <code>null</code>.</p>
- *
- * @return the partition managing position categories or <code>null</code> if there is none
- * @deprecated As of 3.0, replaced by {@link org.eclipse.jface.text.TextUtilities#computePartitionManagingCategories(IDocument)}
- */
- public String[] getPartitionManagingPositionCategories() {
- return new String[] { org.eclipse.jface.text.rules.DefaultPartitioner.CONTENT_TYPES_CATEGORY };
- }
-
- /**
- * Determines whether the preference change encoded by the given event
- * changes the behavior of one its contained components.
- *
- * @param event the event to be investigated
- * @return <code>true</code> if event causes a behavioral change
- * @since 2.0
- * @deprecated As of 3.0, replaced by {@link org.eclipse.wst.jsdt.ui.text.JavaScriptSourceViewerConfiguration#affectsTextPresentation(PropertyChangeEvent)}
- */
- public boolean affectsBehavior(PropertyChangeEvent event) {
- return fCodeScanner.affectsBehavior(event) ||
- fMultilineCommentScanner.affectsBehavior(event) ||
- fSinglelineCommentScanner.affectsBehavior(event) ||
- fStringScanner.affectsBehavior(event) ||
- fJavaDocScanner.affectsBehavior(event);
- }
-
- /**
* Adapts the behavior of the contained components to the change
* encoded in the given event.
*
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/JavaCapabilityConfigurationPage.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/JavaCapabilityConfigurationPage.java
index 2ea13d6..a97aaea 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/JavaCapabilityConfigurationPage.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/JavaCapabilityConfigurationPage.java
@@ -13,7 +13,6 @@
import java.lang.reflect.InvocationTargetException;
import java.net.URI;
-import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -216,22 +215,6 @@
* is configured. No natures are added.
*
* @param project The handle of the project to create.
- * @param locationPath The location of the project <code>null</code> to create the project in the workspace
- * @param monitor a progress monitor to report progress or <code>null</code> if
- * progress reporting is not desired
- * @throws CoreException if the project couldn't be created
- * @since 2.1
- * @deprecated use {@link #createProject(IProject, URI, IProgressMonitor)} instead.
- */
- public static void createProject(IProject project, IPath locationPath, IProgressMonitor monitor) throws CoreException {
- createProject(project, locationPath != null ? URIUtil.toURI(locationPath) : null, monitor);
- }
-
- /**
- * Helper method to create and open a IProject. The project location
- * is configured. No natures are added.
- *
- * @param project The handle of the project to create.
* @param locationURI The location of the project or <code>null</code> to create the project in the workspace
* @param monitor a progress monitor to report progress or <code>null</code> if
* progress reporting is not desired
diff --git a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/NewTypeWizardPage.java b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/NewTypeWizardPage.java
index 7533e06..9dc4a0b 100644
--- a/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/NewTypeWizardPage.java
+++ b/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/ui/wizards/NewTypeWizardPage.java
@@ -2408,28 +2408,6 @@
}
/**
- * @param parentCU the current compilation unit
- * @return returns the template or <code>null</code>
- * @deprecated Use getTypeComment(IJavaScriptUnit, String)
- */
- protected String getTypeComment(IJavaScriptUnit parentCU) {
- if (StubUtility.doAddComments(parentCU.getJavaScriptProject()))
- return getTypeComment(parentCU, StubUtility.getLineDelimiterUsed(parentCU));
- return null;
- }
-
- /**
- * @param name the name of the template
- * @param parentCU the current compilation unit
- * @return returns the template or <code>null</code>
- * @deprecated Use getTemplate(String,IJavaScriptUnit,int)
- */
- protected String getTemplate(String name, IJavaScriptUnit parentCU) {
- return getTemplate(name, parentCU, 0);
- }
-
-
- /**
* Returns the string resulting from evaluation the given template in
* the context of the given compilation unit. This accesses the normal
* template page, not the code templates. To use code templates use