IFile [message #465580] |
Mon, 02 April 2007 11:45  |
Eclipse User |
|
|
|
Hi,
Can any one give me a hint ,about getting IFile from the editor.
I have snippet which uses iFileEditorInput to get IFile,but the fact is i
couldnt find IFileEditorInput itself.
BR,
Mark
|
|
|
|
|
|
|
|
Missing IFile and other classes (blocking issue)! [message #466579 is a reply to message #465728] |
Sat, 21 April 2007 13:19   |
Eclipse User |
|
|
|
Originally posted by: jweeks.neuraldk.org
This is exactly what I'm currently doing, but my Eclipse setup is unable to
find various classes which I need, such as:
org.eclipse.ui.IFileEditorInput
org.eclipse.core.resources.IFile
Any idea why this is, and/or how I can fix it? This project was setup via
the plugin development new project wizard.
The error I was receiving was:
The project was not built since its build path is incomplete. Cannot find
the class file for org.eclipse.ui.IFileEditorInput. Fix the build path
then try building this project.
I manually added the following libraries:
/usr/share/eclipse/plugins/org.eclipse.core.resources_3.2.1. R32x_v20060914.jar
/usr/share/eclipse/plugins/org.eclipse.ui_3.2.1.M20060915-10 30.jar
And now I can at least run the project, but every time I try to use one of
these classes, I appear to get a class loading exception.
Have I added these classes incorrectly? How can I ensure that all classes
are properly associated and loaded with my project? I expected all of the
eclipse plugin jars to be listed under "Plug-in Dependencies", but this
doesn't appear to be the case.
Please help!
Thanks,
Jeff
> Not sure about the snippet you have. Does this helps?
>
> IFile theFile = null;
> IEditorInput editorInput = getEditorInput();
> if(editorInput instanceof IFileEditorInput) {
> theFile =
> ((IFileEditorInput)editorInput).getFile(); }
>
> - Prakash
>
> >
> > Hi,
> >
> >
> > Can any one give me a hint ,about getting IFile
> > from the editor.
> > I have snippet which uses iFileEditorInput to get
> > IFile,but the fact is i
> > couldnt find IFileEditorInput itself.
> >
> > BR,
> > Mark
> >
|
|
|
Re: Missing IFile and other classes (blocking issue)! [message #466584 is a reply to message #466579] |
Sat, 21 April 2007 13:56  |
Eclipse User |
|
|
|
Originally posted by: jweeks.neuraldk.org
Bah! I found my answer... I needed to edit the manifest.mf file instead of
adding jars and/or editing the plugin.xml. I also needed to add
org.eclipse.ui.ide in order to get the IFileEditorInput instance (even
though its a part of the org.eclipse.ui namespace).
One other note on this topic, though... I noticed my default EditorInput is
*not* an instance of IFileEditorInput
(org.eclipse.ui.internal.editors.text.JavaFileEditorInput is not). It is,
however, an instance of IPathEditorInput, so the following code will work
to get the filename of an editor:
IEditorInput input = getEditorInput();
if( input instanceof IPathEditorInput )
{
IPath path = ((IPathEditorInput)input).getPath();
filename = path.toOSString();
}
--Jeff
Jeff Weeks [ neuraldk ] wrote:
> This is exactly what I'm currently doing, but my Eclipse setup is unable
> to find various classes which I need, such as:
>
> org.eclipse.ui.IFileEditorInput
> org.eclipse.core.resources.IFile
>
> Any idea why this is, and/or how I can fix it? This project was setup via
> the plugin development new project wizard.
>
> The error I was receiving was:
> The project was not built since its build path is incomplete. Cannot find
> the class file for org.eclipse.ui.IFileEditorInput. Fix the build path
> then try building this project.
>
> I manually added the following libraries:
> /usr/share/eclipse/plugins/org.eclipse.core.resources_3.2.1. R32x_v20060914.jar
> /usr/share/eclipse/plugins/org.eclipse.ui_3.2.1.M20060915-10 30.jar
>
> And now I can at least run the project, but every time I try to use one of
> these classes, I appear to get a class loading exception.
>
> Have I added these classes incorrectly? How can I ensure that all classes
> are properly associated and loaded with my project? I expected all of the
> eclipse plugin jars to be listed under "Plug-in Dependencies", but this
> doesn't appear to be the case.
>
> Please help!
>
> Thanks,
> Jeff
>
>> Not sure about the snippet you have. Does this helps?
>>
>> IFile theFile = null;
>> IEditorInput editorInput = getEditorInput();
>> if(editorInput instanceof IFileEditorInput) {
>> theFile =
>> ((IFileEditorInput)editorInput).getFile(); }
>>
>> - Prakash
>>
>> >
>> > Hi,
>> >
>> >
>> > Can any one give me a hint ,about getting IFile
>> > from the editor.
>> > I have snippet which uses iFileEditorInput to get
>> > IFile,but the fact is i
>> > couldnt find IFileEditorInput itself.
>> >
>> > BR,
>> > Mark
>> >
|
|
|
Powered by
FUDForum. Page generated in 0.04272 seconds