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 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.ISavedState;
-import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IResourceChangeListener;
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 = CompilerOptions.OPTION_PHPBadStyleKeywordWarning; //$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$
+
/**
* Possible configurable option ID.
*
}
/**
+ * Adds the given listener for POST_CHANGE resource change events to the Java core.
+ * The listener is guarantied 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
+ */
+ public static void addPreProcessingResourceChangedListener(IResourceChangeListener listener) {
+ JavaModelManager.getJavaModelManager().deltaState.addPreResourceChangedListener(listener);
+ }
+ /**
* Configures the given marker for the given Java element. Used for markers,
* which denote a Java element rather than a resource.
*
// causing some grief
// Platform.run(new ISafeRunnable() {
// public void handleException(Throwable exception) {
- // Util.log(exception, "Exception occurred in classpath container
+ // ProjectPrefUtil.log(exception, "Exception occurred in classpath container
// initializer: "+initializer); //$NON-NLS-1$
// }
// public void run() throws Exception {
// be causing some grief
// Platform.run(new ISafeRunnable() {
// public void handleException(Throwable exception) {
- // Util.log(exception, "Exception occurred in classpath variable
+ // ProjectPrefUtil.log(exception, "Exception occurred in classpath variable
// initializer: "+initializer+" while initializing variable:
// "+variableName); //$NON-NLS-1$ //$NON-NLS-2$
// }
.isExported());
case IResource.FILE:
- // if (Util.isArchiveFileName(resolvedResource.getName())) {
+ // if (ProjectPrefUtil.isArchiveFileName(resolvedResource.getName())) {
// // internal binary archive
// return JavaCore.newLibraryEntry(
// resolvedPath,
preferences.setDefault(COMPILER_PB_PHP_VAR_DEPRECATED, WARNING);
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_PHP_FILE_NOT_EXIST, WARNING);
+ optionNames.add(COMPILER_PB_PHP_FILE_NOT_EXIST);
+
preferences.setDefault(COMPILER_PB_UNREACHABLE_CODE, ERROR);
optionNames.add(COMPILER_PB_UNREACHABLE_CODE);
// if (JavaModelManager.CP_RESOLVE_VERBOSE){
// System.out.println("CPContainer SET - setting container:
// ["+containerPath+"] for projects: {" //$NON-NLS-1$ //$NON-NLS-2$
- // + (Util.toString(affectedProjects,
- // new Util.Displayable(){
+ // + (ProjectPrefUtil.toString(affectedProjects,
+ // new ProjectPrefUtil.Displayable(){
// public String displayString(Object o) { return ((IJavaProject)
// o).getElementName(); }
// }))
// + "} with values: " //$NON-NLS-1$
- // + (Util.toString(respectiveContainers,
- // new Util.Displayable(){
+ // + (ProjectPrefUtil.toString(respectiveContainers,
+ // new ProjectPrefUtil.Displayable(){
// public String displayString(Object o) { return ((IClasspathContainer)
// o).getDescription(); }
// }))
//
// if (JavaModelManager.CP_RESOLVE_VERBOSE){
// System.out.println("CPVariable SET - setting variables: {" +
- // Util.toString(variableNames) //$NON-NLS-1$
- // + "} with values: " + Util.toString(variablePaths)); //$NON-NLS-1$
+ // ProjectPrefUtil.toString(variableNames) //$NON-NLS-1$
+ // + "} with values: " + ProjectPrefUtil.toString(variablePaths)); //$NON-NLS-1$
// }
//
// int varLength = variableNames.length;
// if (JavaModelManager.CP_RESOLVE_VERBOSE){
// System.out.println("CPVariable SET - updating affected project:
// ["+project.getElementName()+"] due to setting variables: "+
- // Util.toString(dbgVariableNames)); //$NON-NLS-1$ //$NON-NLS-2$
+ // ProjectPrefUtil.toString(dbgVariableNames)); //$NON-NLS-1$ //$NON-NLS-2$
// }
//
// project
// } catch (CoreException e) {
// if (JavaModelManager.CP_RESOLVE_VERBOSE){
// System.out.println("CPVariable SET - FAILED DUE TO EXCEPTION:
- // "+Util.toString(dbgVariableNames)); //$NON-NLS-1$
+ // "+ProjectPrefUtil.toString(dbgVariableNames)); //$NON-NLS-1$
// e.printStackTrace();
// }
// if (e instanceof JavaModelException) {
// // process deltas since last activated in indexer thread so that indexes
// are up-to-date.
// // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=38658
- // Job processSavedState = new Job(Util.bind("savedState.jobName")) {
+ // Job processSavedState = new Job(ProjectPrefUtil.bind("savedState.jobName")) {
// //$NON-NLS-1$
// protected IStatus run(IProgressMonitor monitor) {
// try {