[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Opening a file on the editor

sakhi wrote:


I don't do anything to create a editor input. In my editor class create part control i just call setDocument(new FileDocumentProvider());
I run my plugin project as eclipse application and a workbench opens.In the file menu ->open i browse to a file in the desktop and open it .It automatically opens with its associated editor.I do not open the editor programatically...!When the editor opens the call automatically goes to createDocument method of the FileDocumentProvider().

It's like I suspected: you assumed a certain editor input type for external files. You have two choices:
1. (preferred) don't use FileDocumentProvider: either don't override the document provider that the TextEditor uses (i.e. TextFileDocumentProvider) or subclass TextFileDocumentProvider. Note that you don't have to read the file and create the document yourself as the TextFileDocumentProvider already does this for you.


2. keep your code and make sure it can handle IURIEditorInput (the concrete class is FileStoreEditorInput).

HTH
Dani


Br, Sakhi