Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

Nebula NebulaSplitButton

Revision as of 06:55, 19 March 2020 by Unnamed Poltroon (Talk) (Usage)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< Back to Nebula Main Page



This widget is a Push or Toogle Button with and attached menu. When the user clicks on the left part of the button, the action (push or toggle) is performed. Otherwise, a menu is displayed


There is three steps : First, you instantiate a SplitButton object :

final SplitButton actionButton = new SplitButton(shell, SWT.NONE);

The style can be SWT.NONE or SWT.PUSH to create an instance of a Push button, or SWT.TOGGLE for a Toggle button.

Then you get the menu associated to this button :

 final Menu actionMenu = actionButton.getMenu();

And you add the items associated to this menu :

 final MenuItem item = new MenuItem(actionMenu, SWT.PUSH);
 item.setText("First menu item");
 item.addListener(SWT.Selection, e -> System.out.println("Click on menu item 'First menu item'"));

And voilà, it is done !

The SplitButton API mimics the Button API. You can add selection listeners, change button state...


An example called is located in the plugin org.eclipse.nebula.widgets.splitbutton.snippets.

This example is also available here :

Back to the top