| Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartModelManager.java
|
| diff --git a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartModelManager.java b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartModelManager.java
|
| index b748481e2c84daf1517c2acb1ff6476c03212621..6109b1cdc8123e2fb2aecc96e9e59bb7bea58e7b 100644
|
| --- a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartModelManager.java
|
| +++ b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartModelManager.java
|
| @@ -28,7 +28,7 @@ import com.google.dart.tools.core.formatter.DefaultCodeFormatterConstants;
|
| import com.google.dart.tools.core.generator.DartProjectGenerator;
|
| import com.google.dart.tools.core.internal.model.delta.DartElementDeltaBuilder;
|
| import com.google.dart.tools.core.internal.model.delta.DeltaProcessingState;
|
| -import com.google.dart.tools.core.internal.model.delta.DeltaProcessor;
|
| +import com.google.dart.tools.core.internal.model.delta.IDeltaProcessor;
|
| import com.google.dart.tools.core.internal.model.info.DartElementInfo;
|
| import com.google.dart.tools.core.internal.model.info.DartProjectInfo;
|
| import com.google.dart.tools.core.internal.util.Extensions;
|
| @@ -55,8 +55,6 @@ import org.eclipse.core.resources.IFile;
|
| import org.eclipse.core.resources.IFolder;
|
| import org.eclipse.core.resources.IProject;
|
| import org.eclipse.core.resources.IResource;
|
| -import org.eclipse.core.resources.IResourceChangeEvent;
|
| -import org.eclipse.core.resources.IWorkspace;
|
| import org.eclipse.core.resources.IWorkspaceRoot;
|
| import org.eclipse.core.resources.ResourcesPlugin;
|
| import org.eclipse.core.runtime.CoreException;
|
| @@ -278,7 +276,7 @@ public class DartModelManager {
|
| /**
|
| * Holds the state used for delta processing.
|
| */
|
| - private DeltaProcessingState deltaState = new DeltaProcessingState();
|
| + private DeltaProcessingState deltaState;
|
|
|
| private HashSet<String> optionNames = new HashSet<String>(20);
|
|
|
| @@ -650,7 +648,7 @@ public class DartModelManager {
|
| return preferencesLookup[PREF_DEFAULT];
|
| }
|
|
|
| - public DeltaProcessor getDeltaProcessor() {
|
| + public IDeltaProcessor getDeltaProcessor() {
|
| return deltaState.getDeltaProcessor();
|
| }
|
|
|
| @@ -1051,6 +1049,17 @@ public class DartModelManager {
|
| }
|
|
|
| /**
|
| + * Block until the delta processor has processed all outstanding changes in the queue, or until
|
| + * timeoutMillis has been reached.
|
| + *
|
| + * @param timeoutMillis the maximum number of milliseconds to wait
|
| + * @throws InterruptedException
|
| + */
|
| + public void processAllDeltaChanges(long timeoutMillis) throws InterruptedException {
|
| + deltaState.processAllChanges(timeoutMillis);
|
| + }
|
| +
|
| + /**
|
| * Remove the given listener from the list of objects that are listening for changes to Dart
|
| * elements. Has no affect if an identical listener is not registered.
|
| *
|
| @@ -1719,10 +1728,10 @@ public class DartModelManager {
|
| } catch (BackingStoreException e) {
|
| DartCore.logError("Could not save DartCore preferences", e); //$NON-NLS-1$
|
| }
|
| - IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
| - workspace.removeResourceChangeListener(deltaState);
|
|
|
| - workspace.removeSaveParticipant(DartCore.PLUGIN_ID);
|
| + deltaState.dispose();
|
| +
|
| + ResourcesPlugin.getWorkspace().removeSaveParticipant(DartCore.PLUGIN_ID);
|
|
|
| // // Stop listening to content-type changes
|
| // Platform.getContentTypeManager().removeContentTypeChangeListener(this);
|
| @@ -1799,19 +1808,7 @@ public class DartModelManager {
|
|
|
| // listen for resource changes
|
| // deltaState.initializeRootsWithPreviousSession();
|
| - final IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
| - workspace.addResourceChangeListener(deltaState,
|
| - /*
|
| - * update spec in DartCore#addPreProcessingResourceChangedListener(...) if adding more event
|
| - * types
|
| - */
|
| -// IResourceChangeEvent.PRE_BUILD
|
| -// | IResourceChangeEvent.POST_BUILD
|
| -// |
|
| - IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_DELETE
|
| - | IResourceChangeEvent.PRE_CLOSE
|
| -// | IResourceChangeEvent.PRE_REFRESH
|
| - );
|
| + deltaState = new DeltaProcessingState();
|
|
|
| ResourceUtil.startup();
|
| DartCore.notYetImplemented();
|
|
|