tags:

views:

30

answers:

1

Hi,

I have extended IEditorInput class to define my own IEditorInput object. Furthermore, I have extended FormEditor class. I have view where I am displaying my application objects. Whenever user double clicks on items on view, I intend to display more details for this application object on the editor, which is a FormEditor. Problem I am facing is that I am receiving IEditorInput object as NULL inside extended FormEditor class. Can someone please tell me what I am doing wrong?

Code: CustomFormEditor extends FormEditor CustomEditorInput extends IEditorInput

In View class: PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(new CustomEditorInput("test"),"editor.id");

Thanks, Gaurav.

A: 

Do you use the setInput() and setSite() methods in the init() method? If not, then the getInput() and getSite() methods would return null.

Otherwise I don't have any idea what might have gone wrong.

Zoltán Ujhelyi
Thanks Zoltan. I was getting this because I was making a call from CustomEditor to my method which was using IEditorInput object. In the lifecyle of Editor, IEditorInput is set in init() method which is called after constructor.
Gabriel Parenza