mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
2005-03-23 Alain Magloire
Optimize the pathentry markers. * model/org/eclipse/cdt/internal/core/model/BinaryRunner.java * model/org/eclipse/cdt/internal/core/model/PathEntryManger.java
This commit is contained in:
parent
b7caba9dd2
commit
8da83b1029
3 changed files with 28 additions and 19 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-03-23 Alain Magloire
|
||||||
|
Optimize the pathentry markers.
|
||||||
|
* model/org/eclipse/cdt/internal/core/model/BinaryRunner.java
|
||||||
|
* model/org/eclipse/cdt/internal/core/model/PathEntryManger.java
|
||||||
|
|
||||||
2005-03-23 Vladimir Hirsl
|
2005-03-23 Vladimir Hirsl
|
||||||
Moved ConsoleOutputSniffer from make.core plugin.
|
Moved ConsoleOutputSniffer from make.core plugin.
|
||||||
Added minimal console parser interface.
|
Added minimal console parser interface.
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class BinaryRunner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fireEvents(ICProject cproject, Parent container) {
|
void fireEvents(ICProject cproj, Parent container) {
|
||||||
// Fired the event.
|
// Fired the event.
|
||||||
try {
|
try {
|
||||||
ICElement[] children = container.getChildren();
|
ICElement[] children = container.getChildren();
|
||||||
|
@ -95,7 +95,7 @@ public class BinaryRunner {
|
||||||
CModelManager factory = CModelManager.getDefault();
|
CModelManager factory = CModelManager.getDefault();
|
||||||
ICElement root = factory.getCModel();
|
ICElement root = factory.getCModel();
|
||||||
CElementDelta cdelta = new CElementDelta(root);
|
CElementDelta cdelta = new CElementDelta(root);
|
||||||
cdelta.added(cproject);
|
cdelta.added(cproj);
|
||||||
cdelta.added(container);
|
cdelta.added(container);
|
||||||
for (int i = 0; i < children.length; i++) {
|
for (int i = 0; i < children.length; i++) {
|
||||||
cdelta.added(children[i]);
|
cdelta.added(children[i]);
|
||||||
|
|
|
@ -71,6 +71,7 @@ import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.core.runtime.Plugin;
|
import org.eclipse.core.runtime.Plugin;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||||
import org.eclipse.core.runtime.jobs.Job;
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1176,7 +1177,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
|
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
|
||||||
*/
|
*/
|
||||||
public void run(IProgressMonitor monitor) throws CoreException {
|
public void run(IProgressMonitor mon) throws CoreException {
|
||||||
flushPathEntryProblemMarkers(project);
|
flushPathEntryProblemMarkers(project);
|
||||||
for (int i = 0; i < problems.length; ++i) {
|
for (int i = 0; i < problems.length; ++i) {
|
||||||
createPathEntryProblemMarker(project, problems[i]);
|
createPathEntryProblemMarker(project, problems[i]);
|
||||||
|
@ -1190,7 +1191,8 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
markerTask.setRule(CCorePlugin.getWorkspace().getRoot());
|
ISchedulingRule rule = project.getWorkspace().getRuleFactory().markerRule(project);
|
||||||
|
markerTask.setRule(rule);
|
||||||
markerTask.schedule();
|
markerTask.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1457,21 +1459,24 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
||||||
IPathEntry[] entries = getCachedResolvedPathEntries(cProjects[i]);
|
IPathEntry[] entries = getCachedResolvedPathEntries(cProjects[i]);
|
||||||
if (entries != null) {
|
if (entries != null) {
|
||||||
IProject project = cProjects[i].getProject();
|
IProject project = cProjects[i].getProject();
|
||||||
ArrayList problemList = new ArrayList();
|
try {
|
||||||
ICModelStatus status = validatePathEntry(cProjects[i], entries);
|
IMarker[] markers = project.findMarkers(ICModelMarker.PATHENTRY_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
|
||||||
if (!status.isOK()) {
|
if (markers != null && markers.length > 0) {
|
||||||
problemList.add(status);
|
ArrayList problemList = new ArrayList();
|
||||||
}
|
for (int j = 0; j < entries.length; j++) {
|
||||||
for (int j = 0; j < entries.length; j++) {
|
ICModelStatus status = validatePathEntry(cProjects[i], entries[j], true, false);
|
||||||
status = validatePathEntry(cProjects[i], entries[j], true, false);
|
if (!status.isOK()) {
|
||||||
if (!status.isOK()) {
|
problemList.add(status);
|
||||||
problemList.add(status);
|
}
|
||||||
|
}
|
||||||
|
ICModelStatus[] problems = new ICModelStatus[problemList.size()];
|
||||||
|
problemList.toArray(problems);
|
||||||
|
if (hasPathEntryProblemMarkersChange(project, problems)) {
|
||||||
|
generateMarkers(project, problems);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} catch (CoreException e) {
|
||||||
ICModelStatus[] problems = new ICModelStatus[problemList.size()];
|
// ignore the exception.
|
||||||
problemList.toArray(problems);
|
|
||||||
if (hasPathEntryProblemMarkersChange(project, problems)) {
|
|
||||||
generateMarkers(project, problems);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1864,7 +1869,6 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
||||||
protected IMarker[] getPathEntryProblemMarkers(IProject project) {
|
protected IMarker[] getPathEntryProblemMarkers(IProject project) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
IWorkspace workspace = project.getWorkspace();
|
|
||||||
IMarker[] markers = project.findMarkers(ICModelMarker.PATHENTRY_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
|
IMarker[] markers = project.findMarkers(ICModelMarker.PATHENTRY_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
|
||||||
if (markers != null) {
|
if (markers != null) {
|
||||||
return markers;
|
return markers;
|
||||||
|
|
Loading…
Add table
Reference in a new issue