1 | //------------------------------------------------------------------------------------------------- |
---|
2 | // Module : $RCSfile: TextInputSequenceImpl.java,v $ |
---|
3 | // Version : $Revision: 0.0 $ $Author: patrick $ $Date: 10.06.2012 $ |
---|
4 | // Project : TaskTreeImpl |
---|
5 | // Creation : 2012 by patrick |
---|
6 | // Copyright : Patrick Harms, 2012 |
---|
7 | //------------------------------------------------------------------------------------------------- |
---|
8 | package de.ugoe.cs.quest.tasktrees.treeimpl; |
---|
9 | |
---|
10 | import de.ugoe.cs.quest.eventcore.guimodel.GUIElement; |
---|
11 | import de.ugoe.cs.quest.eventcore.userinteraction.TextInput; |
---|
12 | import de.ugoe.cs.quest.tasktrees.treeifc.TextInputInteractionTask; |
---|
13 | |
---|
14 | //------------------------------------------------------------------------------------------------- |
---|
15 | /** |
---|
16 | * TODO comment |
---|
17 | * |
---|
18 | * @version $Revision: $ $Date: 10.06.2012$ |
---|
19 | * @author 2012, last modified by $Author: patrick$ |
---|
20 | */ |
---|
21 | //------------------------------------------------------------------------------------------------- |
---|
22 | public class TextInputInteractionTaskImpl extends InteractionTaskImpl |
---|
23 | implements TextInputInteractionTask |
---|
24 | { |
---|
25 | |
---|
26 | /** the text, that was finally entered in this sequence without all backspaces, etc. */ |
---|
27 | private String mEnteredText; |
---|
28 | |
---|
29 | //----------------------------------------------------------------------------------------------- |
---|
30 | /** |
---|
31 | * TODO: comment |
---|
32 | * |
---|
33 | * @param name |
---|
34 | */ |
---|
35 | //----------------------------------------------------------------------------------------------- |
---|
36 | TextInputInteractionTaskImpl(GUIElement guiElement) |
---|
37 | { |
---|
38 | super(guiElement, new TextInput()); |
---|
39 | } |
---|
40 | |
---|
41 | //----------------------------------------------------------------------------------------------- |
---|
42 | /* (non-Javadoc) |
---|
43 | * @see de.ugoe.cs.tasktree.treeimpl.TaskTreeNodeImpl#clone() |
---|
44 | */ |
---|
45 | //----------------------------------------------------------------------------------------------- |
---|
46 | @Override |
---|
47 | public TextInputInteractionTaskImpl clone() |
---|
48 | { |
---|
49 | // entered text is unchangeable and does not need to be cloned |
---|
50 | return (TextInputInteractionTaskImpl) super.clone(); |
---|
51 | } |
---|
52 | |
---|
53 | //----------------------------------------------------------------------------------------------- |
---|
54 | /* (non-Javadoc) |
---|
55 | * @see de.ugoe.cs.tasktree.treeifc.TextInputSequence#getEnteredText() |
---|
56 | */ |
---|
57 | //----------------------------------------------------------------------------------------------- |
---|
58 | @Override |
---|
59 | public String getEnteredText() |
---|
60 | { |
---|
61 | return mEnteredText; |
---|
62 | } |
---|
63 | |
---|
64 | //----------------------------------------------------------------------------------------------- |
---|
65 | /* (non-Javadoc) |
---|
66 | * @see de.ugoe.cs.tasktree.treeifc.TextInputSequence#setEnteredText(java.lang.String) |
---|
67 | */ |
---|
68 | //----------------------------------------------------------------------------------------------- |
---|
69 | @Override |
---|
70 | public void setEnteredText(String text) |
---|
71 | { |
---|
72 | mEnteredText = text; |
---|
73 | } |
---|
74 | |
---|
75 | //----------------------------------------------------------------------------------------------- |
---|
76 | /* (non-Javadoc) |
---|
77 | * @see java.lang.Object#toString() |
---|
78 | */ |
---|
79 | //----------------------------------------------------------------------------------------------- |
---|
80 | @Override |
---|
81 | public synchronized String toString() |
---|
82 | { |
---|
83 | if (super.getChildren() == null) |
---|
84 | { |
---|
85 | return super.getName(); |
---|
86 | } |
---|
87 | else |
---|
88 | { |
---|
89 | return "TextInputInteraction(\"" + mEnteredText + "\", " + super.getChildren().size() + |
---|
90 | " children)"; |
---|
91 | } |
---|
92 | } |
---|
93 | |
---|
94 | } |
---|