2015-11-06 71 views
0

我创建了自己的编辑器并扩展了TextEditor。 当我用TextEditor打开文件时,我可以选择切换到块选择模式。但是当使用我自己的编辑器时,功能缺失。我想我必须以某种方式在我的plugin.xml中添加命令。 我目前正在eclipse-code内搜索以查找他们将菜单添加到工具栏的位置。但找不到它。 有什么建议吗?在eclipse中为“自定义编辑器”添加“块选择”模式

回答

2

这是在org.eclipse.ui.workbench.texteditor插件中声明的。

的切换块选择命令的命令ID是org.eclipse.ui.edit.text.toggleBlockSelectionMode

动作用老式org.eclipse.ui.actionSets扩展点定义:

<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> 

在文本编辑器动作ID是ITextEditorActionConstants.BLOCK_SELECTION_MODE。该操作在方法中的org.eclipse.ui.texteditor.AbstractTextEditor中创建。

0

如何添加“阻止选择”按钮到Eclipse的工具栏:

转到窗口 - 自定义何卫青--- 在新冒出来的窗口, 转到表“命令组缴费”,选择“编辑器演示文稿“ 然后转到表格”工具栏可见性“,选择”编辑演示文稿“ 单击确定按钮。

相关问题