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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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);