Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-core-dev] Open Declarations for .h not in project

Take a look at the OpenIncludeAction.  I suspect that the
problem is that you have this lonely file out in the middle
of no-where and it isn't actually part of the workspace proper.

Look at the code in run() and more specifically in 
activateExistingOpenedExternalFile().  We should likely roll
this code together into the EditorUtility class so that there
is a common location for this kind of thing.

Hope this helps, 
  Thomas

> -----Original Message-----
> From: Keithen Hayenga [mailto:Keithen.Hayenga@xxxxxxxxxxxxxx]
> Sent: Friday, April 23, 2004 6:55 PM
> To: cdt-core-dev@xxxxxxxxxxx
> Subject: [cdt-core-dev] Open Declarations for .h not in project
> 
> 
> Based on CDT 1.2.1. I am using Open Declarations to open 
> header files with declarations that are imported into the 
> project. However, when i use Open Declaration for our SDK 
> that is not imported into the project the header files are 
> not opened. I know that in OpenDeclarationsAction the search 
> is successful in both cases. When we get to the actual open 
> call, in the first case the IMatch object contains an 
> IResource that is really an IFile and the open succeeds. In 
> the case of our sdk files, the resource is null, but the file 
> i want is stored there in the IPath. I can use the following 
> code to get an IFile from the IPath to get the file "opened" 
> in the editor.
> 
> IPath path = element.getLocation();
> Object res = 
> ((Workspace)ResourcesPlugin.getWorkspace()).newResource(path, 
> IResource.FILE);
> IEditorPart part= EditorUtility.openInEditor(res);
> 
> Unfortunately this only gets the file tab at the top of the 
> editor window and the editor displays the message "Resource 
> C:/Program Files/PalmSource/Palm OS Developer 
> Suite/sdk-6/headers/Form.h does not exist." It seems that the 
> editor knows this file does not belong to the project. How 
> can i get the editor to display the contents of this header 
> file that does too exist?
> 
> -Keithen
> _______________________________________________
> cdt-core-dev mailing list
> cdt-core-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/cdt-core-dev
> 


Back to the top