Time for action – changing contexts

The context is the location in which this binding is valid. For commands that are visible everywhere—typically the kind of options in the default menu—they can be associated with the org.eclipse.ui.contexts.dialogAndWindow context. If the command should only be invoked from dialogs, then the org.eclipse.ui.contexts.dialog context would be used instead.

  1. Open the fragment.e4xmi of the com.packtpub.e4.clock.ui project.
  2. To enable the command only for dialogs, go to the Binding Context, and modify the Reference-ID to point to org.eclipse.ui.contexts.dialog.
  3. Run the Eclipse instance, and try the command with Cmd + 9 or Ctrl + 9 depending on platform. The command should not work unless a dialog is being shown. Open a ...

Get Eclipse Plug-in Development Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.