Fast Access to Actions

Will be implemented as part of Quick Search Feature

This document describes planned feature of Fast Access to various types of actions to NetBeans IDE and Platform.

What is it and how it works

  • Fast Access to actions is fast way how to invoke system actions from keyboard - based on user's typed text which works as a filter.
  • As user writes, system is searching in pool of available actions and shows such actions that are related to typed 'filter' text. In most cases, it means that display name of action contains substring written by user.
  • User chooses action from resulting filtered list and action is invoked.

Why to implement it

  • Useful for non-frequent users - helps significantly in system exploration
  • Useful for expert users - speeds search for actions which are not used everyday
  • Concurrent products has it (Eclipse has "Quick Access" available on Ctrl+3 shortcut)
  • Win Vista has it - textual search in Start menu

UI sketch


  • As user writes text into text field, list of available items is filtered and only relevant actions are shown (search for substring in textual representations of items, could also support "camel case" searching)
  • Filtered output is organized into sections, shown through one level always expanded tree (or other good UI for such sectioning)
  • Only actions enabled at the moment are shown in the list
  • Previous user searches are remembered and offered as first items in next tool invocation when no text is written by user yet. Previous searches are even persistent, living across system sessions.
  • When UI is opened and no text is written, names of all sections are shown (maybe grayed)
  • List of possible matches in each section is limited to max 5-6 items by default. User can switch to "show all" mode by pressing shorcut that invokes the tool again (similarly like repeated shortcut in code completion)
  • User invokes chosen action by pressing Enter on selected row or by mouse clicking
  • Mouse click outside the window or Esc key will close tool UI, without any action taken
  • Keyboard works smoothly between text field and result list - down arrow is for moving from text field to result list, up arrow to return to the text field
  • Filtering must be fast - results updated as user is typing the text
  • For items in menu section, user should see where in menu actions exists (probably written path in the text)
  • When shortcut is pressed while keyboard focus is in text field, actions that are invoked by this shortcut should appear in results area (analogy to Emacs "where is command", see Jesse's note below)
  • Shortcuts and texts in text field can't be mixed
  • Items in results area has tooltip that displays item hint
  • text field has tooltip like "Type action name or press action shortcut to search"
  • somewhere in the UI (probably on bottom part) there is hint for switching between partial and full results
  • Found substring or part of shortcut will be marked in all results items (part of text is bold + slightly changed color to the orange, red tone)

Pending UI issues

  • Text field could be shown directly in menu or main toolbar, should be optional
  • UI showing list of matches would be shown after text field gains keyboard focus (either by mouse press or by shortcut invocation)
  • Shortcut that invokes the tool
  • For items in "menu" section, right click or Shift+F10 on selected item brings popup menu, which contains "Invoke" and "Show in menu" actions
  • When Enter is pressed while focus is in text field, probably first action in the list should be invoked. To enable this, first action should be visually marked somehow.
  • Some kind of completion when searching for action names

Implementation thoughts

  • Sections and their order defined declaratively, in xml layer
  • SPI to enable plugging of various content providers
  • Default implementation should contain providers for majority of actions that exist in menus and action pool

Rough resource estimations

  • Functional prototype - one week of manwork
  • Productized state - 3-6 weeks of manwork (full API review, tests)

Emacs solution

JesseGlick: look at Emacs' solution. All commands can always be run using M-x command-name ENTER, whether or not they also have an accelerator. After typing M-x, you get tab completion on the command name. You can also use C-h a (M-x apropos-command) to get a list of commands matching some string, e.g. after typing scroll you will see

scroll-bar-toolkit-scroll     <vertical-scroll-bar> <mouse-1>
  Command: (not documented)
scroll-down                   M-v, <prior>
  Command: Scroll text of current window down ARG lines.
scroll-left                   C-x <, <C-next>
  Command: Scroll selected window display ARG columns left.
scroll-lock-mode              M-x ... RET
  Command: Minor mode for pager-like scrolling.

Similarly, you get C-h w (where-is-command) to find the accelerator for a named command, or C-h k (describe-key) to display documentation incl. command name for an accelerator. There are other help commands, e.g. C-h b to show key bindings active in the current context. Taken together, it is relatively easy to discover relevant commands and their accelerators incrementally as you use the tool.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo