mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix the label text of the folders
This commit is contained in:
parent
8923349603
commit
dae6b18551
1 changed files with 13 additions and 0 deletions
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.ui.cview;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.IIncludeReference;
|
import org.eclipse.cdt.core.model.IIncludeReference;
|
||||||
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.internal.ui.CElementImageProvider;
|
import org.eclipse.cdt.internal.ui.CElementImageProvider;
|
||||||
import org.eclipse.cdt.internal.ui.IAdornmentProvider;
|
import org.eclipse.cdt.internal.ui.IAdornmentProvider;
|
||||||
import org.eclipse.cdt.internal.ui.StandardCElementLabelProvider;
|
import org.eclipse.cdt.internal.ui.StandardCElementLabelProvider;
|
||||||
|
@ -65,6 +66,18 @@ public class CViewLabelProvider extends StandardCElementLabelProvider {
|
||||||
}
|
}
|
||||||
return p.toString();
|
return p.toString();
|
||||||
}
|
}
|
||||||
|
} else if (element instanceof ITranslationUnit) {
|
||||||
|
ITranslationUnit unit = (ITranslationUnit)element;
|
||||||
|
Object parent = unit.getParent();
|
||||||
|
if (parent instanceof IIncludeReference) {
|
||||||
|
IPath p = unit.getPath();
|
||||||
|
IPath parentLocation = ((IIncludeReference)parent).getPath();
|
||||||
|
if (parentLocation.isPrefixOf(p)) {
|
||||||
|
p = p.setDevice(null);
|
||||||
|
p = p.removeFirstSegments(parentLocation.segmentCount());
|
||||||
|
}
|
||||||
|
return p.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return super.getText(element);
|
return super.getText(element);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue