Split button

A split button is a widget composed of an action button in addition to a drop-down button which are shown beside each other.

The action button of a WSplitButton is implemented as a WPushButton while the drop-down button is implemented as a push button with a WPopupMenu.

Example
source
  void SplitButton() {
    WContainerWidget container = new WContainerWidget();
    WSplitButton sb = new WSplitButton("Save", (WContainerWidget) container);
    final WText out = new WText((WContainerWidget) container);
    out.setMargin(new WLength(10), EnumSet.of(Side.Left));
    WPopupMenu popup = new WPopupMenu();
    WPopupMenu popup_ = popup;
    popup_.addItem("Save As ...");
    popup_.addItem("Save Template");
    sb.getDropDownButton().setMenu(popup);
    sb.getActionButton()
        .clicked()
        .addListener(
            this,
            () -> {
              out.setText("Saved!");
            });
    popup_
        .itemSelected()
        .addListener(
            this,
            (WMenuItem item) -> {
              out.setText(item.getText());
            });
  }