1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

Bug 457590 - Workspace... button does not work in Library Path picker

Change-Id: Idcb597b5d60494438b1a5f29f4efad00050acc06
Reviewed-on: https://git.eclipse.org/r/39671
Reviewed-by: Elena Laskavaia <elaskavaia.cdt@gmail.com>
Tested-by: Elena Laskavaia <elaskavaia.cdt@gmail.com>
This commit is contained in:
Alena Laskavaia 2015-01-15 10:16:48 -05:00 committed by Elena Laskavaia
parent b26f160e3b
commit a0fd70a09e

View file

@ -238,7 +238,7 @@ public class FileListControl {
/* See if we can discover the project from the context * /* See if we can discover the project from the context *
* and check whether the path must be resolved... */ * and check whether the path must be resolved... */
IProject project = null; IProject project = null;
IResource resource = null;
if(contextInfo != null) { if(contextInfo != null) {
try { try {
// Try to find the project // Try to find the project
@ -262,9 +262,15 @@ public class FileListControl {
// ignore // ignore
} }
} }
IResource resource = null;
if (!currentPathText.isEmpty()) { if (!currentPathText.isEmpty()) {
IResource rs[] = ResourcesPlugin.getWorkspace().getRoot() IResource rs[] = null;
try {
rs = ResourcesPlugin.getWorkspace().getRoot()
.findContainersForLocationURI(URIUtil.toURI(currentPathText)); .findContainersForLocationURI(URIUtil.toURI(currentPathText));
} catch (Exception e) {
// rs will be null here, exception is throw is path is not absolute
}
if (rs == null || rs.length == 0) if (rs == null || rs.length == 0)
resource = ResourceLookup.selectFileForLocation(new Path(currentPathText), resource = ResourceLookup.selectFileForLocation(new Path(currentPathText),
null); null);