Editors [message #464238] |
Wed, 28 February 2007 07:24 |
Eclipse User |
|
|
|
Hi,
How can i get the editor input.Like i have associated a file format
for the editor,so that when i open the file from Eclipse ide File -> open
it automatically opens in that editor.I want to get that file or its
context at run time..Iam trying to use the below code
IEditorPart part = page.getActiveEditor();
if (part != null)
{ if (!(part instanceof TextEditor))
return;
TextEditor editor = (TextEditor) part;
if (editor != null)
{
IDocumentProvider dp = editor.getDocumentProvider();
IDocument doc = dp.getDocument(editor.getEditorInput()
wat am i doing wrong in the above code,it is fetching input only if i
open the file before in some other editor then the one linked.
Thanks in advance
kris
|
|
|
Powered by
FUDForum. Page generated in 0.03849 seconds