Skip to main content



      Home
Home » Newcomers » Newcomers » Opening of Editor on Files
Opening of Editor on Files [message #266210] Tue, 11 November 2008 04:37 Go to next message
Eclipse UserFriend
Hi All,

I have two editors.For one particular type of file extension previously
Editor1 used to open now i need to open the editor2 for that.But i have
some use case for which editor1 needs to open for some conditions and
editor2 for some.

I used to mention the file extension in plugin.xml and eclipse used to
open the particular editor for me.How do i achieve the conditional based
opening ?.Do i have to intervene the eclipse framework?.

Thanks and Regards,
Saurav
Re: Opening of Editor on Files [message #266511 is a reply to message #266210] Wed, 19 November 2008 18:58 Go to previous messageGo to next message
Eclipse UserFriend
Hi Saurav,

I think you need to clarify some parts.

What are the conditions that determine which editor to use for opening a
file.
Is the condition based on the file name, the contents of the file or
something else?
Is it possible to determine this programatically or should it be decided by
the user?
Have you created the editors yourself or are they provided by a third party?

BR, David.

Purple Scout / www.purplescout.com

"saurav " <saurav.sarkar1@gmail.com> wrote in message
news:dcc8ef331092737440baacd659d819e4$1@www.eclipse.org...
> Hi All,
>
> I have two editors.For one particular type of file extension previously
> Editor1 used to open now i need to open the editor2 for that.But i have
> some use case for which editor1 needs to open for some conditions and
> editor2 for some.
>
> I used to mention the file extension in plugin.xml and eclipse used to
> open the particular editor for me.How do i achieve the conditional based
> opening ?.Do i have to intervene the eclipse framework?.
>
> Thanks and Regards,
> Saurav
>
Re: Opening of Editor on Files [message #266536 is a reply to message #266511] Thu, 20 November 2008 09:03 Go to previous messageGo to next message
Eclipse UserFriend
David Virdefors wrote:

> Hi Saurav,

> I think you need to clarify some parts.

> What are the conditions that determine which editor to use for opening a
> file.
> Is the condition based on the file name, the contents of the file or
> something else?
> Is it possible to determine this programatically or should it be decided by
> the user?
> Have you created the editors yourself or are they provided by a third party?

> BR, David.

> Purple Scout / www.purplescout.com


Many thanks david for the reply.
The condition is based on file contents.It can be done programitically.
THe editors are created by myself, i have access to all of the code.

suppose i have .xx file and i have two editors e1 and e2.
Depending on the contens of the file i need to open e1 or e2.

What i have done.

I have specified the extension in the plugin.xml of both the editors.
but the one with default one opens.

I have tried using IEditorLauncher but it did not help.
Please suggest if there is any way to achieve the same.


Best Regards,
Saurav
Re: Opening of Editor on Files [message #266599 is a reply to message #266536] Fri, 21 November 2008 06:14 Go to previous message
Eclipse UserFriend
ok ...after long thought.I used Editor Launcher and created an extension
point to achieve the same,but resource when i clicked through Problems
view, the marker instance is lost as the launcher only has the IPath with
it.
i.e. my implementation doesnt work with Problems view if i want to use the
markers.
Any help would be hugely appreciated
Previous Topic:problem using ant taska outside of eclipse
Next Topic:2 instances of eclipse, one workspace
Goto Forum:
  


Current Time: Wed May 07 11:58:57 EDT 2025

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

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

Back to the top