1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 23:35:48 +02:00

Bug 314551 - [patch] Avoid creating children of IncludeReference when editor is closed

This commit is contained in:
Anton Leherbauer 2010-05-28 09:39:47 +00:00
parent b73f4d0539
commit c3257001ea

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2008 QNX Software Systems and others.
* Copyright (c) 2000, 2010 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -38,8 +38,8 @@ import org.eclipse.core.runtime.Path;
*/
public class IncludeReference extends Openable implements IIncludeReference {
IIncludeEntry fIncludeEntry;
IPath fPath;
final IIncludeEntry fIncludeEntry;
final IPath fPath;
public IncludeReference(ICProject cproject, IIncludeEntry entry) {
this(cproject, entry, entry.getFullIncludePath());
@ -59,6 +59,20 @@ public class IncludeReference extends Openable implements IIncludeReference {
return null;
}
/*
* @see org.eclipse.cdt.internal.core.model.CElement#exists()
*/
@Override
public boolean exists() {
File file = null;
if (fPath != null) {
file = fPath.toFile();
} else if (fIncludeEntry != null) {
file = fIncludeEntry.getFullIncludePath().toFile();
}
return file != null && file.isDirectory();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.model.CElement#createElementInfo()
*/