From 60e257f166ce9f63760b596a52a4e98b102c22ba Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Mon, 9 Jul 2007 14:38:53 +0000 Subject: [PATCH] Send additional indexer notification after a project's pdom was initialized. --- .../cdt/internal/core/pdom/PDOMManager.java | 4 ++ .../pdom/indexer/TriggerNotificationTask.java | 41 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/TriggerNotificationTask.java diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java index db0f876e1f4..9613e9381b3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java @@ -65,6 +65,7 @@ import org.eclipse.cdt.internal.core.pdom.indexer.DeltaAnalyzer; import org.eclipse.cdt.internal.core.pdom.indexer.IndexerPreferences; import org.eclipse.cdt.internal.core.pdom.indexer.PDOMRebuildTask; import org.eclipse.cdt.internal.core.pdom.indexer.PDOMUpdateTask; +import org.eclipse.cdt.internal.core.pdom.indexer.TriggerNotificationTask; import org.eclipse.cdt.internal.core.pdom.indexer.nulli.PDOMNullIndexer; import org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager; import org.eclipse.core.resources.IFolder; @@ -504,6 +505,9 @@ public class PDOMManager implements IWritableIndexManager, IListener { if (task != null) { enqueue(task); } + else { + enqueue(new TriggerNotificationTask(this, pdom)); + } return; } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/TriggerNotificationTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/TriggerNotificationTask.java new file mode 100644 index 00000000000..d7b7d9eb101 --- /dev/null +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/TriggerNotificationTask.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2007 Wind River Systems, Inc. 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: + * Markus Schorn - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.internal.core.pdom.indexer; + +import org.eclipse.cdt.core.dom.IPDOMIndexer; +import org.eclipse.cdt.core.dom.IPDOMIndexerTask; +import org.eclipse.cdt.internal.core.pdom.IndexerProgress; +import org.eclipse.cdt.internal.core.pdom.PDOMManager; +import org.eclipse.cdt.internal.core.pdom.WritablePDOM; +import org.eclipse.core.runtime.IProgressMonitor; + +public class TriggerNotificationTask implements IPDOMIndexerTask { + + private WritablePDOM fPDOM; + private PDOMManager fManager; + + public TriggerNotificationTask(PDOMManager manager, WritablePDOM pdom) { + fManager= manager; + fPDOM= pdom; + } + + public IPDOMIndexer getIndexer() { + return null; + } + + public IndexerProgress getProgressInformation() { + return new IndexerProgress(); + } + + public void run(IProgressMonitor monitor) { + fManager.handleChange(fPDOM); + } +}