mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-06 15:55:47 +02:00
Bug 314551 - [patch] Avoid creating children of IncludeReference when editor is closed
This commit is contained in:
parent
b73f4d0539
commit
c3257001ea
1 changed files with 45 additions and 31 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* 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 {
|
public class IncludeReference extends Openable implements IIncludeReference {
|
||||||
|
|
||||||
IIncludeEntry fIncludeEntry;
|
final IIncludeEntry fIncludeEntry;
|
||||||
IPath fPath;
|
final IPath fPath;
|
||||||
|
|
||||||
public IncludeReference(ICProject cproject, IIncludeEntry entry) {
|
public IncludeReference(ICProject cproject, IIncludeEntry entry) {
|
||||||
this(cproject, entry, entry.getFullIncludePath());
|
this(cproject, entry, entry.getFullIncludePath());
|
||||||
|
@ -59,6 +59,20 @@ public class IncludeReference extends Openable implements IIncludeReference {
|
||||||
return null;
|
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)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.core.model.CElement#createElementInfo()
|
* @see org.eclipse.cdt.internal.core.model.CElement#createElementInfo()
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue