Java Code Examples for org.eclipse.swt.SWT#F3
The following examples show how to use
org.eclipse.swt.SWT#F3 .
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: FileViewerWindow.java From AppleCommander with GNU General Public License v2.0 | 5 votes |
/** * The toolbar command handler contains the global toolbar * actions. The intent is that the listener is then added to * multiple visual components. */ public Listener createToolbarCommandHandler() { return new Listener() { public void handleEvent(Event event) { if (event.type == SWT.KeyUp) { if ((event.stateMask & SWT.CTRL) != 0) { // CTRL+key switch (event.character) { case CTRL_C: getContentTypeAdapter().copy(); break; case CTRL_A: getContentTypeAdapter().selectAll(); break; case CTRL_P: getContentTypeAdapter().print(); break; } } else if ((event.stateMask & SWT.ALT) == 0) { // key alone switch (event.keyCode) { case SWT.F2: // the "native" file format (image, text, etc) getNativeFilterAdapter().display(); setFilterToolItemSelection(true, false, false); break; case SWT.F3: // Hex format getHexFilterAdapter().display(); setFilterToolItemSelection(false, true, false); break; case SWT.F4: // "Raw" hex format getRawDumpFilterAdapter().display(); setFilterToolItemSelection(false, false, true); break; } } } } }; }
Example 2
Source File: GuiMenuWidgets.java From hop with Apache License 2.0 | 4 votes |
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; }