Ignore:
Timestamp:
10/30/12 14:02:07 (12 years ago)
Author:
pharms
Message:
  • refined HTML GUI model to also include explicitely the server and the page
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLGUIElementSpec.java

    r950 r961  
    1515package de.ugoe.cs.autoquest.plugin.html.guimodel; 
    1616 
    17 import java.net.URL; 
    18  
    1917import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec; 
    2018 
     
    3230     
    3331    /** */ 
    34     private URL pageURL; 
    35      
    36     /** */ 
    37     private String pageTitle; 
    38      
    39     /** */ 
    4032    private String type; 
    4133     
    42     /** */ 
    43     private String id; 
    44      
    45     /** */ 
    46     private int index; 
    47  
    4834    /** 
    4935     * <p> 
     
    5541     * @param id 
    5642     */ 
    57     public HTMLGUIElementSpec(URL pageURL, String pageTitle, String type, String id, int index) { 
    58         if (pageURL == null) { 
    59             throw new IllegalArgumentException("page URL must not be null"); 
    60         } 
    61         else if (type == null) { 
     43    HTMLGUIElementSpec(String type) { 
     44        if (type == null) { 
    6245            throw new IllegalArgumentException("type must not be null"); 
    6346        } 
    64         else if ((id == null) && (index < 0)) { 
    65             throw new IllegalArgumentException 
    66               ("either id must not be null or the index must be greater or equal to 0"); 
    67         } 
    68          
    69         this.pageURL = pageURL; 
    70         this.pageTitle = pageTitle; 
     47 
    7148        this.type = type; 
    72         this.id = id; 
    73         this.index = index; 
    7449    } 
    7550 
     
    8964        if (other instanceof HTMLGUIElementSpec) { 
    9065            HTMLGUIElementSpec otherSpec = (HTMLGUIElementSpec) other; 
    91              
    92             if (!type.equals(otherSpec.type)) { 
    93                 return false; 
    94             } 
    95              
    96             if (id != null) { 
    97                 return id.equals(otherSpec.id); 
    98             } 
    99             else if (index >= 0) { 
    100                 return index == otherSpec.index; 
    101             } 
     66            return type.equals(otherSpec.type); 
    10267        } 
    10368         
     
    10570    } 
    10671 
    107     /** 
    108      * <p> 
    109      * TODO: comment 
    110      * </p> 
    111      * 
    112      * @return 
    113      */ 
    114     URL getPageURL() { 
    115         return pageURL; 
    116     } 
    117  
    118     /** 
    119      * <p> 
    120      * TODO: comment 
    121      * </p> 
    122      * 
    123      * @return 
    124      */ 
    125     String getPageTitle() { 
    126         return pageTitle; 
    127     } 
    128  
    129     /** 
    130      * <p> 
    131      * TODO: comment 
    132      * </p> 
    133      * 
    134      * @return 
    135      */ 
    136     String getTagId() { 
    137         return id; 
    138     } 
    139  
    140     /** 
    141      * <p> 
    142      * TODO: comment 
    143      * </p> 
    144      * 
    145      * @return 
    146      */ 
    147     int getIndex() { 
    148         return index; 
    149     } 
    150  
    151     /** 
    152      * <p> 
    153      * TODO: comment 
    154      * </p> 
    155      * 
    156      * @param htmlguiElementSpec 
    157      */ 
    158     void update(HTMLGUIElementSpec htmlguiElementSpec) { 
    159         // TODO Auto-generated method stub 
    160         System.out.println("TODO: implement HTMLGUIElementSpec.update "); 
    161          
    162     } 
    163  
    16472} 
Note: See TracChangeset for help on using the changeset viewer.