Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Is it possible to insert JavaEditor example into Dialog???
Is it possible to insert JavaEditor example into Dialog??? [message #67356] Wed, 25 June 2003 10:01
Eclipse UserFriend
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
Previous Topic:Open JavaEditor with String or InputStream as code in responce to Event in veiwer
Next Topic:view a file from ant
Goto Forum:
  


Current Time: Fri Apr 25 01:26:49 EDT 2025

Powered by FUDForum. Page generated in 0.02589 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top