Toggle Button in Eclipse Forms Section Toolbar

后端 未结 1 1269
忘掉有多难
忘掉有多难 2021-01-22 17:09

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条回答
  •  礼貌的吻别
    2021-01-22 17: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);
    

    0 讨论(0)
提交回复
热议问题