在Eclipse表单部分工具栏中切换按钮

问题描述:

如何在Eclipse UI Forms的部分工具栏中实现切换按钮,如下图所示?
我只找到向部分工具栏添加操作的示例。

How do I implement a toggle button, as pictured below, in the section toolbar of Eclipse UI Forms? I only find examples for adding actions to the section toolbar.

我认为关键是: IAction。 AS_CHECK_BOX

    toggleBotton = new Action(Messages.toolTipMessage, IAction.AS_CHECK_BOX) {
        @Override
        public void run() {

        }
    };

    toggleBotton.setImageDescriptor(...);
    toggleBotton.setEnabled(...);
    getManagedForm().getForm().getToolBarManager().add(toggleBotton);