Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Test
Test [message #155069] Fri, 02 June 2006 14:24 Go to next message
Eclipse UserFriend
Originally posted by: jebinjohanson.gmail.com

Re: Test [message #155135 is a reply to message #155069] Fri, 02 June 2006 17:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fabian.juarez.gmail.com

Please send this type of messages to eclipse.test

Jebin escribió:

--
Fabián Alejandro Juárez Martínez
Intel Pentium 4 a 3.06 GHz
PCChips M925G
512 MB DDR
DD 40 GB
DVD+RW 4X

Sun Solaris 10 1/05 x86
SunOS helios 5.10 Generic_Patch_118844-30 i86pc i386 i86pc

¡Usando Evolution 1.4.6.330!
Re: Test [message #156029 is a reply to message #155135] Fri, 09 June 2006 05:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jebinjohanson.gmail.com

Hi! Friends,

I wanted to know that what could be the method by which we could find out
the currently selected file.

I'm writing a plugin which requires the currently opened file in the Eclipse
editor. If there are multiple files opened file,then i need the currently
selected file.

I'm able to get all the projects in the workspace. But i'm not able to
proceed from there.

Any type of help would be highly appreciated..


Thanks in advance,
Jebin

""Fabi
Re: Test [message #156077 is a reply to message #156029] Fri, 09 June 2006 07:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rathish_j.thbs.com

in editor we have function called getEditorInput(). which returns the object
of IEditorInput, typecast the input to FileEditorInput... from that u can
find that file belong to which project, which container..etc..

sample code..
input = getEditorInput();
fileInput = (FileEditorInput)input;
selectedFile = fileInput.getFile();

i think it may help u...(it addressing ur question?)

regards
rathish raj j

"Jebin" <jebinjohanson@gmail.com> wrote in message
news:e6b1ch$84j$1@utils.eclipse.org...
> Hi! Friends,
>
> I wanted to know that what could be the method by which we could find out
> the currently selected file.
>
> I'm writing a plugin which requires the currently opened file in the
> Eclipse
> editor. If there are multiple files opened file,then i need the currently
> selected file.
>
> I'm able to get all the projects in the workspace. But i'm not able to
> proceed from there.
>
> Any type of help would be highly appreciated..
>
>
> Thanks in advance,
> Jebin
>
> ""Fabi
Re: Test [message #156565 is a reply to message #156077] Tue, 13 June 2006 12:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jebinjohanson.gmail.com

Hi,

I tried the solution u gave me. But i'm getting a Classcast Exception
while type casting IEditorInput to FileEditorInput. When i did a getclass()
to the result of getEditorInput(),i'm getting FileEditorInput.
But when i typecast it i get an exception.Do u have any idea?ANy help will
be much helpful.

Jebin
"Rathish" <rathish_j@thbs.com> wrote in message
news:e6b6en$vg0$1@utils.eclipse.org...
> in editor we have function called getEditorInput(). which returns the
> object of IEditorInput, typecast the input to FileEditorInput... from
> that u can find that file belong to which project, which container..etc..
>
> sample code..
> input = getEditorInput();
> fileInput = (FileEditorInput)input;
> selectedFile = fileInput.getFile();
>
> i think it may help u...(it addressing ur question?)
>
> regards
> rathish raj j
>
> "Jebin" <jebinjohanson@gmail.com> wrote in message
> news:e6b1ch$84j$1@utils.eclipse.org...
>> Hi! Friends,
>>
>> I wanted to know that what could be the method by which we could find out
>> the currently selected file.
>>
>> I'm writing a plugin which requires the currently opened file in the
>> Eclipse
>> editor. If there are multiple files opened file,then i need the currently
>> selected file.
>>
>> I'm able to get all the projects in the workspace. But i'm not able to
>> proceed from there.
>>
>> Any type of help would be highly appreciated..
>>
>>
>> Thanks in advance,
>> Jebin
>>
>> ""Fabi
Re: Test [message #156596 is a reply to message #156565] Tue, 13 June 2006 15:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rathish_j.thbs.com

ur editor is TextEditor right? ru implementing in the following way?

IEditorInput input = getEditorInput();
FileEditorInput fileInput = (FileEditorInput)input;
IFile selectedFile = fileInput.getFile();

im using the same code in my plugin but im not getting any type cast
exception!! can u send ur the code fragment...


"Jebin" <jebinjohanson@gmail.com> wrote in message
news:e6mcaj$vpd$1@utils.eclipse.org...
> Hi,
>
> I tried the solution u gave me. But i'm getting a Classcast Exception
> while type casting IEditorInput to FileEditorInput. When i did a
> getclass() to the result of getEditorInput(),i'm getting FileEditorInput.
> But when i typecast it i get an exception.Do u have any idea?ANy help will
> be much helpful.
>
> Jebin
> "Rathish" <rathish_j@thbs.com> wrote in message
> news:e6b6en$vg0$1@utils.eclipse.org...
>> in editor we have function called getEditorInput(). which returns the
>> object of IEditorInput, typecast the input to FileEditorInput... from
>> that u can find that file belong to which project, which container..etc..
>>
>> sample code..
>> input = getEditorInput();
>> fileInput = (FileEditorInput)input;
>> selectedFile = fileInput.getFile();
>>
>> i think it may help u...(it addressing ur question?)
>>
>> regards
>> rathish raj j
>>
>> "Jebin" <jebinjohanson@gmail.com> wrote in message
>> news:e6b1ch$84j$1@utils.eclipse.org...
>>> Hi! Friends,
>>>
>>> I wanted to know that what could be the method by which we could find
>>> out
>>> the currently selected file.
>>>
>>> I'm writing a plugin which requires the currently opened file in the
>>> Eclipse
>>> editor. If there are multiple files opened file,then i need the
>>> currently
>>> selected file.
>>>
>>> I'm able to get all the projects in the workspace. But i'm not able to
>>> proceed from there.
>>>
>>> Any type of help would be highly appreciated..
>>>
>>>
>>> Thanks in advance,
>>> Jebin
>>>
>>> ""Fabi
Re: Test [message #156699 is a reply to message #156596] Wed, 14 June 2006 05:50 Go to previous message
Eclipse UserFriend
Originally posted by: jebinjohanson.gmail.com

Hi ,

I have pasted the snippet.

IWorkbench wb = PlatformUI.getWorkbench();
IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
IWorkbenchPage page = win.getActivePage();
IEditorPart editor = page.getActiveEditor();
IEditorInput editorInput = editor.getEditorInput();
/** this line gives the exception
IFile ifile = ((FileEditorInput) editor.getEditorInput()).getFile();

Also what do u mean by text editor..I cant get it..

Thanks in advance,
Jebin
"Rathish" <rathish_j@thbs.com> wrote in message
news:e6mjq7$vcs$1@utils.eclipse.org...
> ur editor is TextEditor right? ru implementing in the following way?
>
> IEditorInput input = getEditorInput();
> FileEditorInput fileInput = (FileEditorInput)input;
> IFile selectedFile = fileInput.getFile();
>
> im using the same code in my plugin but im not getting any type cast
> exception!! can u send ur the code fragment...
>
>
> "Jebin" <jebinjohanson@gmail.com> wrote in message
> news:e6mcaj$vpd$1@utils.eclipse.org...
>> Hi,
>>
>> I tried the solution u gave me. But i'm getting a Classcast Exception
>> while type casting IEditorInput to FileEditorInput. When i did a
>> getclass() to the result of getEditorInput(),i'm getting FileEditorInput.
>> But when i typecast it i get an exception.Do u have any idea?ANy help
>> will be much helpful.
>>
>> Jebin
>> "Rathish" <rathish_j@thbs.com> wrote in message
>> news:e6b6en$vg0$1@utils.eclipse.org...
>>> in editor we have function called getEditorInput(). which returns the
>>> object of IEditorInput, typecast the input to FileEditorInput... from
>>> that u can find that file belong to which project, which
>>> container..etc..
>>>
>>> sample code..
>>> input = getEditorInput();
>>> fileInput = (FileEditorInput)input;
>>> selectedFile = fileInput.getFile();
>>>
>>> i think it may help u...(it addressing ur question?)
>>>
>>> regards
>>> rathish raj j
>>>
>>> "Jebin" <jebinjohanson@gmail.com> wrote in message
>>> news:e6b1ch$84j$1@utils.eclipse.org...
>>>> Hi! Friends,
>>>>
>>>> I wanted to know that what could be the method by which we could find
>>>> out
>>>> the currently selected file.
>>>>
>>>> I'm writing a plugin which requires the currently opened file in the
>>>> Eclipse
>>>> editor. If there are multiple files opened file,then i need the
>>>> currently
>>>> selected file.
>>>>
>>>> I'm able to get all the projects in the workspace. But i'm not able to
>>>> proceed from there.
>>>>
>>>> Any type of help would be highly appreciated..
>>>>
>>>>
>>>> Thanks in advance,
>>>> Jebin
>>>>
>>>> ""Fabi
Previous Topic:Eclipse generating errors on quit?
Next Topic:error for auto build using org.eclipse.releng.eclipsebuilder
Goto Forum:
  


Current Time: Fri Dec 27 02:17:45 GMT 2024

Powered by FUDForum. Page generated in 0.07770 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top