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

Last change on this file since 1264 was 1264, checked in by pharms, 11 years ago
  • improved logging
  • Property svn:executable set to *
File size: 3.0 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 java.lang.Object#toString()
66     */
67    @Override
68    public String toString() {
69        return super.getSpecification().toString();
70    }
71
72    /*
73     * (non-Javadoc)
74     *
75     * @see
76     * de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElement#updateSpecification(de.ugoe.cs.autoquest.eventcore
77     * .guimodel.IGUIElementSpec)
78     */
79    @Override
80    public void updateSpecification(IGUIElementSpec updateSpecification) {
81        // nothing to do. There is not need for handle things such as name changes, etc.
82    }
83
84    /*
85     * (non-Javadoc)
86     *
87     * @see java.lang.Object#toString()
88     */
89    @Override
90    public String getStringIdentifier() {
91        String str = this.toString();
92        if (getParent() != null) {
93            return str + "<-" + getParent().getStringIdentifier();
94        }
95        return str;
96    }
97
98    /**
99     * <p>
100     * A short string describing the GUI element, e.g., Button, Canvas, or ScrollBar.
101     * </p>
102     *
103     * @return short element descriptor
104     */
105    protected String getElementDescriptor() {
106        return "Default";
107    }
108
109}
Note: See TracBrowser for help on using the repository browser.