Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2011 itemis AG ( and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at /
 package org.eclipse.xtext.ui.editor.embedded;
import  org.eclipse.swt.SWT;

Utility to match keystrokes.

Sebastian Zarnekow - Initial contribution and API
public class ActionActivationCode {

The action id.
	public String fActionId;
The character.
	public char fCharacter;
The key code.
	public int fKeyCode= -1;
The state mask.
	public int fStateMask= SWT.DEFAULT;

Creates a new action activation code for the given action id.

actionId the action id
	public ActionActivationCode(String actionId) {

Returns true if this activation code matches the given verify event.

event the event to test for matching
whether this activation code matches event
	public boolean matches(VerifyEvent event) {
		return (event.character ==  &&
					( == -1 || event.keyCode == ) &&
					( == SWT.DEFAULT || event.stateMask == ));
New to GrepCode? Check out our FAQ X