0

Following the question (Contributing to the Status Bar/Trim in Eclipse RCP) I want to contribute to the status bar of my RCP (3.x) text editor.

In the org.eclipse.ui.menuContributions extensions, I have to use toolbar:org.eclipse.ui.trim.status as the locationURI. So I can can contribute commands/custom controls to the status bar.

Since my app is a text editor, I want to use the same controls (Labels) that the Eclipse IDE uses for Insert/OverWrite and line caret information (line and column position).

Which are the classes required to show such information?

enter image description here

J Robes
  • 467
  • 1
  • 6
  • 19
  • If your editor is based on `AbstractTextEditor` (or one of its subclasses) most of this should be automatic. You can also call `AbstractTextEditor.updateStatusField` – greg-449 May 24 '23 at 11:49
  • @greg-449, The editor extends ```org.eclipse.ui.editors.text.TextEditor```, so is based on ```AbstractTextEditor```, but I dont know how to connect it with the status bar that I have declared in ```ApplicationWorkbenchWindowAdvisor``` setting up the ```IWorkbenchWindowConfigurer``` (```configurer.setShowStatusLine(true)```) – J Robes May 24 '23 at 12:15
  • Well TextEditor should find the standard status line automatically. The editor action contributor class (`BasicTextEditorActionContributor` for example) defines status fields in the status area. `ITextEditorActionConstants.STATUS_xxx` defines ids for the standard status area) – greg-449 May 25 '23 at 06:05

1 Answers1

0

This is the solution I found. After @greg-449 commnet I realized that I have not included the contribution class (BasicTextEditorActionContributor) into the extension point.

This is the final extension to the editor plugin:

<extension
         point="org.eclipse.ui.editors">
      <editor
            class="yourEditorClass"
            contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
            default="false"
            icon="icons/editorIcon.png"
            id="youreditorId"
            name="your editor name">
      </editor>    
</extension>
J Robes
  • 467
  • 1
  • 6
  • 19