org.eclipse.jface.bindings.keys.SWTKeySupport Java Examples

The following examples show how to use org.eclipse.jface.bindings.keys.SWTKeySupport. 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: QuickOutlinePopup.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.2
 */
public void setEvent(Event event) {
	this.invokingKeystrokeFormatted = KeySequence
			.getInstance(SWTKeySupport.convertAcceleratorToKeyStroke(SWTKeySupport.convertEventToUnmodifiedAccelerator(event)))
			.format();
	this.invokingKeystroke = KeyStroke.getInstance(event.stateMask, event.keyCode);
}
 
Example #2
Source File: QuickOutline.java    From KaiZen-OpenAPI-Editor with Eclipse Public License 1.0 4 votes vote down vote up
protected boolean isInvocationEvent(KeyEvent e) {
    int accelerator = SWTKeySupport.convertEventToUnmodifiedAccelerator(e);
    KeySequence keySequence = KeySequence.getInstance(SWTKeySupport.convertAcceleratorToKeyStroke(accelerator));

    return keySequence.startsWith(triggerSequence, true);
}
 
Example #3
Source File: KeyBindingHelper.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public static boolean isKeyEventComplete(Event event)
{
	// Is this a complete KeyStroke
	return SWTKeySupport.convertAcceleratorToKeyStroke(SWTKeySupport.convertEventToUnmodifiedAccelerator(event))
			.isComplete();
}
 
Example #4
Source File: GamaKeyBindings.java    From gama with GNU General Public License v3.0 2 votes vote down vote up
public static String format(final int mod, final int key) {

		return SWTKeySupport.getKeyFormatterForPlatform().format(KeyStroke.getInstance(mod, key));
	}