1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

Bug 186755, move registration of resource-listener of project-desc-manager to the beginning of the plugin.start().

This commit is contained in:
Markus Schorn 2007-05-14 15:15:52 +00:00
parent 2109b985e9
commit c875ab1d89
2 changed files with 39 additions and 38 deletions

View file

@ -286,44 +286,46 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
return fInstance; return fInstance;
} }
public void startup(){ public void registerResourceListener() {
if(fRcChangeHandler == null){ assert fRcChangeHandler == null;
fRcChangeHandler = new ResourceChangeHandler(); fRcChangeHandler = new ResourceChangeHandler();
ResourcesPlugin.getWorkspace().addResourceChangeListener(
fRcChangeHandler,
IResourceChangeEvent.POST_CHANGE
| IResourceChangeEvent.PRE_DELETE
| IResourceChangeEvent.PRE_CLOSE
/*| IResourceChangeEvent.POST_BUILD*/);
}
ResourcesPlugin.getWorkspace().addResourceChangeListener( public void startup(){
fRcChangeHandler, assert fRcChangeHandler != null;
IResourceChangeEvent.POST_CHANGE fDescriptorManager.startup();
| IResourceChangeEvent.PRE_DELETE
| IResourceChangeEvent.PRE_CLOSE
/*| IResourceChangeEvent.POST_BUILD*/);
fDescriptorManager.startup(); CExternalSettingsManager.getInstance().startup();
CExternalSettingsManager.getInstance().startup(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
Job rcJob = new Job(SettingsModelMessages.getString("CProjectDescriptionManager.0")){ //$NON-NLS-1$
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); protected IStatus run(IProgressMonitor monitor) {
Job rcJob = new Job(SettingsModelMessages.getString("CProjectDescriptionManager.0")){ //$NON-NLS-1$ try{
protected IStatus run(IProgressMonitor monitor) { startSaveParticipant();
try{ } catch (CoreException e){
startSaveParticipant(); CCorePlugin.log(e);
} catch (CoreException e){ return e.getStatus();
CCorePlugin.log(e);
return e.getStatus();
}
return new Status(
IStatus.OK,
CCorePlugin.PLUGIN_ID,
IStatus.OK,
new String(),
null);
} }
}; return new Status(
IStatus.OK,
rcJob.setRule(root); CCorePlugin.PLUGIN_ID,
rcJob.setPriority(Job.INTERACTIVE); IStatus.OK,
rcJob.setSystem(true); new String(),
rcJob.schedule(); null);
} }
};
rcJob.setRule(root);
rcJob.setPriority(Job.INTERACTIVE);
rcJob.setSystem(true);
rcJob.schedule();
} }
/* /*

View file

@ -336,13 +336,12 @@ 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);
// make sure to register the resource listener as the first one in CDT:
fNewCProjectDescriptionManager= CProjectDescriptionManager.getInstance(); fNewCProjectDescriptionManager= CProjectDescriptionManager.getInstance();
fNewCProjectDescriptionManager.registerResourceListener();
// Start file type manager first !!
fPathEntryVariableManager = new CdtVarPathEntryVariableManager(); fPathEntryVariableManager = new CdtVarPathEntryVariableManager();
cdtLog = new CDTLogWriter(CCorePlugin.getDefault().getStateLocation().append(".log").toFile()); //$NON-NLS-1$ cdtLog = new CDTLogWriter(CCorePlugin.getDefault().getStateLocation().append(".log").toFile()); //$NON-NLS-1$
fCoreModel = CoreModel.getDefault(); fCoreModel = CoreModel.getDefault();
// Fire up the PDOM // Fire up the PDOM