Java Code Examples for org.eclipse.swt.SWT#F9

The following examples show how to use org.eclipse.swt.SWT#F9 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GuiMenuWidgets.java    From hop with Apache License 2.0 4 votes vote down vote up
public static String getShortcutString( KeyboardShortcut shortcut ) {
  String s = shortcut.toString();
  if ( StringUtils.isEmpty( s ) || s.endsWith( "-" ) ) {
    // Unknown characters from the SWT library
    // We'll handle the special cases here.
    //
    int keyCode = shortcut.getKeyCode();
    if ( keyCode == SWT.BS ) {
      return s + "Backspace";
    }
    if ( keyCode == SWT.ESC ) {
      return s + "Esc";
    }
    if ( keyCode == SWT.ARROW_LEFT ) {
      return s + "LEFT";
    }
    if ( keyCode == SWT.ARROW_RIGHT ) {
      return s + "RIGHT";
    }
    if ( keyCode == SWT.ARROW_UP ) {
      return s + "UP";
    }
    if ( keyCode == SWT.ARROW_DOWN ) {
      return s + "DOWN";
    }
    if ( keyCode == SWT.HOME ) {
      return s + "HOME";
    }
    if ( keyCode == SWT.F1 ) {
      return s + "F1";
    }
    if ( keyCode == SWT.F2 ) {
      return s + "F2";
    }
    if ( keyCode == SWT.F3 ) {
      return s + "F3";
    }
    if ( keyCode == SWT.F4 ) {
      return s + "F4";
    }
    if ( keyCode == SWT.F5 ) {
      return s + "F5";
    }
    if ( keyCode == SWT.F6 ) {
      return s + "F6";
    }
    if ( keyCode == SWT.F7 ) {
      return s + "F7";
    }
    if ( keyCode == SWT.F8 ) {
      return s + "F8";
    }
    if ( keyCode == SWT.F9 ) {
      return s + "F9";
    }
    if ( keyCode == SWT.F10 ) {
      return s + "F10";
    }
    if ( keyCode == SWT.F11 ) {
      return s + "F11";
    }
    if ( keyCode == SWT.F12 ) {
      return s + "F12";
    }
  }
  return s;
}