Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 4979d85d225c0fc5f38cf67975cfade87f870021 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*******************************************************************************
 * Copyright (c) 2008 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.core.index;

import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.internal.core.CCoreInternals;

/**
 * Abstract base class for indexer setup participants. A participant can delay the
 * setup of the indexer when a project is added to the workspace. 
 */
public abstract class IndexerSetupParticipant {
	
	/**
	 * The method will be called before an indexer is set up for a project. If you
	 * return <code>true</code> the setup will be postponed. You need to call 
	 * {@link #notifyIndexerSetup(ICProject)} as soon as this participant no longer
	 * needs to block the indexer setup.
	 * <p>
	 * This method may be called multiple times for the same project.
	 * @param project the project for which the indexer is supposed to be initialized.
	 * @return whether or not to proceed with the indexer setup.
	 */
	public abstract boolean postponeIndexerSetup(ICProject project);

	/**
	 * Informs the index manager that this participant no longer needs to postpone the
	 * indexer setup for the given project. Depending on the state of other participants
	 * this may trigger the indexer setup.
	 * @param project the project for which the setup no longer needs to be postponed
	 */
	public void notifyIndexerSetup(ICProject project) {
		CCoreInternals.getPDOMManager().notifyIndexerSetup(this, project);
	}
}

Back to the top