/*
 * JBoss, Home of Professional Open Source
 * Copyright 2010, Red Hat, Inc. and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.jboss.test.selenium.guard;

import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;

/**
 * This utility class contains the collections of commands of specific types.
 * 
 * @author lfryc
 * 
 */
public final class GuardedCommands {

    /**
     * Collection of interactive commands
     */
    public static final Set<String> INTERACTIVE_COMMANDS = initInteractiveCommands();

    private GuardedCommands() {
    }

    /**
     * Inits the set of interactive commands.
     * 
     * @return the set of the interactive selenium commands
     */
    public static Set<String> initInteractiveCommands() {
        return Collections.unmodifiableSortedSet(new TreeSet<String>(Arrays.asList(new String[]{"click", "doubleClick",
            "contextMenu", "clickAt", "doubleClickAt", "contextMenuAt", "fireEvent", "focus", "keyPress",
            "shiftKeyDown", "shiftKeyUp", "metaKeyDown", "metaKeyUp", "altKeyDown", "altKeyUp", "controlKeyDown",
            "controlKeyUp", "keyDown", "keyUp", "mouseOver", "mouseOut", "mouseDown", "mouseDownRight",
            "mouseDownRightAt", "mouseUp", "mouseUpRight", "mouseUpAt", "mouseUpRightAt", "mouseMove", "mouseMoveAt",
            "typeKeys", "check", "uncheck", "select", "addSelection", "removeSelection", "removeAllSelections",
            "submit", "getEval", "dragdrop", "dragAndDrop", "dragAndDropToObject", "keyDownNative", "keyUpNative",
            "keyPressNative"})));
    }
}

@@ -1760,17 +1760,19 @@
 ng%5B%5D
-%7B
+ %7B 
 %22click%22,
  %22do
@@ -1767,16 +1767,28 @@
 %22click%22,
+%0A           
  %22double
@@ -1794,28 +1794,16 @@
 eClick%22,
-%0A           
  %22contex
@@ -1880,20 +1880,8 @@
 us%22,
- %22keyPress%22,
 %0A   
@@ -1888,16 +1888,28 @@
         
+ %22keyPress%22,
  %22shiftK
@@ -1984,16 +1984,28 @@
 tKeyUp%22,
+%0A           
  %22contro
@@ -2014,28 +2014,16 @@
 eyDown%22,
-%0A           
  %22contro
@@ -2088,16 +2088,28 @@
 seDown%22,
+%0A           
  %22mouseD
@@ -2118,28 +2118,16 @@
 nRight%22,
-%0A           
  %22mouseD
@@ -2192,24 +2192,36 @@
 eUpRightAt%22,
+%0A           
  %22mouseMove%22
@@ -2236,28 +2236,24 @@
 MoveAt%22,
-%0A           
+ %22type%22,
  %22typeKe
@@ -2294,32 +2294,44 @@
  %22addSelection%22,
+%0A           
  %22removeSelectio
@@ -2356,28 +2356,16 @@
 ctions%22,
-%0A           
  %22submit
@@ -2400,24 +2400,36 @@
 ragAndDrop%22,
+%0A           
  %22dragAndDro
@@ -2471,28 +2471,16 @@
 Native%22,
-%0A           
  %22keyPre
@@ -2488,16 +2488,17 @@
 sNative%22
+ 
 %7D)));%0A  

add 'type' to list of interactive commands