org.eclipse.ui.keys.IBindingService#getBestActiveBindingFormattedFor ( )源码实例Demo

下面列出了org.eclipse.ui.keys.IBindingService#getBestActiveBindingFormattedFor ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

protected String getStatusMessage() {
	String binding = "<binding>";
	if (workbench != null) {
		IBindingService bindingService = workbench.getAdapter(IBindingService.class);
		binding = bindingService.getBestActiveBindingFormattedFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST);
	}
	String category = getModeAwareProposalProvider().getNextCategory();
	return binding + " to show " + category;
}
 
源代码2 项目: xtext-eclipse   文件: RenameRefactoringPopup.java
/**
 * WARNING: only works in workbench window context!
 * 
 * @return the keybinding for Refactor &gt; Rename
 */
protected static String getOpenDialogBinding() {
	IBindingService bindingService = PlatformUI.getWorkbench().getAdapter(IBindingService.class);
	if (bindingService == null)
		return ""; //$NON-NLS-1$
	String binding = bindingService
			.getBestActiveBindingFormattedFor("org.eclipse.xtext.ui.refactoring.RenameElement");
	return binding == null ? "" : binding; //$NON-NLS-1$
}
 
源代码3 项目: typescript.java   文件: RenameInformationPopup.java
/**
 * WARNING: only works in workbench window context!
 * @return the keybinding for Refactor &gt; Rename
 */
private static String getOpenDialogBinding() {
	IBindingService bindingService= PlatformUI.getWorkbench().getAdapter(IBindingService.class);
	if (bindingService == null)
		return ""; //$NON-NLS-1$
	String binding= bindingService.getBestActiveBindingFormattedFor(ITypeScriptEditorActionDefinitionIds.RENAME_ELEMENT);
	return binding == null ? "" : binding; //$NON-NLS-1$
}
 
源代码4 项目: KaiZen-OpenAPI-Editor   文件: QuickOutline.java
public QuickOutline(Shell parent, JsonEditor editor, String fileContentType) {
      super(parent, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE, true, true, true, true, true, null, null);
this.fileContentType = fileContentType;

      IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
      this.bindingKey = bindingService.getBestActiveBindingFormattedFor(COMMAND_ID);
      this.triggerSequence = bindingService.getBestActiveBindingFor(COMMAND_ID);
      this.editor = editor;

      setInfoText(statusMessage());
      create();
  }
 
protected String[] initTextMessages() {
	IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
	String bindingKey = bindingService.getBestActiveBindingFormattedFor(EDIT_CONTENT_ASSIST);
       ContextType contextType = currentModel != null
               ? referenceProposalProvider.getContextTypes().get(currentModel, getCurrentPath())
               : null;
	String context = contextType != null ? contextType.label() : "";

	return new String[] { //
			String.format(Messages.content_assist_proposal_project, bindingKey, context),
			String.format(Messages.content_assist_proposal_workspace, bindingKey, context),
			String.format(Messages.content_assist_proposal_local, bindingKey, context) };
}
 
/**
 * WARNING: only works in workbench window context!
 * @return the keybinding for Refactor &gt; Rename
 */
private static String getOpenDialogBinding() {
	IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class);
	if (bindingService == null)
		return ""; //$NON-NLS-1$
	String binding= bindingService.getBestActiveBindingFormattedFor(IJavaEditorActionDefinitionIds.RENAME_ELEMENT);
	return binding == null ? "" : binding; //$NON-NLS-1$
}
 
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 ActionMessages.OpenViewActionGroup_showInAction_label + '\t' + keyBinding;
}