Example #1
0
  private static String getShowInMenuLabel() {
    IBindingService bindingService =
        (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
    if (bindingService != null) {
      String keyBinding =
          bindingService.getBestActiveBindingFormattedFor(
              IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_QUICK_MENU);
      if (keyBinding != null) return UIText.UIUtils_ShowInMenuLabel + '\t' + keyBinding;
    }

    return UIText.UIUtils_ShowInMenuLabel;
  }
  private String getShowInMenuLabel() {
    String keyBinding = null;

    IBindingService bindingService =
        (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
    if (bindingService != null)
      keyBinding =
          bindingService.getBestActiveBindingFormattedFor(
              IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_QUICK_MENU);

    if (keyBinding == null) keyBinding = ""; // $NON-NLS-1$

    return "Sho&w In" + '\t' + keyBinding;
  }
 /**
  * Returns the shortcut assigned to the sub menu or <code>null</code> if no short cut is assigned.
  *
  * @return the shortcut as a human readable string or <code>null</code>
  */
 private String getShortcutString() {
   IBindingService bindingService =
       (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
   if (bindingService == null) return null;
   return bindingService.getBestActiveBindingFormattedFor(getActionDefinitionId());
 }