1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

add startup() and shtudown() methods.

This commit is contained in:
Alain Magloire 2003-04-10 01:12:24 +00:00
parent 6b356aa170
commit febb3908e9
4 changed files with 53 additions and 4 deletions

View file

@ -88,6 +88,20 @@ public class IndexModel {
manager.addAll();
}
/**
*
*/
public void startup() {
manager.startup();
}
/**
*
*/
public void shutdown() {
manager.shutdown();
}
/**
* Initialize default index Model.
*/
@ -101,4 +115,5 @@ public class IndexModel {
private IndexModel () {
}
}

View file

@ -78,7 +78,7 @@ public class IndexManager implements IElementChangedListener {
return projectsMap;
}
protected void init () {
public void startup () {
requestList = new RequestList();
projectsMap = Collections.synchronizedMap(new HashMap());
CTagsRunner ctags = new CTagsRunner(this);
@ -155,7 +155,9 @@ public class IndexManager implements IElementChangedListener {
public void clearRequestList(IResource resource) {
if (resource instanceof IFile) {
requestList.removeItem(resource);
if (requestList != null) {
requestList.removeItem(resource);
}
} else if (resource instanceof IContainer) {
try {
IContainer container = (IContainer)resource;
@ -189,7 +191,9 @@ public class IndexManager implements IElementChangedListener {
public void addFile(IFile file) {
if (CoreModel.getDefault().isTranslationUnit(file) &&
IndexModel.getDefault().isEnabled(file.getProject())) {
requestList.addItem(file);
if (requestList != null) {
requestList.addItem(file);
}
}
}
@ -248,7 +252,6 @@ public class IndexManager implements IElementChangedListener {
public static IndexManager getDefault() {
if (indexManager == null) {
indexManager = new IndexManager();
indexManager.init();
// Register to the C Core Model for C specific changes.
CoreModel.getDefault().addElementChangedListener(indexManager);
}

View file

@ -185,6 +185,17 @@ public class CoreModel {
manager.removeElementChangedListener(listener);
}
/**
* @see Plugin#startup
*/
public void startup() {
manager.startup();
}
public void shutdown() {
manager.shutdown();
}
private CoreModel() {
}

View file

@ -747,5 +747,25 @@ public class CModelManager implements IResourceChangeListener {
protected void removeInfo(ICElement element) {
this.cache.removeInfo(element);
}
/**
*
*/
public void startup() {
// Do any initialization.
}
/**
*
*/
public void shutdown() {
// Do any shutdown of services.
BinaryRunner[] runners = (BinaryRunner[])binaryRunners.values().toArray(new BinaryRunner[0]);
for (int i = 0; i < runners.length; i++) {
if (runners[i].isAlive()) {
runners[i].interrupt();
}
}
}
}