com.atlassian.webtest.ui.keys
Enum SpecialKeys

java.lang.Object
  extended by java.lang.Enum<SpecialKeys>
      extended by com.atlassian.webtest.ui.keys.SpecialKeys
All Implemented Interfaces:
Key, KeySequence, SpecialKey, Serializable, Comparable<SpecialKeys>

public enum SpecialKeys
extends Enum<SpecialKeys>
implements SpecialKey, KeySequence

Enumeration of SpecialKeys used within tests.

This enumeration also implements the KeySequence interface for convenient usage.

NOTE: Some of the keys may be actually represented as Unicode/ASCII characters, nevertheless they should be supported by implementing frameworks for the convenience of API clients.

See Also:
Key, KeySequence

Enum Constant Summary
ARROW_DOWN
           
ARROW_LEFT
           
ARROW_RIGHT
           
ARROW_UP
           
BACKSPACE
           
DELETE
           
ENTER
           
ESC
           
SPACE
           
 
Method Summary
 List<Key> keys()
          An immutable list of keys to be typed.
static SpecialKeys valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SpecialKeys[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 KeySequence withEvents(KeyEventType... events)
          Construct key sequence consisting of this special key with given key events to invoke
 Set<ModifierKey> withPressed()
          A set of SpecialKeys that should be pressed during entering this sequence's KeySequence.keys().
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ENTER

public static final SpecialKeys ENTER

ESC

public static final SpecialKeys ESC

BACKSPACE

public static final SpecialKeys BACKSPACE

DELETE

public static final SpecialKeys DELETE

SPACE

public static final SpecialKeys SPACE

ARROW_LEFT

public static final SpecialKeys ARROW_LEFT

ARROW_RIGHT

public static final SpecialKeys ARROW_RIGHT

ARROW_UP

public static final SpecialKeys ARROW_UP

ARROW_DOWN

public static final SpecialKeys ARROW_DOWN
Method Detail

values

public static SpecialKeys[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SpecialKeys c : SpecialKeys.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SpecialKeys valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

keys

public List<Key> keys()
Description copied from interface: KeySequence
An immutable list of keys to be typed.

Specified by:
keys in interface KeySequence
Returns:
keys to type into the target test page element

withPressed

public Set<ModifierKey> withPressed()
Description copied from interface: KeySequence
A set of SpecialKeys that should be pressed during entering this sequence's KeySequence.keys(). If empty, no special keys should be pressed during typing.

Specified by:
withPressed in interface KeySequence
Returns:
special keys to be pressed. Should never be null

withEvents

public KeySequence withEvents(KeyEventType... events)
Construct key sequence consisting of this special key with given key events to invoke

Parameters:
events - key events to invoke for the created sequence
Returns:
new key sequence representing this key


Copyright © 2014 Atlassian. All rights reserved.