source: trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLGUIElement.java @ 1178

Last change on this file since 1178 was 994, checked in by pharms, 12 years ago
  • changed the string identifier, so that the terminal elements in the GUI hierarchy come before the others. This makes reading the identifier easier, especially when it is quite long.
  • Property svn:executable set to *
File size: 2.8 KB
Line 
1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.plugin.html.guimodel;
16
17import de.ugoe.cs.autoquest.eventcore.guimodel.AbstractDefaultGUIElement;
18import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec;
19
20/**
21 * <p>
22 * Base class for all HTML GUI elements.
23 * </p>
24 *
25 * @version 1.0
26 * @author Patrick Harms
27 */
28public class HTMLGUIElement extends AbstractDefaultGUIElement {
29
30    /**
31     * <p>
32     * Id for object serialization.
33     * </p>
34     */
35    private static final long serialVersionUID = 1L;
36
37    /**
38     * <p>
39     * Constructor. Creates a new HTMLGUIElement.
40     * </p>
41     *
42     * @param specification
43     *            specification of created GUI element
44     * @param parent
45     *            parent of the created GUI element; null means that the element is a top-level
46     *            window
47     */
48    public HTMLGUIElement(HTMLGUIElementSpec specification, HTMLGUIElement parent) {
49        super(specification, parent);
50    }
51
52    /*
53     * (non-Javadoc)
54     *
55     * @see de.ugoe.cs.autoquest.eventcore.IEventTarget#getPlatform()
56     */
57    @Override
58    public String getPlatform() {
59        return "HTML";
60    }
61
62    /*
63     * (non-Javadoc)
64     *
65     * @see
66     * de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#updateSpecification(de.ugoe.cs.autoquest.eventcore
67     * .guimodel.IGUIElementSpec)
68     */
69    @Override
70    public void updateSpecification(IGUIElementSpec updateSpecification) {
71        // nothing to do. There is not need for handle things such as name changes, etc.
72    }
73
74    /*
75     * (non-Javadoc)
76     *
77     * @see java.lang.Object#toString()
78     */
79    @Override
80    public String getStringIdentifier() {
81        String str = this.toString();
82        if (getParent() != null) {
83            return str + "<-" + getParent().getStringIdentifier();
84        }
85        return str;
86    }
87
88    /**
89     * <p>
90     * A short string describing the GUI element, e.g., Button, Canvas, or ScrollBar.
91     * </p>
92     *
93     * @return short element descriptor
94     */
95    protected String getElementDescriptor() {
96        return "Default";
97    }
98
99}
Note: See TracBrowser for help on using the repository browser.