[961] | 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> |
---|
[1276] | 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. |
---|
[961] | 22 | * </p> |
---|
| 23 | * |
---|
| 24 | * @author Patrick Harms |
---|
| 25 | */ |
---|
[989] | 26 | public class HTMLPageElement extends HTMLGUIElement { |
---|
[961] | 27 | |
---|
| 28 | /** |
---|
| 29 | * <p> |
---|
[1276] | 30 | * default serial version UID |
---|
[961] | 31 | * </p> |
---|
| 32 | */ |
---|
[1276] | 33 | private static final long serialVersionUID = 1L; |
---|
[961] | 34 | |
---|
| 35 | /** |
---|
| 36 | * <p> |
---|
[1276] | 37 | * instantiates a page element with it parent (either a document or another page element) |
---|
[961] | 38 | * </p> |
---|
| 39 | * |
---|
[1276] | 40 | * @param specification the specification of the page element |
---|
| 41 | * @param parent the parent GUI element |
---|
[961] | 42 | */ |
---|
[1276] | 43 | public HTMLPageElement(HTMLPageElementSpec specification, HTMLGUIElement parent) { |
---|
[961] | 44 | super(specification, parent); |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | /** |
---|
| 48 | * <p> |
---|
[1276] | 49 | * returns the name of the tag represented by this specification |
---|
[961] | 50 | * </p> |
---|
| 51 | * |
---|
[1276] | 52 | * @return the name of the tag represented by this specification |
---|
[961] | 53 | */ |
---|
[1264] | 54 | public String getTagName() { |
---|
| 55 | return ((HTMLPageElementSpec) super.getSpecification()).getTagName(); |
---|
[961] | 56 | } |
---|
| 57 | |
---|
| 58 | /** |
---|
| 59 | * <p> |
---|
[1276] | 60 | * returns the id of the tag represented by this specification |
---|
[961] | 61 | * </p> |
---|
| 62 | * |
---|
[1276] | 63 | * @return the id of the tag represented by this specification |
---|
[961] | 64 | */ |
---|
[1264] | 65 | public String getHtmlId() { |
---|
| 66 | return ((HTMLPageElementSpec) super.getSpecification()).getHtmlId(); |
---|
[961] | 67 | } |
---|
| 68 | |
---|
| 69 | /** |
---|
| 70 | * <p> |
---|
[1276] | 71 | * returns the index of the tag |
---|
[961] | 72 | * </p> |
---|
| 73 | * |
---|
[1276] | 74 | * @return the index of the tag |
---|
[961] | 75 | */ |
---|
[1264] | 76 | public int getIndex() { |
---|
| 77 | return ((HTMLPageElementSpec) super.getSpecification()).getIndex(); |
---|
[961] | 78 | } |
---|
| 79 | |
---|
[1264] | 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 | |
---|
[961] | 90 | } |
---|