// Copyright 2012 Georg-August-Universität Göttingen, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package de.ugoe.cs.autoquest.eventcore.gui; import java.util.Collections; import java.util.List; import de.ugoe.cs.autoquest.eventcore.Event; /** *
* A text input represents a list of key events that together represent entering text into a text * field or text area. *
* * @version 1.0 * @author Patrick Harms, Steffen Herbold */ public class TextInput implements IInteraction { /** ** Defines how the {@link TextInput}s are evaluated as equal. *
* * @version 1.0 * @author Steffen Herbold */ public enum TextEquality { /** ** Two text inputs are equal if their {@link TextInput#textInputEvents} are equal. *
*/ LEXICAL, /** ** Two text inputs are equal if their {@link TextInput#enteredText}s are equal. *
*/ SYNTACTICAL, /** ** All text inputs are equal. *
*/ SEMANTICAL }; /** ** Id for object serialization. *
*/ private static final long serialVersionUID = 1L; /** ** The text resulting from the text input events. *
*/ private String enteredText; /** ** The text input events that caused the entering of the text. *
*/ private List* Defines how this TextInput event evaluates the equality. *
*/ private final TextEquality equalityType; /** ** Constructor. Creates a new {@link TextInput} with {@link TextEquality#LEXICAL} equality. *
* * @param enteredText * text resulting from the inputs * @param textInputEvents * text input events of which this input consists */ public TextInput(String enteredText, List* Constructor. Creates a new {@link TextInput}.. *
* * @param enteredText * text resulting from the inputs * @param textInputEvents * text input events of which this input consists * @param equalityType * defines how this event evaluates the equality (@see {@link TextEquality}) */ public TextInput(String enteredText, List* Returns the entered text. *
* * @return the entered text */ public String getEnteredText() { return enteredText; } /** ** Returns the events of which this {@link TextInput} consists. The returned list is immutable. *
* * @return the textInputEvents */ public List