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 | import de.ugoe.cs.autoquest.eventcore.guimodel.IFrame; |
---|
18 | |
---|
19 | /** |
---|
20 | * <p> |
---|
21 | * TODO comment |
---|
22 | * </p> |
---|
23 | * |
---|
24 | * @author Patrick Harms |
---|
25 | */ |
---|
26 | public class HTMLPageElement extends HTMLGUIElement implements IFrame { |
---|
27 | |
---|
28 | /** */ |
---|
29 | private static final long serialVersionUID = 1L; |
---|
30 | |
---|
31 | /** |
---|
32 | * <p> |
---|
33 | * TODO: comment |
---|
34 | * </p> |
---|
35 | * |
---|
36 | * @param specification |
---|
37 | * @param parent |
---|
38 | */ |
---|
39 | public HTMLPageElement(HTMLPageElementSpec specification, HTMLGUIElement parent) { |
---|
40 | super(specification, parent); |
---|
41 | } |
---|
42 | |
---|
43 | /** |
---|
44 | * <p> |
---|
45 | * TODO: comment |
---|
46 | * </p> |
---|
47 | * |
---|
48 | * @param specification |
---|
49 | * @param parent |
---|
50 | */ |
---|
51 | public HTMLPageElement(HTMLPageElementSpec specification, HTMLPage parent) { |
---|
52 | super(specification, parent); |
---|
53 | } |
---|
54 | |
---|
55 | /* |
---|
56 | * (non-Javadoc) |
---|
57 | * |
---|
58 | * @see java.lang.Object#toString() |
---|
59 | */ |
---|
60 | @Override |
---|
61 | public String toString() { |
---|
62 | String str = getTag(); |
---|
63 | |
---|
64 | if ((getTagId() != null) && (!"".equals(getTagId()))) { |
---|
65 | str += "(id=\"" + getTagId() + "\")"; |
---|
66 | } |
---|
67 | else { |
---|
68 | str += "[" + getTagIndex() + "]"; |
---|
69 | } |
---|
70 | |
---|
71 | return str; |
---|
72 | } |
---|
73 | |
---|
74 | /* |
---|
75 | * (non-Javadoc) |
---|
76 | * |
---|
77 | * @see de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement#getElementDescriptor() |
---|
78 | */ |
---|
79 | @Override |
---|
80 | protected String getElementDescriptor() { |
---|
81 | return getTag(); |
---|
82 | } |
---|
83 | |
---|
84 | /** |
---|
85 | * <p> |
---|
86 | * TODO: comment |
---|
87 | * </p> |
---|
88 | * |
---|
89 | * @return |
---|
90 | */ |
---|
91 | HTMLPageSpec getPage() { |
---|
92 | return ((HTMLPageElementSpec) super.getSpecification()).getPage(); |
---|
93 | } |
---|
94 | |
---|
95 | /** |
---|
96 | * <p> |
---|
97 | * TODO: comment |
---|
98 | * </p> |
---|
99 | * |
---|
100 | * @return |
---|
101 | */ |
---|
102 | String getTag() { |
---|
103 | return ((HTMLPageElementSpec) super.getSpecification()).getTag(); |
---|
104 | } |
---|
105 | |
---|
106 | /** |
---|
107 | * <p> |
---|
108 | * TODO: comment |
---|
109 | * </p> |
---|
110 | * |
---|
111 | * @return |
---|
112 | */ |
---|
113 | String getTagId() { |
---|
114 | return ((HTMLPageElementSpec) super.getSpecification()).getTagId(); |
---|
115 | } |
---|
116 | |
---|
117 | /** |
---|
118 | * <p> |
---|
119 | * TODO: comment |
---|
120 | * </p> |
---|
121 | * |
---|
122 | * @return |
---|
123 | */ |
---|
124 | int getTagIndex() { |
---|
125 | return ((HTMLPageElementSpec) super.getSpecification()).getTagIndex(); |
---|
126 | } |
---|
127 | |
---|
128 | } |
---|