Search code examples
javaeclipsercpwindowbuilder

How to create EditorPart like windowbuilder in eclipse RCP


I have already had a TextEditor for my language extending with syntax highlighting, hyperlink detector and etc plugins. Also I have had an EditorPart for visual programming in the same language. How can I merge both editors in one Part with two switchable tabs like in WindowBuilder (tabs "Source" and "Design")?


Solution

  • You use an editor part extending MultiPageEditorPart to create an editor with multiple pages.

    This editor has a createPages method where you add the pages to the editor by calling the addPage method.

    The New Plug-in Project wizard can actually create a skeleton of such an editor as one of its examples - make sure you select 'This plug-in will make contributions to the UI' on the second page of the wizard. The final page will then include 'Multi-page editor' in the list of examples.