import java.util.List;
import java.util.Map;
-import net.sourceforge.phpdt.internal.core.BatchOperation;
+import net.sourceforge.phpdt.internal.compiler.impl.CompilerOptions;
import net.sourceforge.phpdt.internal.core.BufferManager;
import net.sourceforge.phpdt.internal.core.ClasspathEntry;
import net.sourceforge.phpdt.internal.core.JavaModel;
import net.sourceforge.phpdt.internal.core.JavaModelManager;
import net.sourceforge.phpdt.internal.core.Region;
+import net.sourceforge.phpdt.internal.core.util.MementoTokenizer;
import net.sourceforge.phpdt.internal.corext.Assert;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.ISavedState;
-import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import net.sourceforge.phpdt.internal.core.util.Util;
-import org.osgi.framework.BundleContext;
public class JavaCore {
*
* @see #getDefaultOptions
*/
- public static final String COMPILER_PB_PHP_VAR_DEPRECATED = PLUGIN_ID
- + ".compiler.problem.phpVarDeprecatedWarning"; //$NON-NLS-1$
+ public static final String COMPILER_PB_PHP_VAR_DEPRECATED = CompilerOptions.OPTION_PHPVarDeprecatedWarning; //$NON-NLS-1$
- public static final String COMPILER_PB_PHP_KEYWORD = PLUGIN_ID
- + ".compiler.problem.phpBadStyleKeywordWarning"; //$NON-NLS-1$
+ public static final String COMPILER_PB_PHP_KEYWORD = CompilerOptions.OPTION_PHPBadStyleKeywordWarning; //$NON-NLS-1$
- public static final String COMPILER_PB_PHP_UPPERCASE_IDENTIFIER = PLUGIN_ID
- + ".compiler.problem.phpBadStyleUppercaseIdentifierWarning"; //$NON-NLS-1$
+ public static final String COMPILER_PB_PHP_UPPERCASE_IDENTIFIER = CompilerOptions.OPTION_PHPBadStyleUppercaseIdentifierWarning; //$NON-NLS-1$
+
+ public static final String COMPILER_PB_PHP_FILE_NOT_EXIST = CompilerOptions.OPTION_PHPIncludeNotExistWarning; //$NON-NLS-1$
+
+ public static final String COMPILER_PB_UNINITIALIZED_LOCAL_VARIABLE = CompilerOptions.OPTION_UninitializedLocalVariableWarning; //$NON-NLS-1$
+
+ public static final String COMPILER_PB_UNREACHABLE_CODE = CompilerOptions.OPTION_CodeCannotBeReachedWarning; //$NON-NLS-1$
/**
* Possible configurable option ID.
*
* @see #getDefaultOptions
*/
- public static final String COMPILER_PB_UNREACHABLE_CODE = PLUGIN_ID
- + ".compiler.problem.unreachableCode"; //$NON-NLS-1$
+// public static final String COMPILER_PB_UNREACHABLE_CODE = PLUGIN_ID
+// + ".compiler.problem.unreachableCode"; //$NON-NLS-1$
/**
* Possible configurable option ID.
}
/**
+ * Returns the Java model element corresponding to the given handle identifier
+ * generated by <code>IJavaElement.getHandleIdentifier()</code>, or
+ * <code>null</code> if unable to create the associated element.
+ * If the returned Java element is an <code>ICompilationUnit</code>, its owner
+ * is the given owner if such a working copy exists, otherwise the compilation unit
+ * is a primary compilation unit.
+ *
+ * @param handleIdentifier the given handle identifier
+ * @param owner the owner of the returned compilation unit, ignored if the returned
+ * element is not a compilation unit
+ * @return the Java element corresponding to the handle identifier
+ * @since 3.0
+ */
+ public static IJavaElement create(String handleIdentifier, WorkingCopyOwner owner) {
+ if (handleIdentifier == null) {
+ return null;
+ }
+ MementoTokenizer memento = new MementoTokenizer(handleIdentifier);
+ JavaModel model = JavaModelManager.getJavaModelManager().getJavaModel();
+ return model.getHandleFromMemento(memento, owner);
+ }
+
+ /**
* Returns the Java element corresponding to the given file, or
* <code>null</code> if unable to associate the given file with a Java
* element.
* (using <code>setClasspathContainer</code>, then a
* <code>ClasspathContainerInitializer</code> will be activated if any was
* registered for this container ID onto the extension point
- * "org.eclipse.jdt.core.classpathContainerInitializer".
+ * "net.sourceforge.phpdt.core.classpathContainerInitializer".
* <p>
* There is no assumption that the returned container must answer the exact
* same containerPath when requested
* are not preserved from a session to another. It is thus highly
* recommended to register a <code>ClasspathContainerInitializer</code>
* for each referenced container (through the extension point
- * "org.eclipse.jdt.core.ClasspathContainerInitializer").
+ * "net.sourceforge.phpdt.core.ClasspathContainerInitializer").
* <p>
*
* @param containerPath
* Helper method finding the classpath container initializer registered for
* a given classpath container ID or <code>null</code> if none was found
* while iterating over the contributions to extension point to the
- * extension point "org.eclipse.jdt.core.classpathContainerInitializer".
+ * extension point "net.sourceforge.phpdt.core.classpathContainerInitializer".
* <p>
* A containerID is the first segment of any container path, used to
* identify the registered container initializer.
* <p>
* Note that classpath variables can be contributed registered initializers
* for, using the extension point
- * "org.eclipse.jdt.core.classpathVariableInitializer". If an initializer is
+ * "net.sourceforge.phpdt.core.classpathVariableInitializer". 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.
* Helper method finding the classpath variable initializer registered for a
* given classpath variable name or <code>null</code> if none was found
* while iterating over the contributions to extension point to the
- * extension point "org.eclipse.jdt.core.classpathVariableInitializer".
+ * extension point "net.sourceforge.phpdt.core.classpathVariableInitializer".
* <p>
*
* @param the
* When generated, this attribute will enable local variable names
* to be displayed in debugger, only in place where variables are
* definitely assigned (.class file is then bigger)
- * - option id: "org.eclipse.jdt.core.compiler.debug.localVariable"
+ * - option id: "net.sourceforge.phpdt.core.compiler.debug.localVariable"
* - possible values: { "generate", "do not generate" }
* - default: "generate"
*
* COMPILER / Generating Line Number Debug Attribute
* When generated, this attribute will enable source code highlighting in debugger
* (.class file is then bigger).
- * - option id: "org.eclipse.jdt.core.compiler.debug.lineNumber"
+ * - option id: "net.sourceforge.phpdt.core.compiler.debug.lineNumber"
* - possible values: { "generate", "do not generate" }
* - default: "generate"
*
* COMPILER / Generating Source Debug Attribute
* When generated, this attribute will enable the debugger to present the
* corresponding source code.
- * - option id: "org.eclipse.jdt.core.compiler.debug.sourceFile"
+ * - option id: "net.sourceforge.phpdt.core.compiler.debug.sourceFile"
* - possible values: { "generate", "do not generate" }
* - default: "generate"
*
* COMPILER / Preserving Unused Local Variables
* Unless requested to preserve unused local variables (that is, never read), the
* compiler will optimize them out, potentially altering debugging
- * - option id: "org.eclipse.jdt.core.compiler.codegen.unusedLocal"
+ * - option id: "net.sourceforge.phpdt.core.compiler.codegen.unusedLocal"
* - possible values: { "preserve", "optimize out" }
* - default: "preserve"
*
* COMPILER / Defining Target Java Platform
* For binary compatibility reason, .class files can be tagged to with certain VM versions and later.
* Note that "1.4" target require to toggle compliance mode to "1.4" too.
- * - option id: "org.eclipse.jdt.core.compiler.codegen.targetPlatform"
+ * - option id: "net.sourceforge.phpdt.core.compiler.codegen.targetPlatform"
* - possible values: { "1.1", "1.2", "1.3", "1.4" }
* - default: "1.1"
*
* COMPILER / Reporting Unreachable Code
* Unreachable code can optionally be reported as an error, warning or simply
* ignored. The bytecode generation will always optimized it out.
- * - option id: "org.eclipse.jdt.core.compiler.problem.unreachableCode"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.unreachableCode"
* - possible values: { "error", "warning", "ignore" }
* - default: "error"
*
* COMPILER / Reporting Invalid Import
* An import statement that cannot be resolved might optionally be reported
* as an error, as a warning or ignored.
- * - option id: "org.eclipse.jdt.core.compiler.problem.invalidImport"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.invalidImport"
* - possible values: { "error", "warning", "ignore" }
* - default: "error"
*
* A package default method is not visible in a different package, and thus
* cannot be overridden. When enabling this option, the compiler will signal
* such scenarii either as an error or a warning.
- * - option id: "org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.overridingPackageDefaultMethod"
* - possible values: { "error", "warning", "ignore" }
* - default: "warning"
*
* Naming a method with a constructor name is generally considered poor
* style programming. When enabling this option, the compiler will signal such
* scenarii either as an error or a warning.
- * - option id: "org.eclipse.jdt.core.compiler.problem.methodWithConstructorName"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.methodWithConstructorName"
* - possible values: { "error", "warning", "ignore" }
* - default: "warning"
*
* COMPILER / Reporting Deprecation
* When enabled, the compiler will signal use of deprecated API either as an
* error or a warning.
- * - option id: "org.eclipse.jdt.core.compiler.problem.deprecation"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.deprecation"
* - possible values: { "error", "warning", "ignore" }
* - default: "warning"
*
* COMPILER / Reporting Deprecation Inside Deprecated Code
* When enabled, the compiler will signal use of deprecated API inside deprecated code.
- * The severity of the problem is controlled with option "org.eclipse.jdt.core.compiler.problem.deprecation".
- * - option id: "org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode"
+ * The severity of the problem is controlled with option "net.sourceforge.phpdt.core.compiler.problem.deprecation".
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.deprecationInDeprecatedCode"
* - possible values: { "enabled", "disabled" }
* - default: "disabled"
*
* } catch (java.io.IOException e) {}.
* When enabling this option, the compiler will issue an error or a warning for hidden
* catch blocks corresponding to checked exceptions
- * - option id: "org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.hiddenCatchBlock"
* - possible values: { "error", "warning", "ignore" }
* - default: "warning"
*
* COMPILER / Reporting Unused Local
* When enabled, the compiler will issue an error or a warning for unused local
* variables (that is, variables never read from)
- * - option id: "org.eclipse.jdt.core.compiler.problem.unusedLocal"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.unusedLocal"
* - possible values: { "error", "warning", "ignore" }
* - default: "ignore"
*
* COMPILER / Reporting Unused Parameter
* When enabled, the compiler will issue an error or a warning for unused method
* parameters (that is, parameters never read from)
- * - option id: "org.eclipse.jdt.core.compiler.problem.unusedParameter"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.unusedParameter"
* - possible values: { "error", "warning", "ignore" }
* - default: "ignore"
*
* COMPILER / Reporting Unused Parameter if Implementing Abstract Method
* When enabled, the compiler will signal unused parameters in abstract method implementations.
- * The severity of the problem is controlled with option "org.eclipse.jdt.core.compiler.problem.unusedParameter".
- * - option id: "org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract"
+ * The severity of the problem is controlled with option "net.sourceforge.phpdt.core.compiler.problem.unusedParameter".
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.unusedParameterWhenImplementingAbstract"
* - possible values: { "enabled", "disabled" }
* - default: "disabled"
*
* COMPILER / Reporting Unused Parameter if Overriding Concrete Method
* When enabled, the compiler will signal unused parameters in methods overriding concrete ones.
- * The severity of the problem is controlled with option "org.eclipse.jdt.core.compiler.problem.unusedParameter".
- * - option id: "org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete"
+ * The severity of the problem is controlled with option "net.sourceforge.phpdt.core.compiler.problem.unusedParameter".
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.unusedParameterWhenOverridingConcrete"
* - possible values: { "enabled", "disabled" }
* - default: "disabled"
*
* COMPILER / Reporting Unused Import
* When enabled, the compiler will issue an error or a warning for unused import
* reference
- * - option id: "org.eclipse.jdt.core.compiler.problem.unusedImport"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.unusedImport"
* - possible values: { "error", "warning", "ignore" }
* - default: "warning"
*
* COMPILER / Reporting Unused Private Members
* When enabled, the compiler will issue an error or a warning whenever a private
* method or field is declared but never used within the same unit.
- * - option id: "org.eclipse.jdt.core.compiler.problem.unusedPrivateMember"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.unusedPrivateMember"
* - possible values: { "error", "warning", "ignore" }
* - default: "ignore"
*
* When enabled, the compiler will issue an error or a warning whenever it emulates
* access to a non-accessible member of an enclosing type. Such access can have
* performance implications.
- * - option id: "org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.syntheticAccessEmulation"
* - possible values: { "error", "warning", "ignore" }
* - default: "ignore"
*
* COMPILER / Reporting Non-Externalized String Literal
* When enabled, the compiler will issue an error or a warning for non externalized
* String literal (that is, not tagged with //$NON-NLS-<n>$).
- * - option id: "org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.nonExternalizedStringLiteral"
* - possible values: { "error", "warning", "ignore" }
* - default: "ignore"
*
* COMPILER / Reporting Usage of 'assert' Identifier
* When enabled, the compiler will issue an error or a warning whenever 'assert' is
* used as an identifier (reserved keyword in 1.4)
- * - option id: "org.eclipse.jdt.core.compiler.problem.assertIdentifier"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.assertIdentifier"
* - possible values: { "error", "warning", "ignore" }
* - default: "ignore"
*
* When enabled, the compiler will issue an error or a warning whenever a static field
* or method is accessed with an expression receiver. A reference to a static member should
* be qualified with a type name.
- * - option id: "org.eclipse.jdt.core.compiler.problem.staticAccessReceiver"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.staticAccessReceiver"
* - possible values: { "error", "warning", "ignore" }
* - default: "warning"
*
* COMPILER / Reporting Assignment with no Effect
* When enabled, the compiler will issue an error or a warning whenever an assignment
* has no effect (e.g 'x = x').
- * - option id: "org.eclipse.jdt.core.compiler.problem.noEffectAssignment"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.noEffectAssignment"
* - possible values: { "error", "warning", "ignore" }
* - default: "warning"
*
* interface I {
* int clone();
* }
- * - option id: "org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod"
* - possible values: { "error", "warning", "ignore" }
* - default: "warning"
*
* COMPILER / Reporting Usage of char[] Expressions in String Concatenations
* When enabled, the compiler will issue an error or a warning whenever a char[] expression
* is used in String concatenations (for example, "hello" + new char[]{'w','o','r','l','d'}).
- * - option id: "org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion"
+ * - option id: "net.sourceforge.phpdt.core.compiler.problem.noImplicitStringConversion"
* - possible values: { "error", "warning", "ignore" }
* - default: "warning"
*
* Specify whether source is 1.3 or 1.4 compatible. From 1.4 on, 'assert' is a keyword
* reserved for assertion support. Also note, than when toggling to 1.4 mode, the target VM
* level should be set to "1.4" and the compliance mode should be "1.4".
- * - option id: "org.eclipse.jdt.core.compiler.source"
+ * - option id: "net.sourceforge.phpdt.core.compiler.source"
* - possible values: { "1.3", "1.4" }
* - default: "1.3"
*
* COMPILER / Setting Compliance Level
* Select the compliance level for the compiler. In "1.3" mode, source and target settings
* should not go beyond "1.3" level.
- * - option id: "org.eclipse.jdt.core.compiler.compliance"
+ * - option id: "net.sourceforge.phpdt.core.compiler.compliance"
* - possible values: { "1.3", "1.4" }
* - default: "1.3"
*
* COMPILER / Maximum number of problems reported per compilation unit
* Specify the maximum number of problems reported on each compilation unit.
- * - option id: "org.eclipse.jdt.core.compiler.maxProblemPerUnit"
+ * - option id: "net.sourceforge.phpdt.core.compiler.maxProblemPerUnit"
* - possible values: "<n>" where <n> is zero or a positive integer (if zero then all problems are reported).
* - default: "100"
*
* one of the corresponding tag inside any comment in Java source code.
* Generated task messages will include the tag, and range until the next line separator or comment ending.
* Note that tasks messages are trimmed.
- * - option id: "org.eclipse.jdt.core.compiler.taskTags"
+ * - option id: "net.sourceforge.phpdt.core.compiler.taskTags"
* - possible values: { "<tag>[,<tag>]*" } where <tag> is a String without any wild-card or leading/trailing spaces
* - default: ""
*
* In parallel with the Automatic Task Tags, this list defines the priorities (high, normal or low)
* of the task markers issued by the compiler.
* If the default is specified, the priority of each task marker is "NORMAL".
- * - option id: "org.eclipse.jdt.core.compiler.taskPriorities"
+ * - option id: "net.sourceforge.phpdt.core.compiler.taskPriorities"
* - possible values: { "<priority>[,<priority>]*" } where <priority> is one of "HIGH", "NORMAL" or "LOW"
* - default: ""
*
* BUILDER / Specifying Filters for Resource Copying Control
* Allow to specify some filters to control the resource copy process.
- * - option id: "org.eclipse.jdt.core.builder.resourceCopyExclusionFilter"
+ * - option id: "net.sourceforge.phpdt.core.builder.resourceCopyExclusionFilter"
* - possible values: { "<name>[,<name>]* } where <name> is a file name pattern (* and ? wild-cards allowed)
* or the name of a folder which ends with '/'
* - default: ""
*
* BUILDER / Abort if Invalid Classpath
* Allow to toggle the builder to abort if the classpath is invalid
- * - option id: "org.eclipse.jdt.core.builder.invalidClasspath"
+ * - option id: "net.sourceforge.phpdt.core.builder.invalidClasspath"
* - possible values: { "abort", "ignore" }
* - default: "abort"
*
* BUILDER / Cleaning Output Folder(s)
* Indicate whether the JavaBuilder is allowed to clean the output folders
* when performing full build operations.
- * - option id: "org.eclipse.jdt.core.builder.cleanOutputFolder"
+ * - option id: "net.sourceforge.phpdt.core.builder.cleanOutputFolder"
* - possible values: { "clean", "ignore" }
* - default: "clean"
*
* BUILDER / Reporting Duplicate Resources
* Indicate the severity of the problem reported when more than one occurrence
* of a resource is to be copied into the output location.
- * - option id: "org.eclipse.jdt.core.builder.duplicateResourceTask"
+ * - option id: "net.sourceforge.phpdt.core.builder.duplicateResourceTask"
* - possible values: { "error", "warning" }
* - default: "warning"
*
* Indicate whether JavaCore should enforce the project build order to be based on
* the classpath prerequisite chain. When requesting to compute, this takes over
* the platform default order (based on project references).
- * - option id: "org.eclipse.jdt.core.computeJavaBuildOrder"
+ * - option id: "net.sourceforge.phpdt.core.computeJavaBuildOrder"
* - possible values: { "compute", "ignore" }
* - default: "ignore"
*
* JAVACORE / Specify Default Source Encoding Format
* Get the encoding format for compiled sources. This setting is read-only, it is equivalent
* to 'ResourcesPlugin.getEncoding()'.
- * - option id: "org.eclipse.jdt.core.encoding"
+ * - option id: "net.sourceforge.phpdt.core.encoding"
* - possible values: { any of the supported encoding name}.
* - default: <platform default>
*
* JAVACORE / Reporting Incomplete Classpath
* Indicate the severity of the problem reported when an entry on the classpath does not exist,
* is not legite or is not visible (for example, a referenced project is closed).
- * - option id: "org.eclipse.jdt.core.incompleteClasspath"
+ * - option id: "net.sourceforge.phpdt.core.incompleteClasspath"
* - possible values: { "error", "warning"}
* - default: "error"
*
* JAVACORE / Reporting Classpath Cycle
* Indicate the severity of the problem reported when a project is involved in a cycle.
- * - option id: "org.eclipse.jdt.core.circularClasspath"
+ * - option id: "net.sourceforge.phpdt.core.circularClasspath"
* - possible values: { "error", "warning" }
* - default: "error"
*
* JAVACORE / Enabling Usage of Classpath Exclusion Patterns
* When disabled, no entry on a project classpath can be associated with
* an exclusion pattern.
- * - option id: "org.eclipse.jdt.core.classpath.exclusionPatterns"
+ * - option id: "net.sourceforge.phpdt.core.classpath.exclusionPatterns"
* - possible values: { "enabled", "disabled" }
* - default: "enabled"
*
* JAVACORE / Enabling Usage of Classpath Multiple Output Locations
* When disabled, no entry on a project classpath can be associated with
* a specific output location, preventing thus usage of multiple output locations.
- * - option id: "org.eclipse.jdt.core.classpath.multipleOutputLocations"
+ * - option id: "net.sourceforge.phpdt.core.classpath.multipleOutputLocations"
* - possible values: { "enabled", "disabled" }
* - default: "enabled"
*
* FORMATTER / Inserting New Line Before Opening Brace
* When Insert, a new line is inserted before an opening brace, otherwise nothing
* is inserted
- * - option id: "org.eclipse.jdt.core.formatter.newline.openingBrace"
+ * - option id: "net.sourceforge.phpdt.core.formatter.newline.openingBrace"
* - possible values: { "insert", "do not insert" }
* - default: "do not insert"
*
* FORMATTER / Inserting New Line Inside Control Statement
* When Insert, a new line is inserted between } and following else, catch, finally
- * - option id: "org.eclipse.jdt.core.formatter.newline.controlStatement"
+ * - option id: "net.sourceforge.phpdt.core.formatter.newline.controlStatement"
* - possible values: { "insert", "do not insert" }
* - default: "do not insert"
*
* FORMATTER / Clearing Blank Lines
* When Clear all, all blank lines are removed. When Preserve one, only one is kept
* and all others removed.
- * - option id: "org.eclipse.jdt.core.formatter.newline.clearAll"
+ * - option id: "net.sourceforge.phpdt.core.formatter.newline.clearAll"
* - possible values: { "clear all", "preserve one" }
* - default: "preserve one"
*
* When Insert, a blank line is inserted between an else and an if when they are
* contiguous. When choosing to not insert, else-if will be kept on the same
* line when possible.
- * - option id: "org.eclipse.jdt.core.formatter.newline.elseIf"
+ * - option id: "net.sourceforge.phpdt.core.formatter.newline.elseIf"
* - possible values: { "insert", "do not insert" }
* - default: "do not insert"
*
* FORMATTER / Inserting New Line In Empty Block
* When insert, a line break is inserted between contiguous { and }, if } is not followed
* by a keyword.
- * - option id: "org.eclipse.jdt.core.formatter.newline.emptyBlock"
+ * - option id: "net.sourceforge.phpdt.core.formatter.newline.emptyBlock"
* - possible values: { "insert", "do not insert" }
* - default: "insert"
*
* FORMATTER / Splitting Lines Exceeding Length
* Enable splitting of long lines (exceeding the configurable length). Length of 0 will
* disable line splitting
- * - option id: "org.eclipse.jdt.core.formatter.lineSplit"
+ * - option id: "net.sourceforge.phpdt.core.formatter.lineSplit"
* - possible values: "<n>", where n is zero or a positive integer
* - default: "80"
*
* FORMATTER / Compacting Assignment
* Assignments can be formatted asymmetrically, for example 'int x= 2;', when Normal, a space
* is inserted before the assignment operator
- * - option id: "org.eclipse.jdt.core.formatter.style.assignment"
+ * - option id: "net.sourceforge.phpdt.core.formatter.style.assignment"
* - possible values: { "compact", "normal" }
* - default: "normal"
*
* FORMATTER / Defining Indentation Character
* Either choose to indent with tab characters or spaces
- * - option id: "org.eclipse.jdt.core.formatter.tabulation.char"
+ * - option id: "net.sourceforge.phpdt.core.formatter.tabulation.char"
* - possible values: { "tab", "space" }
* - default: "tab"
*
* FORMATTER / Defining Space Indentation Length
* When using spaces, set the amount of space characters to use for each
* indentation mark.
- * - option id: "org.eclipse.jdt.core.formatter.tabulation.size"
+ * - option id: "net.sourceforge.phpdt.core.formatter.tabulation.size"
* - possible values: "<n>", where n is a positive integer
* - default: "4"
*
* FORMATTER / Inserting space in cast expression
* When Insert, a space is added between the type and the expression in a cast expression.
- * - option id: "org.eclipse.jdt.core.formatter.space.castexpression"
+ * - option id: "net.sourceforge.phpdt.core.formatter.space.castexpression"
* - possible values: { "insert", "do not insert" }
* - default: "insert"
*
* CODEASSIST / Activate Visibility Sensitive Completion
* When active, completion doesn't show that you can not see
* (for example, you can not see private methods of a super class).
- * - option id: "org.eclipse.jdt.core.codeComplete.visibilityCheck"
+ * - option id: "net.sourceforge.phpdt.core.codeComplete.visibilityCheck"
* - possible values: { "enabled", "disabled" }
* - default: "disabled"
*
* CODEASSIST / Automatic Qualification of Implicit Members
* When active, completion automatically qualifies completion on implicit
* field references and message expressions.
- * - option id: "org.eclipse.jdt.core.codeComplete.forceImplicitQualification"
+ * - option id: "net.sourceforge.phpdt.core.codeComplete.forceImplicitQualification"
* - possible values: { "enabled", "disabled" }
* - default: "disabled"
*
* CODEASSIST / Define the Prefixes for Field Name
* When the prefixes is non empty, completion for field name will begin with
* one of the proposed prefixes.
- * - option id: "org.eclipse.jdt.core.codeComplete.fieldPrefixes"
+ * - option id: "net.sourceforge.phpdt.core.codeComplete.fieldPrefixes"
* - possible values: { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card
* - default: ""
*
* CODEASSIST / Define the Prefixes for Static Field Name
* When the prefixes is non empty, completion for static field name will begin with
* one of the proposed prefixes.
- * - option id: "org.eclipse.jdt.core.codeComplete.staticFieldPrefixes"
+ * - option id: "net.sourceforge.phpdt.core.codeComplete.staticFieldPrefixes"
* - possible values: { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card
* - default: ""
*
* CODEASSIST / Define the Prefixes for Local Variable Name
* When the prefixes is non empty, completion for local variable name will begin with
* one of the proposed prefixes.
- * - option id: "org.eclipse.jdt.core.codeComplete.localPrefixes"
+ * - option id: "net.sourceforge.phpdt.core.codeComplete.localPrefixes"
* - possible values: { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card
* - default: ""
*
* CODEASSIST / Define the Prefixes for Argument Name
* When the prefixes is non empty, completion for argument name will begin with
* one of the proposed prefixes.
- * - option id: "org.eclipse.jdt.core.codeComplete.argumentPrefixes"
+ * - option id: "net.sourceforge.phpdt.core.codeComplete.argumentPrefixes"
* - possible values: { "<prefix>[,<prefix>]*" } where <prefix> is a String without any wild-card
* - default: ""
*
* CODEASSIST / Define the Suffixes for Field Name
* When the suffixes is non empty, completion for field name will end with
* one of the proposed suffixes.
- * - option id: "org.eclipse.jdt.core.codeComplete.fieldSuffixes"
+ * - option id: "net.sourceforge.phpdt.core.codeComplete.fieldSuffixes"
* - possible values: { "<suffix>[,<suffix>]*" } where <suffix> is a String without any wild-card
* - default: ""
*
* CODEASSIST / Define the Suffixes for Static Field Name
* When the suffixes is non empty, completion for static field name will end with
* one of the proposed suffixes.
- * - option id: "org.eclipse.jdt.core.codeComplete.staticFieldSuffixes"
+ * - option id: "net.sourceforge.phpdt.core.codeComplete.staticFieldSuffixes"
* - possible values: { "<suffix>[,<suffix>]*" } where <suffix> is a String without any wild-card
* - default: ""
*
* CODEASSIST / Define the Suffixes for Local Variable Name
* When the suffixes is non empty, completion for local variable name will end with
* one of the proposed suffixes.
- * - option id: "org.eclipse.jdt.core.codeComplete.localSuffixes"
+ * - option id: "net.sourceforge.phpdt.core.codeComplete.localSuffixes"
* - possible values: { "<suffix>[,<suffix>]*" } where <suffix> is a String without any wild-card
* - default: ""
*
* CODEASSIST / Define the Suffixes for Argument Name
* When the suffixes is non empty, completion for argument name will end with
* one of the proposed suffixes.
- * - option id: "org.eclipse.jdt.core.codeComplete.argumentSuffixes"
+ * - option id: "net.sourceforge.phpdt.core.codeComplete.argumentSuffixes"
* - possible values: { "<suffix>[,<suffix>]*" } where <prefix> is a String without any wild-card
* - default: ""
* </pre>
optionNames.add(COMPILER_CODEGEN_UNUSED_LOCAL);
preferences.setDefault(COMPILER_CODEGEN_TARGET_PLATFORM, VERSION_1_1);
- optionNames.add(COMPILER_CODEGEN_TARGET_PLATFORM);
+ optionNames.add(COMPILER_CODEGEN_TARGET_PLATFORM);
- preferences.setDefault(COMPILER_PB_PHP_VAR_DEPRECATED, WARNING);
+ preferences.setDefault(COMPILER_PB_PHP_VAR_DEPRECATED, IGNORE);
optionNames.add(COMPILER_PB_PHP_VAR_DEPRECATED);
preferences.setDefault(COMPILER_PB_PHP_KEYWORD, WARNING);
optionNames.add(COMPILER_PB_PHP_KEYWORD);
preferences.setDefault(COMPILER_PB_PHP_UPPERCASE_IDENTIFIER, IGNORE);
optionNames.add(COMPILER_PB_PHP_UPPERCASE_IDENTIFIER);
-
- preferences.setDefault(COMPILER_PB_UNREACHABLE_CODE, ERROR);
+ preferences.setDefault(COMPILER_PB_PHP_FILE_NOT_EXIST, WARNING);
+ optionNames.add(COMPILER_PB_PHP_FILE_NOT_EXIST);
+ preferences.setDefault(COMPILER_PB_UNREACHABLE_CODE, WARNING);
optionNames.add(COMPILER_PB_UNREACHABLE_CODE);
-
+ preferences.setDefault(COMPILER_PB_UNINITIALIZED_LOCAL_VARIABLE, WARNING);
+ optionNames.add(COMPILER_PB_UNINITIALIZED_LOCAL_VARIABLE);
+
preferences.setDefault(COMPILER_PB_INVALID_IMPORT, ERROR);
optionNames.add(COMPILER_PB_INVALID_IMPORT);
* <p>
* A container is exclusively resolved by a
* <code>ClasspathContainerInitializer</code> registered onto the
- * extension point "org.eclipse.jdt.core.classpathContainerInitializer".
+ * extension point "net.sourceforge.phpdt.core.classpathContainerInitializer".
* <p>
* A container path must be formed of at least one segment, where:
* <ul>
* <li>the first segment is a unique ID identifying the target container,
* there must be a container initializer registered onto this ID through the
- * extension point "org.eclipse.jdt.core.classpathContainerInitializer".
+ * extension point "net.sourceforge.phpdt.core.classpathContainerInitializer".
* </li>
* <li>the remaining segments will be passed onto the initializer, and can
* be used as additional hints during the initialization phase.</li>
* containerEntry = JavaCore.newContainerEntry(new
* Path("MyProvidedJDK/default"));
*
- * <extension point="org.eclipse.jdt.core.classpathContainerInitializer">
+ * <extension point="net.sourceforge.phpdt.core.classpathContainerInitializer">
* <containerInitializer id="MyProvidedJDK"
* class="com.example.MyInitializer"/>
* <p>
* <p>
* A container is exclusively resolved by a
* <code>ClasspathContainerInitializer</code> registered onto the
- * extension point "org.eclipse.jdt.core.classpathContainerInitializer".
+ * extension point "net.sourceforge.phpdt.core.classpathContainerInitializer".
* <p>
* A container path must be formed of at least one segment, where:
* <ul>
* <li>the first segment is a unique ID identifying the target container,
* there must be a container initializer registered onto this ID through the
- * extension point "org.eclipse.jdt.core.classpathContainerInitializer".
+ * extension point "net.sourceforge.phpdt.core.classpathContainerInitializer".
* </li>
* <li>the remaining segments will be passed onto the initializer, and can
* be used as additional hints during the initialization phase.</li>
* containerEntry = JavaCore.newContainerEntry(new
* Path("MyProvidedJDK/default"));
*
- * <extension point="org.eclipse.jdt.core.classpathContainerInitializer">
+ * <extension point="net.sourceforge.phpdt.core.classpathContainerInitializer">
* <containerInitializer id="MyProvidedJDK"
* class="com.example.MyInitializer"/>
* <p>
* @see JavaCore#newContainerEntry(IPath, boolean)
* @since 2.0
*/
- public static IClasspathEntry newContainerEntry(IPath containerPath,
- boolean isExported) {
-
- if (containerPath == null || containerPath.segmentCount() < 1) {
- Assert
- .isTrue(
- false,
- "Illegal classpath container path: \'" + containerPath.makeRelative().toString() + "\', must have at least one segment (containerID+hints)"); //$NON-NLS-1$//$NON-NLS-2$
- }
- return new ClasspathEntry(IPackageFragmentRoot.K_SOURCE,
- IClasspathEntry.CPE_CONTAINER, containerPath,
- ClasspathEntry.NO_EXCLUSION_PATTERNS, null, // source attachment
- null, // source attachment root
- null, // specific output folder
- isExported);
- }
+
+ public static IClasspathEntry newContainerEntry(IPath containerPath, boolean isExported) {
+
+ if (containerPath == null) Assert.isTrue(false, "Container path cannot be null"); //$NON-NLS-1$
+ if (containerPath.segmentCount() < 1) {
+ Assert.isTrue(
+ false,
+ "Illegal classpath container path: \'" + containerPath.makeRelative().toString() + "\', must have at least one segment (containerID+hints)"); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ return new ClasspathEntry(
+ IPackageFragmentRoot.K_SOURCE,
+ IClasspathEntry.CPE_CONTAINER,
+ containerPath,
+ ClasspathEntry.INCLUDE_ALL,
+ ClasspathEntry.EXCLUDE_NONE,
+ null, // source attachment
+ null, // source attachment root
+ null, // specific output folder
+ isExported);
+}
/**
* Creates and returns a new non-exported classpath entry of kind
* @since 2.0
*/
public static IClasspathEntry newProjectEntry(IPath path, boolean isExported) {
-
- if (!path.isAbsolute())
- Assert.isTrue(false, "Path for IClasspathEntry must be absolute"); //$NON-NLS-1$
-
- return new ClasspathEntry(IPackageFragmentRoot.K_SOURCE,
- IClasspathEntry.CPE_PROJECT, path,
- ClasspathEntry.NO_EXCLUSION_PATTERNS, null, // source attachment
- null, // source attachment root
- null, // specific output folder
- isExported);
- }
+
+ if (!path.isAbsolute()) Assert.isTrue(false, "Path for IClasspathEntry must be absolute"); //$NON-NLS-1$
+
+ return new ClasspathEntry(
+ IPackageFragmentRoot.K_SOURCE,
+ IClasspathEntry.CPE_PROJECT,
+ path,
+ ClasspathEntry.INCLUDE_ALL,
+ ClasspathEntry.EXCLUDE_NONE,
+ null, // source attachment
+ null, // source attachment root
+ null, // specific output folder
+ isExported);
+}
+
/**
* Returns a new empty region.
}
/**
- * Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code>
- * for the project's source folder identified by the given absolute
- * workspace-relative path. This specifies that all package fragments within
- * the root will have children of type <code>ICompilationUnit</code>.
- * <p>
- * The source folder is referred to using an absolute path relative to the
- * workspace root, e.g. <code>/Project/src</code>. A project's source
- * folders are located with that project. That is, a source classpath entry
- * specifying the path <code>/P1/src</code> is only usable for project
- * <code>P1</code>.
- * </p>
- * <p>
- * The source classpath entry created by this method includes all source
- * files below the given workspace-relative path. To selectively exclude
- * some of these source files, use the factory method
- * <code>JavaCore.newSourceEntry(IPath,IPath[])</code> instead.
- * </p>
- * <p>
- * Note that all sources/binaries inside a project are contributed as a
- * whole through a project entry (see <code>JavaCore.newProjectEntry</code>).
- * Particular source entries cannot be selectively exported.
- * </p>
- *
- * @param path
- * the absolute workspace-relative path of a source folder
- * @return a new source classpath entry with not exclusion patterns
- *
- * @see #newSourceEntry(org.eclipse.core.runtime.IPath,org.eclipse.core.runtime.IPath[])
- */
- public static IClasspathEntry newSourceEntry(IPath path) {
+ * Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code>
+ * for all files in the project's source folder identified by the given
+ * absolute workspace-relative path.
+ * <p>
+ * The convenience method is fully equivalent to:
+ * <pre>
+ * newSourceEntry(path, new IPath[] {}, new IPath[] {}, null);
+ * </pre>
+ * </p>
+ *
+ * @param path the absolute workspace-relative path of a source folder
+ * @return a new source classpath entry
+ * @see #newSourceEntry(IPath, IPath[], IPath[], IPath)
+ */
+ public static IClasspathEntry newSourceEntry(IPath path) {
- return newSourceEntry(path, ClasspathEntry.NO_EXCLUSION_PATTERNS, null /*
- * output
- * location
- */);
- }
+ return newSourceEntry(path, ClasspathEntry.INCLUDE_ALL, ClasspathEntry.EXCLUDE_NONE, null /*output location*/);
+ }
+
+ /**
+ * Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code>
+ * for the project's source folder identified by the given absolute
+ * workspace-relative path but excluding all source files with paths
+ * matching any of the given patterns.
+ * <p>
+ * The convenience method is fully equivalent to:
+ * <pre>
+ * newSourceEntry(path, new IPath[] {}, exclusionPatterns, null);
+ * </pre>
+ * </p>
+ *
+ * @param path the absolute workspace-relative path of a source folder
+ * @param exclusionPatterns the possibly empty list of exclusion patterns
+ * represented as relative paths
+ * @return a new source classpath entry
+ * @see #newSourceEntry(IPath, IPath[], IPath[], IPath)
+ * @since 2.1
+ */
+ public static IClasspathEntry newSourceEntry(IPath path, IPath[] exclusionPatterns) {
- /**
- * Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code>
- * for the project's source folder identified by the given absolute
- * workspace-relative path but excluding all source files with paths
- * matching any of the given patterns. This specifies that all package
- * fragments within the root will have children of type
- * <code>ICompilationUnit</code>.
- * <p>
- * The source folder is referred to using an absolute path relative to the
- * workspace root, e.g. <code>/Project/src</code>. A project's source
- * folders are located with that project. That is, a source classpath entry
- * specifying the path <code>/P1/src</code> is only usable for project
- * <code>P1</code>.
- * </p>
- * <p>
- * The source classpath entry created by this method includes all source
- * files below the given workspace-relative path except for those matched by
- * one (or more) of the given exclusion patterns. Each exclusion pattern is
- * represented by a relative path, which is interpreted as relative to the
- * source folder. For example, if the source folder path is
- * <code>/Project/src</code> and the exclusion pattern is
- * <code>com/xyz/tests/**</code>, then source files like
- * <code>/Project/src/com/xyz/Foo.java</code> and
- * <code>/Project/src/com/xyz/utils/Bar.java</code> would be included,
- * whereas <code>/Project/src/com/xyz/tests/T1.java</code> and
- * <code>/Project/src/com/xyz/tests/quick/T2.java</code> would be
- * excluded. Exclusion patterns can contain can contain '**', '*' or '?'
- * wildcards; see <code>IClasspathEntry.getExclusionPatterns</code> for
- * the full description of the syntax and semantics of exclusion patterns.
- * </p>
- * If the empty list of exclusion patterns is specified, the source folder
- * will automatically include all resources located inside the source
- * folder. In that case, the result is entirely equivalent to using the
- * factory method <code>JavaCore.newSourceEntry(IPath)</code>.
- * </p>
- * <p>
- * Note that all sources/binaries inside a project are contributed as a
- * whole through a project entry (see <code>JavaCore.newProjectEntry</code>).
- * Particular source entries cannot be selectively exported.
- * </p>
- *
- * @param path
- * the absolute workspace-relative path of a source folder
- * @param exclusionPatterns
- * the possibly empty list of exclusion patterns represented as
- * relative paths
- * @return a new source classpath entry with the given exclusion patterns
- * @see #newSourceEntry(org.eclipse.core.runtime.IPath)
- * @see IClasspathEntry#getExclusionPatterns
- *
- * @since 2.1
- */
- public static IClasspathEntry newSourceEntry(IPath path,
- IPath[] exclusionPatterns) {
+ return newSourceEntry(path, ClasspathEntry.INCLUDE_ALL, exclusionPatterns, null /*output location*/);
+ }
- return newSourceEntry(path, exclusionPatterns, null /* output location */);
- }
+ /**
+ * Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code>
+ * for the project's source folder identified by the given absolute
+ * workspace-relative path but excluding all source files with paths
+ * matching any of the given patterns, and associated with a specific output location
+ * (that is, ".class" files are not going to the project default output location).
+ * <p>
+ * The convenience method is fully equivalent to:
+ * <pre>
+ * newSourceEntry(path, new IPath[] {}, exclusionPatterns, specificOutputLocation);
+ * </pre>
+ * </p>
+ *
+ * @param path the absolute workspace-relative path of a source folder
+ * @param exclusionPatterns the possibly empty list of exclusion patterns
+ * represented as relative paths
+ * @param specificOutputLocation the specific output location for this source entry (<code>null</code> if using project default ouput location)
+ * @return a new source classpath entry
+ * @see #newSourceEntry(IPath, IPath[], IPath[], IPath)
+ * @since 2.1
+ */
+ public static IClasspathEntry newSourceEntry(IPath path, IPath[] exclusionPatterns, IPath specificOutputLocation) {
- /**
- * Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code>
- * for the project's source folder identified by the given absolute
- * workspace-relative path but excluding all source files with paths
- * matching any of the given patterns, and associated with a specific output
- * location (that is, ".class" files are not going to the project default
- * output location). All package fragments within the root will have
- * children of type <code>ICompilationUnit</code>.
- * <p>
- * The source folder is referred to using an absolute path relative to the
- * workspace root, e.g. <code>/Project/src</code>. A project's source
- * folders are located with that project. That is, a source classpath entry
- * specifying the path <code>/P1/src</code> is only usable for project
- * <code>P1</code>.
- * </p>
- * <p>
- * The source classpath entry created by this method includes all source
- * files below the given workspace-relative path except for those matched by
- * one (or more) of the given exclusion patterns. Each exclusion pattern is
- * represented by a relative path, which is interpreted as relative to the
- * source folder. For example, if the source folder path is
- * <code>/Project/src</code> and the exclusion pattern is
- * <code>com/xyz/tests/**</code>, then source files like
- * <code>/Project/src/com/xyz/Foo.java</code> and
- * <code>/Project/src/com/xyz/utils/Bar.java</code> would be included,
- * whereas <code>/Project/src/com/xyz/tests/T1.java</code> and
- * <code>/Project/src/com/xyz/tests/quick/T2.java</code> would be
- * excluded. Exclusion patterns can contain can contain '**', '*' or '?'
- * wildcards; see <code>IClasspathEntry.getExclusionPatterns</code> for
- * the full description of the syntax and semantics of exclusion patterns.
- * </p>
- * If the empty list of exclusion patterns is specified, the source folder
- * will automatically include all resources located inside the source
- * folder. In that case, the result is entirely equivalent to using the
- * factory method <code>JavaCore.newSourceEntry(IPath)</code>.
- * </p>
- * <p>
- * Additionally, a source entry can be associated with a specific output
- * location. By doing so, the Java builder will ensure that the generated
- * ".class" files will be issued inside this output location, as opposed to
- * be generated into the project default output location (when output
- * location is <code>null</code>). Note that multiple source entries may
- * target the same output location. The output location is referred to using
- * an absolute path relative to the workspace root, e.g.
- * <code>"/Project/bin"</code>, it must be located inside the same
- * project as the source folder.
- * </p>
- * <p>
- * Also note that all sources/binaries inside a project are contributed as a
- * whole through a project entry (see <code>JavaCore.newProjectEntry</code>).
- * Particular source entries cannot be selectively exported.
- * </p>
- *
- * @param path
- * the absolute workspace-relative path of a source folder
- * @param exclusionPatterns
- * the possibly empty list of exclusion patterns represented as
- * relative paths
- * @param outputLocation
- * the specific output location for this source entry (
- * <code>null</code> if using project default ouput location)
- * @return a new source classpath entry with the given exclusion patterns
- * @see #newSourceEntry(org.eclipse.core.runtime.IPath)
- * @see IClasspathEntry#getExclusionPatterns
- * @see IClasspathEntry#getOutputLocation()
- *
- * @since 2.1
- */
- public static IClasspathEntry newSourceEntry(IPath path,
- IPath[] exclusionPatterns, IPath specificOutputLocation) {
-
- if (!path.isAbsolute())
- Assert.isTrue(false, "Path for IClasspathEntry must be absolute"); //$NON-NLS-1$
- if (exclusionPatterns == null)
- Assert.isTrue(false, "Exclusion pattern set cannot be null"); //$NON-NLS-1$
-
- return new ClasspathEntry(IPackageFragmentRoot.K_SOURCE,
- IClasspathEntry.CPE_SOURCE, path, exclusionPatterns, null, // source
- // attachment
- null, // source attachment root
- specificOutputLocation, // custom output location
- false);
- }
+ return newSourceEntry(path, ClasspathEntry.INCLUDE_ALL, exclusionPatterns, specificOutputLocation);
+ }
+
+ /**
+ * Creates and returns a new classpath entry of kind <code>CPE_SOURCE</code>
+ * for the project's source folder identified by the given absolute
+ * workspace-relative path using the given inclusion and exclusion patterns
+ * to determine which source files are included, and the given output path
+ * to control the output location of generated files.
+ * <p>
+ * The source folder is referred to using an absolute path relative to the
+ * workspace root, e.g. <code>/Project/src</code>. A project's source
+ * folders are located with that project. That is, a source classpath
+ * entry specifying the path <code>/P1/src</code> is only usable for
+ * project <code>P1</code>.
+ * </p>
+ * <p>
+ * The inclusion patterns determines the initial set of source files that
+ * are to be included; the exclusion patterns are then used to reduce this
+ * set. When no inclusion patterns are specified, the initial file set
+ * includes all relevent files in the resource tree rooted at the source
+ * entry's path. On the other hand, specifying one or more inclusion
+ * patterns means that all <b>and only</b> files matching at least one of
+ * the specified patterns are to be included. If exclusion patterns are
+ * specified, the initial set of files is then reduced by eliminating files
+ * matched by at least one of the exclusion patterns. Inclusion and
+ * exclusion patterns look like relative file paths with wildcards and are
+ * interpreted relative to the source entry's path. File patterns are
+ * case-sensitive can contain '**', '*' or '?' wildcards (see
+ * {@link IClasspathEntry#getExclusionPatterns()} for the full description
+ * of their syntax and semantics). The resulting set of files are included
+ * in the corresponding package fragment root; all package fragments within
+ * the root will have children of type <code>ICompilationUnit</code>.
+ * </p>
+ * <p>
+ * For example, if the source folder path is
+ * <code>/Project/src</code>, there are no inclusion filters, and the
+ * exclusion pattern is
+ * <code>com/xyz/tests/**</code>, then source files
+ * like <code>/Project/src/com/xyz/Foo.java</code>
+ * and <code>/Project/src/com/xyz/utils/Bar.java</code> would be included,
+ * whereas <code>/Project/src/com/xyz/tests/T1.java</code>
+ * and <code>/Project/src/com/xyz/tests/quick/T2.java</code> would be
+ * excluded.
+ * </p>
+ * <p>
+ * Additionally, a source entry can be associated with a specific output location.
+ * By doing so, the Java builder will ensure that the generated ".class" files will
+ * be issued inside this output location, as opposed to be generated into the
+ * project default output location (when output location is <code>null</code>).
+ * Note that multiple source entries may target the same output location.
+ * The output location is referred to using an absolute path relative to the
+ * workspace root, e.g. <code>"/Project/bin"</code>, it must be located inside
+ * the same project as the source folder.
+ * </p>
+ * <p>
+ * Also note that all sources/binaries inside a project are contributed as
+ * a whole through a project entry
+ * (see <code>JavaCore.newProjectEntry</code>). Particular source entries
+ * cannot be selectively exported.
+ * </p>
+ *
+ * @param path the absolute workspace-relative path of a source folder
+ * @param inclusionPatterns the possibly empty list of inclusion patterns
+ * represented as relative paths
+ * @param exclusionPatterns the possibly empty list of exclusion patterns
+ * represented as relative paths
+ * @param specificOutputLocation the specific output location for this source entry (<code>null</code> if using project default ouput location)
+ * @return a new source classpath entry with the given exclusion patterns
+ * @see IClasspathEntry#getInclusionPatterns()
+ * @see IClasspathEntry#getExclusionPatterns()
+ * @see IClasspathEntry#getOutputLocation()
+ * @since 3.0
+ */
+ public static IClasspathEntry newSourceEntry(IPath path, IPath[] inclusionPatterns, IPath[] exclusionPatterns, IPath specificOutputLocation) {
+
+ if (path == null) Assert.isTrue(false, "Source path cannot be null"); //$NON-NLS-1$
+ if (!path.isAbsolute()) Assert.isTrue(false, "Path for IClasspathEntry must be absolute"); //$NON-NLS-1$
+ if (exclusionPatterns == null) Assert.isTrue(false, "Exclusion pattern set cannot be null"); //$NON-NLS-1$
+ if (inclusionPatterns == null) Assert.isTrue(false, "Inclusion pattern set cannot be null"); //$NON-NLS-1$
+
+ return new ClasspathEntry(
+ IPackageFragmentRoot.K_SOURCE,
+ IClasspathEntry.CPE_SOURCE,
+ path,
+ inclusionPatterns,
+ exclusionPatterns,
+ null, // source attachment
+ null, // source attachment root
+ specificOutputLocation, // custom output location
+ false);
+ }
/**
* Creates and returns a new non-exported classpath entry of kind
* It is possible to register an automatic initializer (
* <code>ClasspathVariableInitializer</code>), which will be invoked
* through the extension point
- * "org.eclipse.jdt.core.classpathVariableInitializer". After resolution, a
+ * "net.sourceforge.phpdt.core.classpathVariableInitializer". After resolution, a
* classpath variable entry may either correspond to a project or a library
* entry.</li>
* <p>
* It is possible to register an automatic initializer (
* <code>ClasspathVariableInitializer</code>), which will be invoked
* through the extension point
- * "org.eclipse.jdt.core.classpathVariableInitializer". After resolution, a
+ * "net.sourceforge.phpdt.core.classpathVariableInitializer". After resolution, a
* classpath variable entry may either correspond to a project or a library
* entry.</li>
* <p>
* formed by a first ID segment followed with extra segments, which can be
* used as additional hints for the resolution. The container ID is used to
* identify a <code>ClasspathContainerInitializer</code> registered on the
- * extension point "org.eclipse.jdt.core.classpathContainerInitializer".
+ * extension point "net.sourceforge.phpdt.core.classpathContainerInitializer".
* <p>
* There is no assumption that each individual container value passed in
* argument (<code>respectiveContainers</code>) must answer the exact
* actual container object. It can be delegated to a
* <code>ClasspathContainerInitializer</code>, which can be activated
* through the extension point
- * "org.eclipse.jdt.core.ClasspathContainerInitializer").
+ * "net.sourceforge.phpdt.core.ClasspathContainerInitializer").
* <p>
* In reaction to changing container values, the JavaModel will be updated
* to reflect the new state of the updated container.
* are not preserved from a session to another. It is thus highly
* recommended to register a <code>ClasspathContainerInitializer</code>
* for each referenced container (through the extension point
- * "org.eclipse.jdt.core.ClasspathContainerInitializer").
+ * "net.sourceforge.phpdt.core.ClasspathContainerInitializer").
* <p>
* Note: setting a container to <code>null</code> will cause it to be
* lazily resolved again whenever its value is required. In particular, this