public void focusGained(FocusEvent e) { // Ctrl+Enter shortcut only works when the focus is on the commit message text String commitButtonTooltip = MessageFormat.format( UIText.StagingView_CommitToolTip, UIUtils.SUBMIT_KEY_STROKE.format()); commitButton.setToolTipText(commitButtonTooltip); }
/** * Converts the provided key combination code to accelerator. * * @param accelerator * The accelerator to convert; should be a valid SWT accelerator * value. * @return The equivalent key stroke; never <code>null</code>. */ private String keyToStr(final int accelerator) { return SWTKeySupport.convertAcceleratorToKeyStroke(accelerator) .format(); }
/** * Formats the given key stroke or click name and the modifier keys * to a key binding string that can be used in action texts. * * @param modifierKeys the modifier keys * @param keyOrClick a key stroke or click, e.g. "Double Click" * @return the formatted keyboard shortcut string, e.g. "Shift+Double Click" * * @since 3.8 */ public static final String formatKeyBindingString(int modifierKeys, String keyOrClick) { // this should actually all be delegated to KeyStroke class return KeyStroke.getInstance(modifierKeys, KeyStroke.NO_KEY).format() + keyOrClick; }
private static String getEnterBinding() { return KeyStroke.getInstance(KeyLookupFactory.getDefault().formalKeyLookup(IKeyLookup.CR_NAME)).format(); }
protected static String getEnterBinding() { return KeyStroke.getInstance(KeyLookupFactory.getDefault().formalKeyLookup(IKeyLookup.CR_NAME)).format(); }
private static String getEnterBinding() { return KeyStroke.getInstance(KeyLookupFactory.getDefault().formalKeyLookup(IKeyLookup.CR_NAME)).format(); }
private static String getEnterBinding() { return KeyStroke.getInstance(KeyLookupFactory.getDefault().formalKeyLookup(IKeyLookup.CR_NAME)).format(); }
KeyStroke incompleteStroke = KeyStroke.getInstance(modifierKeys, KeyStroke.NO_KEY); int incompleteStrokeLength = incompleteStroke.format().length(); if ((startTextIndex + incompleteStrokeLength) <= start) { final KeyStroke[] added = new KeyStroke[newLength + 1];
KeyStroke incompleteStroke = KeyStroke.getInstance(modifierKeys, KeyStroke.NO_KEY); int incompleteStrokeLength = incompleteStroke.format().length(); if ((startTextIndex + incompleteStrokeLength) <= start) { final KeyStroke[] added = new KeyStroke[newLength + 1];
KeyStroke incompleteStroke = KeyStroke.getInstance(modifierKeys, KeyStroke.NO_KEY); int incompleteStrokeLength = incompleteStroke.format().length(); if ((startTextIndex + incompleteStrokeLength) <= start) { final KeyStroke[] added = new KeyStroke[newLength + 1];
UIUtils.addBulbDecorator(textField, NLS.bind( UIText.PushToGerritPage_ContentProposalHoverText, stroke.format()));
UIUtils.addBulbDecorator(textField, NLS.bind( UIText.FetchGerritChangePage_ContentAssistTooltip, stroke.format()));
UIUtils.addBulbDecorator(textField, NLS.bind( UIText.GerritConfigurationPage_BranchTooltipHover, stroke.format()));
final KeyStroke trappedKey = (KeyStroke) trappedKeyItr.next(); final MenuItem menuItem = new MenuItem(menuButtonAddKey, SWT.PUSH); menuItem.setText(trappedKey.format()); menuItem.addSelectionListener(widgetSelectedAdapter(e -> { textTriggerSequenceManager.insert(trappedKey);
textField, NLS.bind(UIText.UIUtils_PressShortcutMessage, stroke.format()));
textField, NLS.bind(UIText.UIUtils_PressShortcutMessage, stroke.format()));
final KeyStroke trappedKey = (KeyStroke) trappedKeyItr.next(); final MenuItem menuItem = new MenuItem(addKeyMenu, SWT.PUSH); menuItem.setText(trappedKey.format()); menuItem.addSelectionListener(widgetSelectedAdapter(e -> { fKeySequenceText.insert(trappedKey);