Is it possible to insert JavaEditor example into Dialog??? [message #67356] |
Wed, 25 June 2003 10:01 |
Eclipse User |
|
|
|
Hello group. I was trying to insert JavaEditor example into Dialog.
Here is code:
protected Control createDialogArea(Composite parent)
{
Composite container =
(Composite)super.createShell();//.createDialogArea(parent);
GridLayout layout = new GridLayout();
container.setLayout(layout);
layout.numColumns = 1;
layout.verticalSpacing = 1;
javaeditor.JavaEditor editor = new javaeditor.JavaEditor();
editor.initializeEditor();
editor.setInput(container);
editor.createPartControl(container);
return container;
}
During runtime when getting into this method i got the exception:
java.lang.NullPointerException:
at org.eclipse.ui.texteditor.AbstractTextEditor.createPartContr ol
(AbstractTextEditor.java:2039)
at
org.eclipse.ui.texteditor.StatusTextEditor.createPartControl (StatusTextEdito
r.java:53)
at
org.eclipse.ui.editors.text.TextEditor.createPartControl(Tex tEditor.java:746
)
........
I assume the reason is that getSite() probably returns null since exception
occurs in class AbstractTextEditor in this line:
if (fEditorContextMenuId != null)
-> getSite().registerContextMenu(fEditorContextMenuId, manager,
getSelectionProvider());
Another direction, when i use example where JAvaEditor is extension, where
can i see how it initilized ?
Does anyone has an idea how to handle to make editor visible in dialog or on
workbench with the String in need to edit?
Thanks,
Asaf
|
|
|
Powered by
FUDForum. Page generated in 0.02589 seconds