There's no possibility to programmatically select an item in ContextMenu.
WebView needs this functionality. It uses a ContextMenu to emulate a drop down list of the html <select> tag. The list may be quite long (e.g. a list of countries),
in such a case it's usually (and should be) possible to navigate the list by typing a first character of an item's title. The first item with a title starting with the character
gets automatically selected.
All the logic (processing kbd input and matching an appropriate item) is already implemented on webkit side. WebView, as a platform component implementing
the webkit front-end, is only required to select an item of a specified serial number in ContextMenu.
The ContextMenu skin has that logic implemented. So, ContextMenu only lacks an appropriate API method.
WebView needs this functionality. It uses a ContextMenu to emulate a drop down list of the html <select> tag. The list may be quite long (e.g. a list of countries),
in such a case it's usually (and should be) possible to navigate the list by typing a first character of an item's title. The first item with a title starting with the character
gets automatically selected.
All the logic (processing kbd input and matching an appropriate item) is already implemented on webkit side. WebView, as a platform component implementing
the webkit front-end, is only required to select an item of a specified serial number in ContextMenu.
The ContextMenu skin has that logic implemented. So, ContextMenu only lacks an appropriate API method.
- blocks
-
JDK-8088057 select a drop down menu item by typing a first letter
- Open