private MenuButton buildSubmenu(MenuItem item) {
    Menu menu = (Menu) item;
    MenuButton menuButton = new MenuButton();
    menuButton.setPopupSide(Side.RIGHT);
    menuButton.graphicProperty().bind(menu.graphicProperty());
    menuButton.textProperty().bind(menu.textProperty());
    menuButton.disableProperty().bind(menu.disableProperty());
    menuButton.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    menuButton.getStyleClass().addAll(item.getStyleClass());
    Bindings.bindContent(menuButton.getItems(), menu.getItems());

    // To determine if a TOUCH_RELEASED event happens.
    // The MOUSE_ENTERED results in an unexpected behaviour on touch events.
    // Event filter triggers before the handler.
    menuButton.addEventFilter(TouchEvent.TOUCH_RELEASED, e -> isTouchUsed = true);

    // Only when ALWAYS or SOMETIMES
    if (!Priority.NEVER.equals(getSkinnable().getMenuHoverBehavior())) {
      menuButton.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> { // Triggers on hovering over Menu
        if (isTouchUsed) {
          isTouchUsed = false;
          return;
        }
        // When ALWAYS, then trigger immediately. Else check if clicked before (case: SOMETIMES)
        if (Priority.ALWAYS.equals(getSkinnable().getMenuHoverBehavior())
            || (hoveredBtn != null && hoveredBtn.isShowing())) {
          menuButton.show(); // Shows the context-menu
          if (hoveredBtn != null && hoveredBtn != menuButton) {
            hoveredBtn.hide(); // Hides the previously hovered Button if not null and not self
          }
        }
        hoveredBtn = menuButton; // Add the button as previously hovered
      });
    }
    return menuButton;
  }
Defines the layout of all parts in the skin.
workbenchfx-core/src/main/java/com/dlsc/workbenchfx/view/controls/NavigationDrawerSkin.java