Open file in its editor from Search Result. [message #332253] |
Tue, 14 October 2008 15:08  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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.
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.26379 seconds