0

My own plugin project has a editor(which implements org.eclipse.ui.part.MultiPageEditorPart) with 2 pages:one is a GraphicalEditorWithFlyoutPalette(which will parse XML files into figures) and the other one is a StructuredTextEditor(which will parse figures into XML code).So what I want to do is drawing figures in the first editor and get source code in the other editor and do the opposite thing as well.And I believe many GEF and plugin/RCP projects may have this feature.

Now I have to face the fact that when I try to switch between my two editors,the cursor always stay on the first line in the source Editor.What I supposed to get is that if a figure is selected in the first editor and when I switch to the second editor,some code block should be highlight(just like the Outline View in Eclipse),or at least the cursor should stay at the line which the corresponding XML block starts(just like the XML Editor in Eclipse)

Anybody have some helpful advice to give? Tks a lot :-)

4

1 回答 1

0

SelectionEditPolicy在 GEF 编辑器中,您可以使用'方法收听选择更改showSelection。当您的选择更改时,将调用此方法。在该方法中,您可以更改光标在第二个编辑器上显示的位置(或设置某种共享变量,编辑器在激活时可以读取)。

于 2013-03-21T09:34:58.967 回答