1package org.openqa.selenium.interactions;2import org.openqa.selenium.WebElement;3public interface Encodable {4 CharSequence encode();5}6package org.openqa.selenium.interactions;7import org.openqa.selenium.interactions.Encodable;8public class KeyUpAction extends SingleKeyAction implements Encodable {9 public KeyUpAction(Keyboard keyboard, Mouse mouse, CharSequence keySequence) {10 super(keyboard, mouse, keySequence);11 }12 public void perform() {13 keyboard.release(getKeySequence());14 }15 public CharSequence encode() {16 return String.format("%sUp", getKeySequence());17 }18}19package org.openqa.selenium.interactions;20import org.openqa.selenium.interactions.Encodable;21public class KeyDownAction extends SingleKeyAction implements Encodable {22 public KeyDownAction(Keyboard keyboard, Mouse mouse, CharSequence keySequence) {23 super(keyboard, mouse, keySequence);24 }25 public void perform() {26 keyboard.press(getKeySequence());27 }28 public CharSequence encode() {29 return String.format("%sDown", getKeySequence());30 }31}32package org.openqa.selenium.interactions;33import org.openqa.selenium.interactions.Encodable;34public class ClickAction extends MouseAction implements Encodable {35 public ClickAction(Mouse mouse, Locatable locationProvider) {36 super(mouse, locationProvider);37 }38 public void perform() {39 mouse.click(getActionLocation());40 }41 public CharSequence encode() {42 return "click";43 }44}45package org.openqa.selenium.interactions;46import org.openqa.selenium.interactions.Encodable;47public class DoubleClickAction extends MouseAction implements Encodable {48 public DoubleClickAction(Mouse mouse, Locatable locationProvider) {49 super(mouse, locationProvider);50 }51 public void perform() {52 mouse.doubleClick(getActionLocation());53 }54 public CharSequence encode() {55 return "doubleClick";56 }57}58package org.openqa.selenium.interactions;59import org.openqa.selenium.interactions.Encodable;