mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +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.CoreModel;
|
||||
import org.eclipse.cdt.core.model.IArchive;
|
||||
import org.eclipse.cdt.core.model.IArchiveContainer;
|
||||
import org.eclipse.cdt.core.model.IBinaryContainer;
|
||||
|
@ -56,12 +57,18 @@ public class CViewSorter extends ViewerSorter {
|
|||
if (res != null) {
|
||||
String ext = res.getFileExtension();
|
||||
if (ext != null) {
|
||||
if (ext.equals("h") || ext.equals("hh")) {
|
||||
return 42;
|
||||
}
|
||||
if (ext.equals("c") || ext.equals("C") || ext.equals("cc") || ext.equals("cpp")) {
|
||||
return 44;
|
||||
String[] headers = CoreModel.getDefault().getHeaderExtensions();
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
if (ext.equals(headers[i])) {
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
String[] sources = CoreModel.getDefault().getSourceExtensions();
|
||||
for (int i = 0; i < sources.length; i++) {
|
||||
if (ext.equals(sources[i])) {
|
||||
return 44;
|
||||
}
|
||||
}
|
||||
return 48;
|
||||
}
|
||||
return 49;
|
||||
|
|
Loading…
Add table
Reference in a new issue