Index: /trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/GUIElementTree.java
===================================================================
--- /trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/GUIElementTree.java	(revision 1025)
+++ /trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/GUIElementTree.java	(revision 1026)
@@ -31,5 +31,6 @@
  * <p>
  * The GUIElementTree represents the hierarchical structure of the GUI elements "as it is" currently during
- * a session. It may change during the session due to creation and destruction of GUI elements.
+ * a session. It may change during the session due to creation and destruction of GUI elements. The parameter
+ * T represents the id type of the GUI elements that are handled internally.
  * </p>
  * 
@@ -38,9 +39,6 @@
  * @version 1.0
  */
-public class GUIElementTree {
-	/* Note that in the current version the id of a GUI element is assumed to be a long. For future
-	versions it might be more suitable to change to some generic id type. */
-	
-	 /**
+public class GUIElementTree<T> {
+    /**
      * <p>
      * Map of all GUI elements that are part of the tree for efficient searching. The keys of the
@@ -48,5 +46,5 @@
      * </p>
      */
-    private Map<Long, IGUIElement> guiElements;
+    private Map<T, IGUIElement> guiElements;
 
     /**
@@ -56,5 +54,5 @@
      * </p>
      */
-    private Map<Long, IGUIElementSpec> guiElementSpecs;
+    private Map<T, IGUIElementSpec> guiElementSpecs;
 
     /**
@@ -64,5 +62,5 @@
      * </p>
      */
-    private Map<Long, List<Long>> childRelations;
+    private Map<T, List<T>> childRelations;
 
     /**
@@ -72,5 +70,5 @@
      * </p>
      */
-    private Map<Long, Long> parentRelations;
+    private Map<T, T> parentRelations;
 
     /**
@@ -96,8 +94,8 @@
      */
     public GUIElementTree() {
-        guiElementSpecs = new HashMap<Long, IGUIElementSpec>();
-        childRelations = new HashMap<Long, List<Long>>();
-        parentRelations = new HashMap<Long, Long>();
-        guiElements = new HashMap<Long, IGUIElement>();
+        guiElementSpecs = new HashMap<T, IGUIElementSpec>();
+        childRelations = new HashMap<T, List<T>>();
+        parentRelations = new HashMap<T, T>();
+        guiElements = new HashMap<T, IGUIElement>();
         guiModel = new GUIModel();
     }
@@ -110,8 +108,8 @@
      */
     public GUIElementTree(GUIModel guiModel){
-        guiElementSpecs = new HashMap<Long, IGUIElementSpec>();
-        childRelations = new HashMap<Long, List<Long>>();
-        parentRelations = new HashMap<Long, Long>();
-        guiElements = new HashMap<Long, IGUIElement>();
+        guiElementSpecs = new HashMap<T, IGUIElementSpec>();
+        childRelations = new HashMap<T, List<T>>();
+        parentRelations = new HashMap<T, T>();
+        guiElements = new HashMap<T, IGUIElement>();
         this.guiModel = guiModel;
     }
@@ -129,6 +127,6 @@
      * 			  the GUI element specification
      */
-    public void add(Long guiElementID,
-    				Long parentID,
+    public void add(T guiElementID,
+    				T parentID,
                     IGUIElementSpec guiElementSpec)
     {
@@ -138,8 +136,8 @@
         	IGUIElementSpec parent = guiElementSpecs.get(parentID);
             if (parent != null) {
-                List<Long> otherChildren = childRelations.get(parentID);
+                List<T> otherChildren = childRelations.get(parentID);
 
                 if (otherChildren == null) {
-                    otherChildren = new ArrayList<Long>();
+                    otherChildren = new ArrayList<T>();
                     childRelations.put(parentID, otherChildren);
                 }
@@ -153,5 +151,5 @@
             List<IGUIElementSpec> guiElementPath = new ArrayList<IGUIElementSpec>();
 
-            Long currentElementID = guiElementID;
+            T currentElementID = guiElementID;
             while (guiElementSpec != null) {
                 guiElementPath.add(0, guiElementSpec);
@@ -180,5 +178,5 @@
      * @return {@link IGUIElementSpec} of the GUI element with the given id if found, null otherwise
      */
-    public IGUIElement find(long id) {
+    public IGUIElement find(T id) {
         return guiElements.get(id);
     }
@@ -194,5 +192,5 @@
      * @return number of GUI elements that were removed
      */
-    public int remove(long id) {
+    public int remove(T id) {
         int removedCounter = 0;
         IGUIElementSpec node = guiElementSpecs.remove(id);
@@ -200,11 +198,11 @@
         if (node != null) {
         	removedCounter++;
-            List<Long> nodesToBeRemoved = childRelations.remove(id);
+            List<T> nodesToBeRemoved = childRelations.remove(id);
 
             // remove all children and sub-children, if any
             if (nodesToBeRemoved != null) {
                 for (int i = 0; i < nodesToBeRemoved.size(); i++) {
-                    Long nodeToBeRemoved = nodesToBeRemoved.get(i);
-                    List<Long> children =
+                    T nodeToBeRemoved = nodesToBeRemoved.get(i);
+                    List<T> children =
                         childRelations.remove(nodeToBeRemoved);
 
@@ -221,7 +219,7 @@
             /* the node may be a child node of a parent. So search for it in the child relations
             of the parent and remove it */
-            Long parent = parentRelations.remove(id);
+            T parent = parentRelations.remove(id);
             if (parent != null) {
-                List<Long> children = childRelations.get(parent);
+                List<T> children = childRelations.get(parent);
 
                 if (children != null) {
