Saturday, October 15, 2005

To show the statusline for a multipage-editor

Please refer to PDEFormEditorContributor.


The basic idea is as following:
If the multipage editor has multiple editors, then these editor should edit different sources. For example, the plgin.xml editor has:

  • Plug-in Manifiest Editor

  • Extension Point Schema Editor

  • Build Properties Editor

  • Feature Manifest Editor

  • Site Manifest Editor

  • Product Configuration Editor

  • Code Sample Editor

  • Each editor operates on different sources. Each editor should have their own Editor contributor for customizing the actionbars.


    Some editor may have multipages to show different view of source, and it may allow the user to modify the source from different views. For example, the Plug-in Manifest Editor has an XML editor (page), which allow user to edit the XML source directly, and it also has an extension page, which allow user to graphically customize the XML source. In such case, the extension page and XML page share an XML editor contributor. If you want to show the statusline for different page, you can:

  • create an TextEditorActionContributor inside the MultiPageEditorActionBarContributor.

  • overwrite the init(IActionBars) and setActivePage(IEditorPart), call the TextEditorActionContributor's init and init(IActionBars) and setActiveEditor(IEditorParg).


  • Note:
  • It is not necessary for each page of an Multipage Editor to be an IEditorPart. Only the page created by addPage(IEditorPart editor, IEditorInput input) will be considered as an IEditorPart page.

  • page in Multipage editor is just a UI presentation, you can not retrieve a page directly, you can only get the index of active page.

  • inside the EditorContributor, when the setActivePage(IEditorPart) is called, if the current page has no editor inside(i.e., not created by addPage(IEditorPart)), then the IEditorPart will be null.
  • 0 Comments:

    Post a Comment

    << Home