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

Re-implement code in ContextMenuContent for possible to have mnemonic duplicates

    XMLWordPrintable

Details

    Description

      This changeset causes a NPE and needs to be reworked. It seems like this is something MenuItem itself should handle?

      @@ -429,8 +428,10 @@
               int index = getLongestLabel();
               itemsContainer.getChildren().clear();
               if (!getItems().isEmpty()) {
      - final MenuItem item = getItems().get(index);
      - MenuItemContainer menuItemContainer = new MenuItemContainer(item);
      + // We need to strip mnemonic symbols to avoid mnemonic duplicates
      + String itemText = new TextBinding(getItems().get(index).getText()).getText().
      + replaceAll("_", "__").replaceAll("@", "@@");
      + MenuItemContainer menuItemContainer = new MenuItemContainer(new MenuItem(itemText));
                   itemsContainer.getChildren().add(menuItemContainer);
               }
           }

      Attachments

        Issue Links

          Activity

            People

              msladecek Martin Sládeček
              dgrieve David Grieve
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: