1
/*******************************************************************************
2
* Copyright (c) 2007, 2010 Intel Corporation and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* Intel Corporation - Initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.cdt.core.settings.model.extension;
13
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
14
import org.eclipse.cdt.core.settings.model.IModificationContext;
15
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.core.runtime.IProgressMonitor;
19
* the class is to be implemented by the Configuration data provider contributed via
20
* a org.eclipse.cdt.core.CConfigurationDataProvider extension point
23
public abstract class CConfigurationDataProvider {
25
* requests the Configuration Data to be loadded for the given ConfigurationDescription
27
public abstract CConfigurationData loadConfiguration(ICConfigurationDescription des, IProgressMonitor monitor) throws CoreException;
30
* requests the Configuration Data to be created for the given ConfigurationDescription
31
* The method can be called in several cases:
32
* 1. When the new configuration is being created based upon the already existing one via
33
* theICProjectDescription.createConfiguration method call
34
* 2. When the configuration copy (clone) is being created for the copy description
37
* @param baseDescription
39
* @param clone true indicates that the configuration copy (clone) is being created for
40
* the copy description.
42
* @return {@code false} indicates that the new configuration is being created based upon the already existing one via
43
* theICProjectDescription.createConfiguration method call, {@code true} otherwise
44
* @throws CoreException
46
public abstract CConfigurationData createConfiguration(ICConfigurationDescription des,
47
ICConfigurationDescription baseDescription,
48
CConfigurationData baseData, boolean clone,
49
IProgressMonitor monitor) throws CoreException;
52
* called to notify the provider that the configuration is removed
54
public abstract void removeConfiguration(ICConfigurationDescription des, CConfigurationData data, IProgressMonitor monitor);
57
* the method is called in case the implementer does NOT override
58
* the {@link #applyConfiguration(ICConfigurationDescription, ICConfigurationDescription, CConfigurationData, IModificationContext, IProgressMonitor)}
59
* method. See {@link #applyConfiguration(ICConfigurationDescription, ICConfigurationDescription, CConfigurationData, IModificationContext, IProgressMonitor)}
62
* @throws CoreException
64
public CConfigurationData applyConfiguration(ICConfigurationDescription des,
65
ICConfigurationDescription baseDescription,
66
CConfigurationData baseData,
67
IProgressMonitor monitor) throws CoreException{
72
* called during the setProjectDescription operation to notify the provider that the configuration data
74
* Provider would typically store all the necessary data configuration during this call.
77
* @param baseDescription
79
* @param context the {@link IModificationContext} allows registering workspace runnables to be run
80
* as a single batch workspace operation.
81
* If possible the runnables will be run directly in the apply context(thread) after all
82
* configuration datas get applied. Otherwise runnables will be run as a separate job.
83
* This allows to perform all workspace modifications registered by different configurations
84
* to be run as a single batch peration together with the workspace modifications performed by the
85
* ICProjectDesacription framework
88
* @throws CoreException
90
public CConfigurationData applyConfiguration(ICConfigurationDescription des,
91
ICConfigurationDescription baseDescription,
92
CConfigurationData baseData,
93
IModificationContext context,
94
IProgressMonitor monitor) throws CoreException{
95
return applyConfiguration(des, baseDescription, baseData, monitor);
99
* called to notify that the configuration data was cached
100
* implementors can do any necessary cleaning, etc.
101
* Default implementation is empty
103
public void dataCached(ICConfigurationDescription cfgDes, CConfigurationData data, IProgressMonitor monitor){