[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: cannot be cast to org.eclipse.ui.ide.FileStoreEditorInput

Andrey Ilinykh wrote:
I created both MyEditor and MyEditorInput classes. When I create new MyEditor I pass instance of my MyEditorInput.But when I open file, workbench creates MyEditor but call init() with FileStoreEditorInput as parameter.So, when I call getEditorInput() I may have my MyEditoInput or FileStoreEditorInput. It causes the problem, because I try to cast them.I can check if I get MyEditoInput or FileStoreEditorInput, but it doesn't look nice. So, what is right way to handle this situation?

When you open a file outside of the workspace (like File > Open...), Eclipse will use a FileStoreEditorInput (as you discovered). As far as I know, there is no way of knowing that MyEditorInput is supposed to match with MyEditor so I'm not even sure how your code originally worked in 3.2. What are you adding to MyEditorInput that can't be satisfied by the framework's original IEditorInput implementations?