Changeset 1068


Ignore:
Timestamp:
02/14/13 15:16:21 (11 years ago)
Author:
pharms
Message:
  • added a possibility to determine the id of a given GUI element
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-events/src/main/java/de/ugoe/cs/autoquest/eventcore/guimodel/GUIElementTree.java

    r1026 r1068  
    125125     *            id of the parent GUI element  
    126126     * @param guiElementSpec 
    127      *                    the GUI element specification 
     127     *            the GUI element specification 
    128128     */ 
    129129    public void add(T guiElementID, 
    130                                 T parentID, 
     130                    T parentID, 
    131131                    IGUIElementSpec guiElementSpec) 
    132132    { 
     
    134134         
    135135        if (guiElement == null) { 
    136                 IGUIElementSpec parent = guiElementSpecs.get(parentID); 
     136            IGUIElementSpec parent = guiElementSpecs.get(parentID); 
    137137            if (parent != null) { 
    138138                List<T> otherChildren = childRelations.get(parentID); 
     
    184184    /** 
    185185     * <p> 
     186     * Returns the id of the provided {@link IGUIElement}. The comparison is performed using the 
     187     * equals method of the GUI element. 
     188     * </p> 
     189     *  
     190     * @param guiElement 
     191     *            guiElement that is looked for 
     192     * @return the id of the GUI element, null if the GUI element can not be found 
     193     */ 
     194    public T find(IGUIElement guiElement) { 
     195        for (Map.Entry<T, IGUIElement> entry : guiElements.entrySet()) { 
     196            if (guiElement.equals(entry.getValue())) { 
     197                return entry.getKey(); 
     198            } 
     199        } 
     200         
     201        return null; 
     202    } 
     203 
     204    /** 
     205     * <p> 
    186206     * Removes a GUI element (defined by its id) from the tree. All children of the GUI element will be 
    187207     * removed recursively. 
     
    197217 
    198218        if (node != null) { 
    199                 removedCounter++; 
     219            removedCounter++; 
    200220            List<T> nodesToBeRemoved = childRelations.remove(id); 
    201221 
Note: See TracChangeset for help on using the changeset viewer.