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.
Open the
fragment.e4xmi
of thecom.packtpub.e4.clock.ui
project.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
.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 dialog by navigating to the File | New | Other menu and then try Cmd + 9 or Ctrl + 9 again.