Toggle Button in Eclipse Forms Section Toolbar

2020-04-14 01:39发布

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.

enter image description here

1条回答
Rolldiameter
2楼-- · 2020-04-14 02:28

I think the key is: 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);
查看更多
登录 后发表回答