Toggle Button in Eclipse Forms Section Toolbar

最后都变了- 提交于 2019-12-02 04:43:11

问题


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


来源:https://stackoverflow.com/questions/11222951/toggle-button-in-eclipse-forms-section-toolbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!