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 | |
---|
15 | package de.ugoe.cs.autoquest.plugin.html.guimodel; |
---|
16 | |
---|
17 | /** |
---|
18 | * <p> |
---|
19 | * This is a GUI element representing tags in HTML documents. Each tag belongs to a certain |
---|
20 | * document. Each page element has a tag name and either an id or at least |
---|
21 | * an index in the list of siblings of the same type. |
---|
22 | * </p> |
---|
23 | * |
---|
24 | * @author Patrick Harms |
---|
25 | */ |
---|
26 | public class HTMLPageElement extends HTMLGUIElement { |
---|
27 | |
---|
28 | /** |
---|
29 | * <p> |
---|
30 | * default serial version UID |
---|
31 | * </p> |
---|
32 | */ |
---|
33 | private static final long serialVersionUID = 1L; |
---|
34 | |
---|
35 | /** |
---|
36 | * <p> |
---|
37 | * instantiates a page element with it parent (either a document or another page element) |
---|
38 | * </p> |
---|
39 | * |
---|
40 | * @param specification the specification of the page element |
---|
41 | * @param parent the parent GUI element |
---|
42 | */ |
---|
43 | public HTMLPageElement(HTMLPageElementSpec specification, HTMLGUIElement parent) { |
---|
44 | super(specification, parent); |
---|
45 | } |
---|
46 | |
---|
47 | /** |
---|
48 | * <p> |
---|
49 | * returns the name of the tag represented by this specification |
---|
50 | * </p> |
---|
51 | * |
---|
52 | * @return the name of the tag represented by this specification |
---|
53 | */ |
---|
54 | public String getTagName() { |
---|
55 | return ((HTMLPageElementSpec) super.getSpecification()).getTagName(); |
---|
56 | } |
---|
57 | |
---|
58 | /** |
---|
59 | * <p> |
---|
60 | * returns the id of the tag represented by this specification |
---|
61 | * </p> |
---|
62 | * |
---|
63 | * @return the id of the tag represented by this specification |
---|
64 | */ |
---|
65 | public String getHtmlId() { |
---|
66 | return ((HTMLPageElementSpec) super.getSpecification()).getHtmlId(); |
---|
67 | } |
---|
68 | |
---|
69 | /** |
---|
70 | * <p> |
---|
71 | * returns the index of the tag |
---|
72 | * </p> |
---|
73 | * |
---|
74 | * @return the index of the tag |
---|
75 | */ |
---|
76 | public int getIndex() { |
---|
77 | return ((HTMLPageElementSpec) super.getSpecification()).getIndex(); |
---|
78 | } |
---|
79 | |
---|
80 | /* |
---|
81 | * (non-Javadoc) |
---|
82 | * |
---|
83 | * @see de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement#getElementDescriptor() |
---|
84 | */ |
---|
85 | @Override |
---|
86 | protected String getElementDescriptor() { |
---|
87 | return getTagName(); |
---|
88 | } |
---|
89 | |
---|
90 | } |
---|