return editorInput.getFile().getParent();
}
private IFile getIncludeFile(IProject project, IFileEditorInput editorInput, String relativeFilename) {
- // IContainer container = getWorkingLocation(editorInput);
- // String fullPath = project.getLocation().toString();
- Path path = new Path(relativeFilename);
- IFile file = project.getFile(path);
+ IContainer container = getWorkingLocation(editorInput);
+ String fullPath = project.getLocation().toString();
+ IFile file = null;
+ if (relativeFilename.startsWith("../")) {
+ Path path = new Path(relativeFilename);
+ file = container.getFile(path);
+ return file;
+ }
+ int index = relativeFilename.lastIndexOf('/');
+
+ if (index >= 0) {
+ Path path = new Path(relativeFilename);
+ file = project.getFile(path);
+ if (file.exists()) {
+ return file;
+ }
+ }
+
+ Path path = new Path(relativeFilename);
+ file = container.getFile(path);
+
return file;
}
return;
}
} catch (Exception e) {
-// ignore
+ // ignore
}
try {