~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/CConfigurationDataProvider.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
7
 *
 
8
 * Contributors:
 
9
 * Intel Corporation - Initial API and implementation
 
10
 *******************************************************************************/
 
11
package org.eclipse.cdt.core.settings.model.extension;
 
12
 
 
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;
 
17
 
 
18
/**
 
19
 * the class is to be implemented by the Configuration data provider contributed via
 
20
 * a org.eclipse.cdt.core.CConfigurationDataProvider extension point 
 
21
 *
 
22
 */
 
23
public abstract class CConfigurationDataProvider {
 
24
        /**
 
25
         * requests the Configuration Data to be loadded for the given ConfigurationDescription
 
26
         */
 
27
        public abstract CConfigurationData loadConfiguration(ICConfigurationDescription des, IProgressMonitor monitor) throws CoreException;
 
28
 
 
29
        /**
 
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
 
35
 
 
36
         * @param des
 
37
         * @param baseDescription
 
38
         * @param baseData
 
39
         * @param clone true indicates that the configuration copy (clone) is being created for 
 
40
         * the copy description.
 
41
         * @param monitor
 
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
 
45
         */
 
46
        public abstract CConfigurationData createConfiguration(ICConfigurationDescription des, 
 
47
                        ICConfigurationDescription baseDescription,
 
48
                        CConfigurationData baseData, boolean clone,
 
49
                        IProgressMonitor monitor) throws CoreException;
 
50
        
 
51
        /**
 
52
         * called to notify the provider that the configuration is removed
 
53
         */
 
54
        public abstract void removeConfiguration(ICConfigurationDescription des, CConfigurationData data, IProgressMonitor monitor);
 
55
 
 
56
        /**
 
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)}
 
60
         * for detail
 
61
         * 
 
62
         * @throws CoreException
 
63
         */
 
64
        public CConfigurationData applyConfiguration(ICConfigurationDescription des, 
 
65
                        ICConfigurationDescription baseDescription,
 
66
                        CConfigurationData baseData,
 
67
                        IProgressMonitor monitor) throws CoreException{
 
68
                return baseData;
 
69
        }
 
70
 
 
71
        /**
 
72
         * called during the setProjectDescription operation to notify the provider that the configuration data
 
73
         * is being applied.
 
74
         * Provider would typically store all the necessary data configuration during this call.
 
75
         * 
 
76
         * @param des
 
77
         * @param baseDescription
 
78
         * @param baseData
 
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
 
86
         * @param monitor
 
87
         * 
 
88
         * @throws CoreException
 
89
         */
 
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);
 
96
        }
 
97
 
 
98
        /**
 
99
         * called to notify that the configuration data was cached
 
100
         * implementors can do any necessary cleaning, etc.
 
101
         * Default implementation is empty
 
102
         */
 
103
        public void dataCached(ICConfigurationDescription cfgDes, CConfigurationData data, IProgressMonitor monitor){
 
104
        }
 
105
}