mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 19:35:36 +02:00
use get{Header,Source}extensions()
This commit is contained in:
parent
6ebd7872e8
commit
b75ef61e20
1 changed files with 12 additions and 5 deletions
|
@ -6,6 +6,7 @@ package org.eclipse.cdt.internal.ui.cview;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.CModelException;
|
import org.eclipse.cdt.core.model.CModelException;
|
||||||
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
import org.eclipse.cdt.core.model.IArchive;
|
import org.eclipse.cdt.core.model.IArchive;
|
||||||
import org.eclipse.cdt.core.model.IArchiveContainer;
|
import org.eclipse.cdt.core.model.IArchiveContainer;
|
||||||
import org.eclipse.cdt.core.model.IBinaryContainer;
|
import org.eclipse.cdt.core.model.IBinaryContainer;
|
||||||
|
@ -56,12 +57,18 @@ public class CViewSorter extends ViewerSorter {
|
||||||
if (res != null) {
|
if (res != null) {
|
||||||
String ext = res.getFileExtension();
|
String ext = res.getFileExtension();
|
||||||
if (ext != null) {
|
if (ext != null) {
|
||||||
if (ext.equals("h") || ext.equals("hh")) {
|
String[] headers = CoreModel.getDefault().getHeaderExtensions();
|
||||||
|
for (int i = 0; i < headers.length; i++) {
|
||||||
|
if (ext.equals(headers[i])) {
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
if (ext.equals("c") || ext.equals("C") || ext.equals("cc") || ext.equals("cpp")) {
|
}
|
||||||
|
String[] sources = CoreModel.getDefault().getSourceExtensions();
|
||||||
|
for (int i = 0; i < sources.length; i++) {
|
||||||
|
if (ext.equals(sources[i])) {
|
||||||
return 44;
|
return 44;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 48;
|
return 48;
|
||||||
}
|
}
|
||||||
return 49;
|
return 49;
|
||||||
|
|
Loading…
Add table
Reference in a new issue