当前位置: 首页>>代码示例>>Java>>正文


Java IBindingService.getBestActiveBindingFormattedFor方法代码示例

本文整理汇总了Java中org.eclipse.ui.keys.IBindingService.getBestActiveBindingFormattedFor方法的典型用法代码示例。如果您正苦于以下问题:Java IBindingService.getBestActiveBindingFormattedFor方法的具体用法?Java IBindingService.getBestActiveBindingFormattedFor怎么用?Java IBindingService.getBestActiveBindingFormattedFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.keys.IBindingService的用法示例。


在下文中一共展示了IBindingService.getBestActiveBindingFormattedFor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFormattedShortcut

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
private String getFormattedShortcut(String commandId, Event trigger) {
	IPreferenceStore store = getPreferenceStore();

	int accelerator = SWTKeySupport.convertEventToUnmodifiedAccelerator(trigger);
	KeyStroke keyStroke = SWTKeySupport.convertAcceleratorToKeyStroke(accelerator);

	if (KeyStroke.NO_KEY != keyStroke.getNaturalKey()) {
		if (store.getBoolean(PREF_KEY_SHORTCUTS_ENABLED)) {
			String formattedStroke = SWTKeySupport.getKeyFormatterForPlatform().format(keyStroke);
			if (debug && debugTrace != null) {
				debugTrace.trace(DEBUG_PATH, "Formatted stroke is: " + formattedStroke); //$NON-NLS-1$
			}
			return formattedStroke;
		} else { // keystroke found, but we're disabled
			return null;
		}
	}

	else if (store.getBoolean(PREF_KEY_MOUSE_TRIGGER_ENABLED)) {
		IBindingService bindingService = (IBindingService) getWorkbench().getService(IBindingService.class);
		return bindingService.getBestActiveBindingFormattedFor(commandId);
	}

	return null;
}
 
开发者ID:chgeo,项目名称:show-shortcuts,代码行数:26,代码来源:Activator.java

示例2: getOpenDialogBinding

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
/**
 * WARNING: only works in workbench window context!
 * @return the keybinding for Refactor > 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$
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:12,代码来源:RenameInformationPopup.java

示例3: getStatusMessage

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
protected String getStatusMessage() {
	String binding = "<binding>";
	if (workbench != null) {
		IBindingService bindingService = (IBindingService) workbench.getAdapter(IBindingService.class);
		binding = bindingService.getBestActiveBindingFormattedFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST);
	}
	String category = getModeAwareProposalProvider().getNextCategory();
	return binding + " to show " + category;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:10,代码来源:RepeatedContentAssistProcessor.java

示例4: getOpenDialogBinding

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
/**
 * WARNING: only works in workbench window context!
 * 
 * @return the keybinding for Refactor &gt; Rename
 */
protected static String getOpenDialogBinding() {
	IBindingService bindingService = (IBindingService) 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$
}
 
开发者ID:cplutte,项目名称:bts,代码行数:14,代码来源:RenameRefactoringPopup.java

示例5: QuickOutline

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
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();
  }
 
开发者ID:RepreZen,项目名称:KaiZen-OpenAPI-Editor,代码行数:13,代码来源:QuickOutline.java

示例6: initTextMessages

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
protected String[] initTextMessages(Model model) {
	IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
	String bindingKey = bindingService.getBestActiveBindingFormattedFor(EDIT_CONTENT_ASSIST);
    	ContextType contextType = referenceProposalProvider.getContextTypes().get(model, getCurrentPath());
	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) };
}
 
开发者ID:RepreZen,项目名称:KaiZen-OpenAPI-Editor,代码行数:12,代码来源:JsonContentAssistProcessor.java

示例7: getOpenDialogBinding

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
/**
 * 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$
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:RenameInformationPopup.java

示例8: getShowInMenuLabel

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:OpenViewActionGroup.java

示例9: SuggestionBubble

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
/**
 * Constructor
 *
 * @param parent
 *            is the parent {@link Text} object, to which SuggestionBubble
 *            will be added.
 * @param targetLanguage
 *            is the language, to which the
 *            {@link SuggestionBubble.defaultText} will be translated
 */
public SuggestionBubble(Text parent, String targetLanguage) {
	shell = parent.getShell();
	text = parent;
	this.targetLanguage = targetLanguage;

	suggestionFilter = new SuggestionFilter();
	suggestions = new ArrayList<Suggestion>();

	String srcLang = System
			.getProperty("tapiji.translator.default.language");
	if (srcLang != null) {
		SRC_LANG = srcLang.substring(0, 2).toUpperCase();
	}

	if (System.getProperty("os.name").toLowerCase().contains("windows")) {
		SHELL_STYLE = PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE;
		win = true;
	} else {
		SHELL_STYLE = PopupDialog.HOVER_SHELLSTYLE;
		win = false;
	}

	// MessagesEditorPlugin.getDefault().getBundle().
	// getEntry("glossary.xml").getPath()
	// System.out.println("install path "+MessagesEditorPlugin.getDefault().getBundle().getEntry("/").getPath()+"glossary.xml");

	SuggestionProviderUtils.addSuggestionProviderUpdateListener(this);

	/*
	 * Read shortcut of content assist (code completion) directly from
	 * org.eclipse.ui.IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST and
	 * save it to CONTENT_ASSIST final variable
	 */
	IBindingService bindingService = (IBindingService) PlatformUI
			.getWorkbench().getAdapter(IBindingService.class);

	CONTENT_ASSIST = bindingService
			.getBestActiveBindingFormattedFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST);

	init();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:52,代码来源:SuggestionBubble.java


注:本文中的org.eclipse.ui.keys.IBindingService.getBestActiveBindingFormattedFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。