Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Open file in its editor from Search Result.
Open file in its editor from Search Result. [message #332253] Tue, 14 October 2008 15:08 Go to next message
Rahul Yadav is currently offline Rahul YadavFriend
Messages: 65
Registered: July 2009
Member
I am writing a search extension plugin.I need to open the search result
file in its editor on the double click.
Editor for that file is available as i can open the file in its editor
from project explorer but when i try to open it from search result it gets
open up in default text editor.

to resolve same i started playing around with code and observed that on

PlatformUI.getWorkbench().getEditorRegistry().getDefaultEdit or( "address.diagram")

i get a valid editorDescriptor.but when i do..

IEditorInput input= new FileEditorInput(file);
IEditorPart editor=page.findEditor(input);

"file" is an valid object of IFile refereing to a .diagram file.
"page" is a valid ref of IWorkbenchPage.

value of "editor" comes to be null and thus unable to load file in its
editor.

Can somebody suggest me what i need to do to resolve this.

thanks.
Re: Open file in its editor from Search Result. [message #332261 is a reply to message #332253] Wed, 15 October 2008 07:46 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Rahul Yadav wrote:
> I am writing a search extension plugin.I need to open the search
> result file in its editor on the double click.
> Editor for that file is available as i can open the file in its editor
> from project explorer but when i try to open it from search result it
> gets open up in default text editor.
>
> to resolve same i started playing around with code and observed that on
>
> PlatformUI.getWorkbench().getEditorRegistry().getDefaultEdit or( "address.diagram")
>
>
> i get a valid editorDescriptor.but when i do..
>
> IEditorInput input= new FileEditorInput(file);
> IEditorPart editor=page.findEditor(input);
>
> "file" is an valid object of IFile refereing to a .diagram file.
> "page" is a valid ref of IWorkbenchPage.
>
> value of "editor" comes to be null and thus unable to load file in its
> editor.
>
> Can somebody suggest me what i need to do to resolve this.
Take a look at org.eclipse.search.internal.ui.text.EditorOpener

Dani
>
> thanks.
>
>
>
Previous Topic:Making a section look like PDE editor section
Next Topic:p2 and non-eclipse dependencies
Goto Forum:
  


Current Time: Sat Oct 19 11:44:01 GMT 2024

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

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

Back to the top