Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8338337

SplitMenuButton constructors should match MenuButton

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • jfx24
    • javafx
    • None
    • source
    • minimal
    • Adding new constructors poses no compatibility risk.
    • Java API
    • JDK

      Summary

      Add constructors to SplitMenuButton to match its superclass MenuButton.

      Problem

      SplitMenuButton class, which extends MenuButton class and is rather similar, is missing constructors that allow for specifying the button text and/or graphic.

      Solution

      Solution is to add missing constructors.

      Specification

      +    /**
      +     * Creates a new empty split menu button with the given text to display on the
      +     * button. Use {@link #setGraphic(Node)} and {@link #getItems()} to set the
      +     * content.
      +     *
      +     * @param text the text to display on the menu button
      +     * @since 24
      +     */
      +    public SplitMenuButton(String text) {
      +
      +    /**
      +     * Creates a new empty split menu button with the given text and graphic to
      +     * display on the button. Use {@link #getItems()} to set the content.
      +     *
      +     * @param text the text to display on the menu button
      +     * @param graphic the graphic to display on the menu button
      +     * @since 24
      +     */
      +    public SplitMenuButton(String text, Node graphic) {
      +
      +    /**
      +     * Creates a new split menu button with the given text and graphic to
      +     * display on the button, and inserts the given items
      +     * into the {@link #getItems() items} list.
      +     *
      +     * @param text the text to display on the menu button
      +     * @param graphic the graphic to display on the menu button
      +     * @param items the items to display in the popup menu
      +     * @since 24
      +     */
      +    public SplitMenuButton(String text, Node graphic, MenuItem... items) {

            angorya Andy Goryachev
            webbuggrp Webbug Group
            Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: