0

I created my own editor and Extended the TextEditor. When I open a file with the TextEditor I have the option to switch to Block selection mode. But the functionality is missing when using my own editor. I guess I have to add the command in my plugin.xml somehow. I am currently searching within the eclipse-code to finde where they add the Menu to the toolbar. But can't find it. Any suggestions?

2 Answers 2

2

This is declared in the org.eclipse.ui.workbench.texteditor plugin.

The command id for the toggle block selection command is org.eclipse.ui.edit.text.toggleBlockSelectionMode

The action is defined using the old style org.eclipse.ui.actionSets extension point:

<action
      allowLabelUpdate="true"
      definitionId="org.eclipse.ui.edit.text.toggleBlockSelectionMode"
      disabledIcon="$nl$/icons/full/dtool16/block_selection_mode.gif"
      helpContextId="org.eclipse.ui.block_selection_mode_action_context"
      icon="$nl$/icons/full/etool16/block_selection_mode.gif"
      id="org.eclipse.ui.edit.text.toggleBlockSelectionMode"
      label="%toggleBlockSelectionMode.label"
      retarget="true"
      style="toggle"
      toolbarPath="Normal/Presentation"
      tooltip="%toggleBlockSelectionMode.tooltip">
</action>

The action id in the text editor is ITextEditorActionConstants.BLOCK_SELECTION_MODE. The action is created in org.eclipse.ui.texteditor.AbstractTextEditor in the createActions method.

Sign up to request clarification or add additional context in comments.

Comments

1

for how to add the "Block Selection" button into your eclipse toolbar :

goto Window--Customize prespective--- in new came out window, goto table "Command group avaiable" , select " editor presentation " then goto table "Tool Bar visiability", select " editor presentation " click OK button.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.