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

Add API to prevent "hide on click" for specific nodes in ToolBar overflow menu

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 7u25, 8
    • Fix Version/s: tbd
    • Component/s: javafx
    • Environment:

      Mac OSX 10.7.5; JDK 1.7.0_25 and JDK 1.8.0 ea b102.

      Description

      This references the OTN discussion at https://forums.oracle.com/thread/2561126

      The ToolBar allows addition of arbitrary nodes. When there is not enough space, "overflow" nodes are wrapped in a CustomMenuItem and displayed in a ContextMenu. Since there is no API to access the CustomMenuItems, there is no opportunity to call setHideOnClick(...) on these menu items. Consequently, controls added to the ToolBar that require user interaction (such as ComboBoxes) become non-functional when they appear in the overflow menu.

      I'm not entirely sure what this API should be. One possibility might be to allow a property to be set on a Node that indicates that it should be wrapped in a CustomMenuItem with setHideOnClick(...) set to the specified value. A method could then be provided in ToolBar to allow this property to be set:
      public static setHideOnClickInOverflowMenu(Node node, boolean hideOnClick)
      The ToolBarSkin would then check for this property and call setHideOnClick(...) on the CustomMenuItem as appropriate.

      (Perhaps better would be to provide this API in CustomMenuItem and apply the specified value to any CustomMenuItem wrapping the node.)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jdenvirjfx James Denvir (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported: