Added: small label to make an effect of RemoteSourcePath clear
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / PHPeclipsePlugin.java
index 69da86c..b17fb81 100644 (file)
@@ -68,6 +68,7 @@ import org.eclipse.core.resources.ISavedState;
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.IWorkspaceRunnable;
 import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IAdapterManager;
 import org.eclipse.core.runtime.IConfigurationElement;
@@ -829,7 +830,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements
                JavaCore.initializeDefaultPluginPreferences();
                PreferenceConstants.initializeDefaultValues(store);
                // externalTools.initializeDefaultPreferences(store);
-               MarkerAnnotationPreferences.initializeDefaultValues(store);
+               // MarkerAnnotationPreferences.initializeDefaultValues(store);
        }
 
        private IWorkbenchPage internalGetActivePage() {
@@ -1119,32 +1120,48 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements
                        // 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")) { //$NON-NLS-1$
-                               protected IStatus run(IProgressMonitor monitor) {
-                                       try {
-                                               // add save participant and process delta atomically
-                                               // see
-                                               // https://bugs.eclipse.org/bugs/show_bug.cgi?id=59937
-                                               workspace.run(new IWorkspaceRunnable() {
-                                                       public void run(IProgressMonitor progress)
-                                                                       throws CoreException {
-                                                               ISavedState savedState = workspace
-                                                                               .addSaveParticipant(
-                                                                                               PHPeclipsePlugin.this,
-                                                                                               modelManager);
-                                                               if (savedState != null) {
-                                                                       // the event type coming from the saved
-                                                                       // state is always POST_AUTO_BUILD
-                                                                       // force it to be POST_CHANGE so that the
-                                                                       // delta processor can handle it
-                                                                       modelManager.deltaState.getDeltaProcessor().overridenEventType = IResourceChangeEvent.POST_CHANGE;
-                                                                       savedState
-                                                                                       .processResourceChangeEvents(modelManager.deltaState);
-                                                               }
-                                                       }
-                                               }, monitor);
-                                       } catch (CoreException e) {
-                                               return e.getStatus();
+// This causes timeout at EclipseLazyStarter
+//                     Job processSavedState = new Job(Util.bind("savedState.jobName")) { //$NON-NLS-1$
+//                             protected IStatus run(IProgressMonitor monitor) {
+//                                     try {
+//                                             // add save participant and process delta atomically
+//                                             // see
+//                                             // https://bugs.eclipse.org/bugs/show_bug.cgi?id=59937
+//                                             workspace.run(new IWorkspaceRunnable() {
+//                                                     public void run(IProgressMonitor progress)
+//                                                                     throws CoreException {
+//                                                             ISavedState savedState = workspace
+//                                                                             .addSaveParticipant(
+//                                                                                             PHPeclipsePlugin.this,
+//                                                                                             modelManager);
+//                                                             if (savedState != null) {
+//                                                                     // the event type coming from the saved
+//                                                                     // state is always POST_AUTO_BUILD
+//                                                                     // force it to be POST_CHANGE so that the
+//                                                                     // delta processor can handle it
+//                                                                     modelManager.deltaState.getDeltaProcessor().overridenEventType = IResourceChangeEvent.POST_CHANGE;
+//                                                                     savedState
+//                                                                                     .processResourceChangeEvents(modelManager.deltaState);
+//                                                             }
+//                                                     }
+//                                             }, monitor);
+//                                     } catch (CoreException e) {
+//                                             return e.getStatus();
+//                                     }
+//                                     return Status.OK_STATUS;
+//                             }
+//                     };
+// Replace Job + IWorkspace.run() to WorkspaceJob
+                       WorkspaceJob processSavedState = new WorkspaceJob(
+                                       Util.bind("savedState.jobName")) { //$NON-NLS-1$
+                               public IStatus runInWorkspace(IProgressMonitor monitor)
+                                               throws CoreException {
+                                       ISavedState savedState = workspace.addSaveParticipant(
+                                                       PHPeclipsePlugin.this, modelManager);
+                                       if (savedState != null) {
+                                               modelManager.deltaState.getDeltaProcessor().overridenEventType
+                                                               = IResourceChangeEvent.POST_CHANGE;
+                                               savedState.processResourceChangeEvents(modelManager.deltaState);
                                        }
                                        return Status.OK_STATUS;
                                }