io.selendroid.android
Enum AndroidKeys

java.lang.Object
  extended by java.lang.Enum<AndroidKeys>
      extended by io.selendroid.android.AndroidKeys
All Implemented Interfaces:
Serializable, CharSequence, Comparable<AndroidKeys>

public enum AndroidKeys
extends Enum<AndroidKeys>
implements CharSequence

Contains keys that can be sent to Android Native driver implementations of org.openqa.selenium.WebElement#sendKeys. These keys are not easily represented as strings, so an instance of this enum can be used instead. Each instance is a CharSequence that is exactly one character long, and that character is a value in the Unicode private use space.

For keys that are also in Keys, the key code in this class is the same.

Author:
Matt DeVore

Enum Constant Summary
ALT_LEFT
           
ALT_RIGHT
           
BACK
           
DEL
           
DPAD_DOWN
           
DPAD_LEFT
           
DPAD_RIGHT
           
DPAD_UP
           
ENTER
           
F1
           
F10
           
F11
           
F12
           
F2
           
F3
           
F4
           
F5
           
F6
           
F7
           
F8
           
F9
           
HOME
           
MENU
           
SEARCH
           
SHIFT_LEFT
           
SHIFT_RIGHT
           
SYM
           
 
Method Summary
 char charAt(int index)
           
 int getAndroidKeyCode()
          Returns key's corresponding Android KeyEvent code.
static boolean hasAndroidKeyEvent(char keyCode)
          Returns true if key character is defined within AndroidKeys.
static int keyCodeFor(char keyCode)
          Returns a character's corresponding Android KeyEvent code.
 int length()
           
 CharSequence subSequence(int start, int end)
           
 String toString()
           
static AndroidKeys valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AndroidKeys[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ALT_LEFT

public static final AndroidKeys ALT_LEFT

DEL

public static final AndroidKeys DEL

DPAD_DOWN

public static final AndroidKeys DPAD_DOWN

DPAD_LEFT

public static final AndroidKeys DPAD_LEFT

DPAD_RIGHT

public static final AndroidKeys DPAD_RIGHT

DPAD_UP

public static final AndroidKeys DPAD_UP

ENTER

public static final AndroidKeys ENTER

SHIFT_LEFT

public static final AndroidKeys SHIFT_LEFT

F1

public static final AndroidKeys F1

F2

public static final AndroidKeys F2

F3

public static final AndroidKeys F3

F4

public static final AndroidKeys F4

F5

public static final AndroidKeys F5

F6

public static final AndroidKeys F6

F7

public static final AndroidKeys F7

F8

public static final AndroidKeys F8

F9

public static final AndroidKeys F9

F10

public static final AndroidKeys F10

F11

public static final AndroidKeys F11

F12

public static final AndroidKeys F12

BACK

public static final AndroidKeys BACK

HOME

public static final AndroidKeys HOME

MENU

public static final AndroidKeys MENU

SEARCH

public static final AndroidKeys SEARCH

SYM

public static final AndroidKeys SYM

ALT_RIGHT

public static final AndroidKeys ALT_RIGHT

SHIFT_RIGHT

public static final AndroidKeys SHIFT_RIGHT
Method Detail

values

public static AndroidKeys[] 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 (AndroidKeys c : AndroidKeys.values())
    System.out.println(c);

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

valueOf

public static AndroidKeys 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

keyCodeFor

public static int keyCodeFor(char keyCode)
                      throws SelendroidException
Returns a character's corresponding Android KeyEvent code.

Parameters:
keyCode - character to get KeyEvent code for
Returns:
integer representing KeyEvent code
Throws:
SelendroidException

hasAndroidKeyEvent

public static boolean hasAndroidKeyEvent(char keyCode)
Returns true if key character is defined within AndroidKeys.

Parameters:
keyCode - character to check
Returns:
true if key is present within AndroidKeys

getAndroidKeyCode

public int getAndroidKeyCode()
Returns key's corresponding Android KeyEvent code.

Returns:
Android KeyEvent code

charAt

public char charAt(int index)
Specified by:
charAt in interface CharSequence

length

public int length()
Specified by:
length in interface CharSequence

subSequence

public CharSequence subSequence(int start,
                                int end)
Specified by:
subSequence in interface CharSequence

toString

public String toString()
Specified by:
toString in interface CharSequence
Overrides:
toString in class Enum<AndroidKeys>


Copyright © 2014. All rights reserved.