本文整理汇总了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;
}
示例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$
}
示例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;
}
示例4: getOpenDialogBinding
import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
/**
* WARNING: only works in workbench window context!
*
* @return the keybinding for Refactor > 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$
}
示例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();
}
示例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) };
}
示例7: 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= (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$
}
示例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;
}
示例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();
}