Keybinding problems when opening a text editor in a control [message #503926] |
Wed, 16 December 2009 13:57 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
Hi,
I've embedded a textual (Xtext) editor in a graphical (GMF) editor to
allow combined textual/graphical editing. The text editor shows a
section of the textual representation of the same file. It pops up in a
small control if a diagram element is edited and closes on a defined key
sequence.
So the speciality of this case is that an editor is not opened in a
IWorkbenchPage but in a separate control. Most of it works fine, but
some keybinding issues remain:
To instantiate the Xtext editor I need an IEditorSite. I have tried two
options: Reuse the one from the diagram editor or create my own. In the
first case, after closing the popup Xtext editor the keybindings of the
parent diagram editor are lost, e.g. CTRL-S no longer works. Switching
to another part an back keybindings are restored. In the second case,
the Xtext specific keybindings are not activated in the popup editor, so
CTRL-SPACE for code assist does not work. Into the bargain, creating a
new IEditorSite is not possible without using internal API. It is
usually created by the runtime when activating an editor in a workbench
page.
The keybinding problem seems to be a missing context switch when opening
/ closing the XtextEditor. Debugging I found that a command for content
assist is there but has a null handler.
The editor's controls are created as children of the diagram control
using something like
xtextEditor.createPartControl(diagramParentComposite);
After editing, the editor is closed using
xtextEditor.dispose();
xtextEditorComposite.dispose();
Any ideas pointers are welcome. Am I approaching the problem completely
the wrong way?
Regards
Jan
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03716 seconds