mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
Sorting the projects in the IndexView to match the projects view.
This commit is contained in:
parent
4aa85cde22
commit
8edd645f62
1 changed files with 10 additions and 5 deletions
|
@ -11,6 +11,9 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.indexview;
|
package org.eclipse.cdt.internal.ui.indexview;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.IPDOMNode;
|
import org.eclipse.cdt.core.dom.IPDOMNode;
|
||||||
import org.eclipse.cdt.core.dom.IPDOMVisitor;
|
import org.eclipse.cdt.core.dom.IPDOMVisitor;
|
||||||
|
@ -254,11 +257,13 @@ public class IndexView extends ViewPart implements PDOM.IListener, IElementChang
|
||||||
if (inputElement instanceof ICModel) {
|
if (inputElement instanceof ICModel) {
|
||||||
ICModel model = (ICModel)inputElement;
|
ICModel model = (ICModel)inputElement;
|
||||||
ICProject[] projects = model.getCProjects();
|
ICProject[] projects = model.getCProjects();
|
||||||
for (int i = 0; i < projects.length; ++i) {
|
Arrays.sort(projects, new Comparator() {
|
||||||
ICProject project = projects[i];
|
public int compare(Object arg0, Object arg1) {
|
||||||
if (project.getUnderlyingResource().isPhantom())
|
String name0 = ((ICProject)arg0).getElementName();
|
||||||
System.out.println(project.getElementName() + " is phantom");
|
String name1 = ((ICProject)arg1).getElementName();
|
||||||
|
return name0.compareToIgnoreCase(name1);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
return projects;
|
return projects;
|
||||||
}
|
}
|
||||||
} catch (CModelException e) {
|
} catch (CModelException e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue