mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
fix for 139920
This commit is contained in:
parent
033966ab4c
commit
fc8276028d
1 changed files with 15 additions and 1 deletions
|
@ -58,11 +58,25 @@ public abstract class CElement extends PlatformObject implements ICElement {
|
|||
*/
|
||||
public Object getAdapter(Class adapter) {
|
||||
if(adapter == IFile.class)
|
||||
return (IFile) getUnderlyingResource();
|
||||
{
|
||||
IResource resource = getUnderlyingResource();
|
||||
if(resource instanceof IFile)
|
||||
{
|
||||
return (IFile) resource;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if(adapter == IResource.class)
|
||||
{
|
||||
return getUnderlyingResource();
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.getAdapter(adapter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue