Details
-
Bug
-
Resolution: Fixed
-
P4
-
8u20
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);
}
}
@@ -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
- relates to
-
JDK-8093883 NPE from Ensemble8 "Overlay Media Sample" when click on context menu
- Resolved