mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 18:55:38 +02:00
Fix for 186755 activation of CorePlugin
This commit is contained in:
parent
dd026998ce
commit
0bbd5519cf
5 changed files with 50 additions and 29 deletions
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Intel Corporation - Initial API and implementation
|
* Intel Corporation - Initial API and implementation
|
||||||
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.settings.model;
|
package org.eclipse.cdt.internal.core.settings.model;
|
||||||
|
|
||||||
|
@ -276,7 +277,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
|
||||||
private static CProjectDescriptionManager fInstance;
|
private static CProjectDescriptionManager fInstance;
|
||||||
|
|
||||||
private CProjectDescriptionManager(){
|
private CProjectDescriptionManager(){
|
||||||
|
fDescriptorManager= CConfigBasedDescriptorManager.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CProjectDescriptionManager getInstance(){
|
public static CProjectDescriptionManager getInstance(){
|
||||||
|
@ -296,10 +297,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
|
||||||
| IResourceChangeEvent.PRE_CLOSE
|
| IResourceChangeEvent.PRE_CLOSE
|
||||||
/*| IResourceChangeEvent.POST_BUILD*/);
|
/*| IResourceChangeEvent.POST_BUILD*/);
|
||||||
|
|
||||||
if(fDescriptorManager == null){
|
|
||||||
fDescriptorManager = CConfigBasedDescriptorManager.getInstance();
|
|
||||||
fDescriptorManager.startup();
|
fDescriptorManager.startup();
|
||||||
}
|
|
||||||
|
|
||||||
CExternalSettingsManager.getInstance().startup();
|
CExternalSettingsManager.getInstance().startup();
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Ferguson (Symbian) - Initial implementation
|
* Andrew Ferguson (Symbian) - Initial implementation
|
||||||
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.index.provider;
|
package org.eclipse.cdt.internal.core.index.provider;
|
||||||
|
|
||||||
|
@ -50,6 +51,9 @@ public final class IndexProviderManager implements IElementChangedListener {
|
||||||
private Map provisionMap= new HashMap();
|
private Map provisionMap= new HashMap();
|
||||||
|
|
||||||
public IndexProviderManager() {
|
public IndexProviderManager() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startup() {
|
||||||
List providers = new ArrayList();
|
List providers = new ArrayList();
|
||||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||||
IExtensionPoint indexProviders = registry.getExtensionPoint(CCorePlugin.INDEX_UNIQ_ID);
|
IExtensionPoint indexProviders = registry.getExtensionPoint(CCorePlugin.INDEX_UNIQ_ID);
|
||||||
|
|
|
@ -176,6 +176,8 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
// that new projects are being created
|
// that new projects are being created
|
||||||
initializeDatabaseCache();
|
initializeDatabaseCache();
|
||||||
|
|
||||||
|
fIndexProviderManager.startup();
|
||||||
|
|
||||||
final CoreModel model = CoreModel.getDefault();
|
final CoreModel model = CoreModel.getDefault();
|
||||||
ResourcesPlugin.getWorkspace().addResourceChangeListener(fCModelListener, IResourceChangeEvent.POST_BUILD);
|
ResourcesPlugin.getWorkspace().addResourceChangeListener(fCModelListener, IResourceChangeEvent.POST_BUILD);
|
||||||
model.addElementChangedListener(fCModelListener);
|
model.addElementChangedListener(fCModelListener);
|
||||||
|
@ -897,6 +899,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
|
CCorePlugin.getDefault().joinStartup(monitor);
|
||||||
Job.getJobManager().join(this, monitor);
|
Job.getJobManager().join(this, monitor);
|
||||||
return true;
|
return true;
|
||||||
} catch (OperationCanceledException e1) {
|
} catch (OperationCanceledException e1) {
|
||||||
|
|
|
@ -41,7 +41,6 @@ import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||||
import org.eclipse.cdt.core.settings.model.WriteAccessException;
|
import org.eclipse.cdt.core.settings.model.WriteAccessException;
|
||||||
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
|
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
|
||||||
import org.eclipse.cdt.internal.core.CConfigBasedDescriptorManager;
|
|
||||||
import org.eclipse.cdt.internal.core.CContentTypes;
|
import org.eclipse.cdt.internal.core.CContentTypes;
|
||||||
import org.eclipse.cdt.internal.core.CDTLogWriter;
|
import org.eclipse.cdt.internal.core.CDTLogWriter;
|
||||||
import org.eclipse.cdt.internal.core.CdtVarPathEntryVariableManager;
|
import org.eclipse.cdt.internal.core.CdtVarPathEntryVariableManager;
|
||||||
|
@ -76,6 +75,7 @@ import org.eclipse.core.runtime.Preferences;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||||
import org.eclipse.core.runtime.content.IContentType;
|
import org.eclipse.core.runtime.content.IContentType;
|
||||||
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
import org.osgi.framework.BundleContext;
|
import org.osgi.framework.BundleContext;
|
||||||
|
|
||||||
public class CCorePlugin extends Plugin {
|
public class CCorePlugin extends Plugin {
|
||||||
|
@ -191,9 +191,7 @@ public class CCorePlugin extends Plugin {
|
||||||
private static CCorePlugin fgCPlugin;
|
private static CCorePlugin fgCPlugin;
|
||||||
private static ResourceBundle fgResourceBundle;
|
private static ResourceBundle fgResourceBundle;
|
||||||
|
|
||||||
private CConfigBasedDescriptorManager/*CDescriptorManager*/ fDescriptorManager;// = new CDescriptorManager();
|
private CProjectDescriptionManager fNewCProjectDescriptionManager;
|
||||||
|
|
||||||
private CProjectDescriptionManager fNewCProjectDescriptionManager = CProjectDescriptionManager.getInstance();
|
|
||||||
|
|
||||||
private CoreModel fCoreModel;
|
private CoreModel fCoreModel;
|
||||||
|
|
||||||
|
@ -325,7 +323,6 @@ public class CCorePlugin extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
fNewCProjectDescriptionManager.shutdown();
|
fNewCProjectDescriptionManager.shutdown();
|
||||||
fDescriptorManager = null;
|
|
||||||
|
|
||||||
savePluginPreferences();
|
savePluginPreferences();
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -339,36 +336,50 @@ public class CCorePlugin extends Plugin {
|
||||||
public void start(BundleContext context) throws Exception {
|
public void start(BundleContext context) throws Exception {
|
||||||
super.start(context);
|
super.start(context);
|
||||||
|
|
||||||
fNewCProjectDescriptionManager.startup();
|
fNewCProjectDescriptionManager= CProjectDescriptionManager.getInstance();
|
||||||
fDescriptorManager = fNewCProjectDescriptionManager.getDescriptorManager();
|
|
||||||
|
|
||||||
// Start file type manager first !!
|
// Start file type manager first !!
|
||||||
fPathEntryVariableManager = new CdtVarPathEntryVariableManager();
|
fPathEntryVariableManager = new CdtVarPathEntryVariableManager();
|
||||||
fPathEntryVariableManager.startup();
|
|
||||||
|
|
||||||
cdtLog = new CDTLogWriter(CCorePlugin.getDefault().getStateLocation().append(".log").toFile()); //$NON-NLS-1$
|
cdtLog = new CDTLogWriter(CCorePlugin.getDefault().getStateLocation().append(".log").toFile()); //$NON-NLS-1$
|
||||||
|
|
||||||
//Set debug tracing options
|
|
||||||
configurePluginDebugOptions();
|
|
||||||
|
|
||||||
// fDescriptorManager.startup();
|
|
||||||
// CProjectDescriptionManager.getInstance().startup();
|
|
||||||
|
|
||||||
// Fired up the model.
|
|
||||||
fCoreModel = CoreModel.getDefault();
|
fCoreModel = CoreModel.getDefault();
|
||||||
fCoreModel.startup();
|
|
||||||
|
|
||||||
// Fire up the PDOM
|
// Fire up the PDOM
|
||||||
pdomManager = new PDOMManager();
|
pdomManager = new PDOMManager();
|
||||||
pdomManager.startup();
|
|
||||||
|
//Set debug tracing options
|
||||||
|
configurePluginDebugOptions();
|
||||||
|
|
||||||
// Set the default for using the structual parse mode to build the CModel
|
// Set the default for using the structual parse mode to build the CModel
|
||||||
getPluginPreferences().setDefault(PREF_USE_STRUCTURAL_PARSE_MODE, false);
|
getPluginPreferences().setDefault(PREF_USE_STRUCTURAL_PARSE_MODE, false);
|
||||||
|
|
||||||
PositionTrackerManager.getInstance().install();
|
PositionTrackerManager.getInstance().install();
|
||||||
|
|
||||||
|
// bug 186755, when started after the platform has been started the jobmanager
|
||||||
|
// is no longer suspended. So we have to start a job at the very end to make
|
||||||
|
// sure we don't trigger a concurrent plugin activation from within the job.
|
||||||
|
Job postStartupJob= new Job(CCorePlugin.getResourceString("CCorePlugin.startupJob")) { //$NON-NLS-1$
|
||||||
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
|
postStart();
|
||||||
|
return Status.OK_STATUS;
|
||||||
|
}
|
||||||
|
public boolean belongsTo(Object family) {
|
||||||
|
return family == CCorePlugin.this;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
postStartupJob.setSystem(true);
|
||||||
|
postStartupJob.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void postStart() {
|
||||||
|
fNewCProjectDescriptionManager.startup();
|
||||||
|
fPathEntryVariableManager.startup();
|
||||||
|
CoreModel.getDefault().startup();
|
||||||
|
pdomManager.startup();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Add all options here
|
* TODO: Add all options here
|
||||||
* Returns a table of all known configurable options with their default values.
|
* Returns a table of all known configurable options with their default values.
|
||||||
|
@ -705,7 +716,7 @@ public class CCorePlugin extends Plugin {
|
||||||
* @deprecated use getCProjetDescription(IProject project, boolean create)
|
* @deprecated use getCProjetDescription(IProject project, boolean create)
|
||||||
*/
|
*/
|
||||||
public ICDescriptor getCProjectDescription(IProject project) throws CoreException {
|
public ICDescriptor getCProjectDescription(IProject project) throws CoreException {
|
||||||
return fDescriptorManager.getDescriptor(project);
|
return fNewCProjectDescriptionManager.getDescriptorManager().getDescriptor(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -718,19 +729,19 @@ public class CCorePlugin extends Plugin {
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
public ICDescriptor getCProjectDescription(IProject project, boolean create) throws CoreException {
|
public ICDescriptor getCProjectDescription(IProject project, boolean create) throws CoreException {
|
||||||
return fDescriptorManager.getDescriptor(project, create);
|
return fNewCProjectDescriptionManager.getDescriptorManager().getDescriptor(project, create);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void mapCProjectOwner(IProject project, String id, boolean override) throws CoreException {
|
public void mapCProjectOwner(IProject project, String id, boolean override) throws CoreException {
|
||||||
if (!override) {
|
if (!override) {
|
||||||
fDescriptorManager.configure(project, id);
|
fNewCProjectDescriptionManager.getDescriptorManager().configure(project, id);
|
||||||
} else {
|
} else {
|
||||||
fDescriptorManager.convert(project, id);
|
fNewCProjectDescriptionManager.getDescriptorManager().convert(project, id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICDescriptorManager getCDescriptorManager() {
|
public ICDescriptorManager getCDescriptorManager() {
|
||||||
return fDescriptorManager;
|
return fNewCProjectDescriptionManager.getDescriptorManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1253,4 +1264,8 @@ public class CCorePlugin extends Plugin {
|
||||||
public ICProjectDescriptionManager getProjectDescriptionManager(){
|
public ICProjectDescriptionManager getProjectDescriptionManager(){
|
||||||
return fNewCProjectDescriptionManager;
|
return fNewCProjectDescriptionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void joinStartup(IProgressMonitor monitor) throws OperationCanceledException, InterruptedException {
|
||||||
|
Job.getJobManager().join(this, monitor);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -84,3 +84,4 @@ CConfigBasedDescriptorManager.2=can not perform descriptor operation based on th
|
||||||
CConfigBasedDescriptorManager.3=Failed to create descriptor
|
CConfigBasedDescriptorManager.3=Failed to create descriptor
|
||||||
CConfigBasedDescriptorManager.4=error: read-only configuration can not be used for CDescriptor
|
CConfigBasedDescriptorManager.4=error: read-only configuration can not be used for CDescriptor
|
||||||
CConfigBasedDescriptorManager.5=the project does not contain valid configurations
|
CConfigBasedDescriptorManager.5=the project does not contain valid configurations
|
||||||
|
CCorePlugin.startupJob=CDT Startup
|
||||||
|
|
Loading…
Add table
Reference in a new issue