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:
parent
6b356aa170
commit
febb3908e9
4 changed files with 53 additions and 4 deletions
|
@ -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 () {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
if (requestList != null) {
|
||||
requestList.removeItem(resource);
|
||||
}
|
||||
} else if (resource instanceof IContainer) {
|
||||
try {
|
||||
IContainer container = (IContainer)resource;
|
||||
|
@ -189,9 +191,11 @@ public class IndexManager implements IElementChangedListener {
|
|||
public void addFile(IFile file) {
|
||||
if (CoreModel.getDefault().isTranslationUnit(file) &&
|
||||
IndexModel.getDefault().isEnabled(file.getProject())) {
|
||||
if (requestList != null) {
|
||||
requestList.addItem(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger addition of the entire content of a project
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
}
|
||||
|
||||
|
|
|
@ -748,4 +748,24 @@ public class CModelManager implements IResourceChangeListener {
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue