com.tensegrity.gui.swt
Class SwtKeyStroke

java.lang.Object
  extended bycom.tensegrity.generic.util.KeyStroke
      extended bycom.tensegrity.gui.swt.SwtKeyStroke

public class SwtKeyStroke
extends KeyStroke

Since in SWT there is no notion of keystroke but simply one of accelerator this class is an adapted version of KeyStroke which provides a getAccelerator() method. This method can be used to set the accelerator corresponding to a KeyStroke on a MenuItem.

Version:
$Id: SwtKeyStroke.java,v 1.3 2005/07/27 08:50:41 SebastienGuyon Exp $
Author:
S�bastien Guyon

Field Summary
 
Fields inherited from class com.tensegrity.generic.util.KeyStroke
ALT_GRAPH_MASK, ALT_KEY, ALT_KEY_CODE, ALT_MASK, CTRL_KEY, CTRL_KEY_CODE, CTRL_MASK, META_MASK, NO_MASK, SHIFT_KEY, SHIFT_KEY_CODE, SHIFT_MASK
 
Constructor Summary
SwtKeyStroke(char keyChar, int keyCode, int modifiers)
           This is the default constructor.
 
Method Summary
 int getAccelerator()
           Returns the swt keystroke accelerator which can be set on menu items for instance.
 
Methods inherited from class com.tensegrity.generic.util.KeyStroke
equals, getChar, getCode, getModifiers, hashCode, isOnKeyRelease, toString, toStringModifiers
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SwtKeyStroke

public SwtKeyStroke(char keyChar,
                    int keyCode,
                    int modifiers)

This is the default constructor. The modifiers parameter is either one of the style constants SWT.ALT,SWT.CTRL, SWT.SHIFT, or must be built by bitwise OR 'ing together (that is, using the int "|" operator) two or more of those SWT style constants.

Parameters:
keyChar - the char of the key.
keyCode - an int specifying the numeric code for a key.
modifiers - an int specifying any combination of the key modifiers. Have a look at the corresponding constants.
Method Detail

getAccelerator

public int getAccelerator()

Returns the swt keystroke accelerator which can be set on menu items for instance.

Returns:
the swt keystroke accelerator.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.