package jp.sourceforge.cfneo.at4ie.api;

/**
 * 操作・検査用の各種コマンド定義用Enum。
 * @author imaitakafumi
 *
 */
public enum ActionCommandEnum {

	/*
	 * 操作系コマンド。
	 */
	ACTION_OPEN("open"),
	ACTION_CLICK("click"),
	ACTION_CLICK_AND_WAIT("clickAndWait"),
	ACTION_TYPE("type"),
	ACTION_SELECT("select"),
	ACTION_SELECT_WINDOW("selectWindow"),
	ACTION_GO_BACK("goBack"),
	ACTION_CLOSE("close"),
	ACTION_PAUSE("pause"),
	ACTION_FIRE_EVENT("fireEvent"),
	ACTION_WAIT_FOR_VALUE("waitForValue"),
	ACTION_STORE("store"),
	ACTION_STORE_VALUE("storeValue"),
	ACTION_STORE_TEXT("storeText"),
	ACTION_STORE_ATTRIBUTE("storeAttribute"),
	ACTION_CHOOSE_CANCEL_ON_NEXT_CONFIRMATION("chooseCancelOnNextConfirmation"),
	ACTION_ANSWER_ON_NEXT_PROMPT("answerOnNextPrompt"),
	ACTION_CLICK_ALERT_DIALOG_OK("clickAlertDialogOk"),

	/*
	 * 検査系コマンド(assert)。
	 */
	ASSERT_LOCATION("assertLocation"),
	ASSERT_TITLE("assertTitle"),
	ASSERT_VALUE("assertValue"),
	ASSERT_SELECTED("assertSelected"),
	ASSERT_SELECTED_OPTIONS("assertSelectOptions"),
	ASSERT_TEXT("assertText"),
	ASSERT_ATTRIBUTE("assertAttribute"),
	ASSERT_TEXT_PRESENT("assertTextPresent"),
	ASSERT_TEXT_NOT_PRESENT("ssertTextNotPresent"),
	ASSERT_ELEMENT_PRESENT("assertElementPresent"),
	ASSERT_ELEMENT_NOT_PRESENT("assertElementNotPresent"),
	ASSERT_TABLE("assertTable"),
	ASSERT_VISIBLE("assertVisible"),
	ASSERT_NOT_VISIBLE("assertNotVisible"),
	ASSERT_EDIT_TABLE("assertEditable"),
	ASSERT_NOT_EDIT_TABLE("assertNotEditable"),
	ASSERT_ALERT("assertAlert"),
	ASSERT_CONFIRMATION("assertConfirmation"),
	ASSERT_PROMPT("assertPrompt"),

	/*
	 * 検査系コマンド(verify)。
	 */
	VERIFY_LOCATION("verifyLocation"),
	VERIFY_TITLE("verifyTitle"),
	VERIFY_VALUE("verifyValue"),
	VERIFY_SELECTED("verifySelected"),
	VERIFY_SELECTED_OPTIONS("verifySelectOptions"),
	VERIFY_TEXT("verifyText"),
	VERIFY_ATTRIBUTE("verifyAttribute"),
	VERIFY_TEXT_PRESENT("verifyTextPresent"),
	VERIFY_TEXT_NOT_PRESENT("ssertTextNotPresent"),
	VERIFY_ELEMENT_PRESENT("verifyElementPresent"),
	VERIFY_ELEMENT_NOT_PRESENT("verifyElementNotPresent"),
	VERIFY_TABLE("verifyTable"),
	VERIFY_VISIBLE("verifyVisible"),
	VERIFY_NOT_VISIBLE("verifyNotVisible"),
	VERIFY_EDIT_TABLE("verifyEditable"),
	VERIFY_NOT_EDIT_TABLE("verifyNotEditable"),
	VERIFY_ALERT("verifyAlert"),
	VERIFY_CONFIRMATION("verifyConfirmation"),
	VERIFY_PROMPT("verifyPrompt"),

	/*
	 * オリジナルコマンド。
	 */
	WAIT("wait"),
	SCREEN_SHOT("screenshot"),
	INJECTION("injection")
	;

	private String value;

	/**
	 * コンストラクタ。
	 * @param value
	 */
	private ActionCommandEnum(String value) {
		this.value = value;
	}
	/**
	 * 文字列からActionCommandEnumを取得する。
	 * @param value
	 * @return
	 */
	public static ActionCommandEnum get(String value) {
		ActionCommandEnum[] items = ActionCommandEnum.values();
		for (ActionCommandEnum item :items) {
			if (item.toString().equals(value)) {
				return item;
			}
		}
		return null;
	}
	/**
	 * 文字列を取得する。
	 */
	public String toString() {
		return this.value;
	}

}
