// Copyright 2012 Georg-August-Universität Göttingen, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package de.ugoe.cs.autoquest.plugin.html.guimodel; /** *

* This is a GUI element representing tags in HTML documents. Each tag belongs to a certain * document. Each page element has a tag name and either an id or at least * an index in the list of siblings of the same type. *

* * @author Patrick Harms */ public class HTMLPageElement extends HTMLGUIElement { /** *

* default serial version UID *

*/ private static final long serialVersionUID = 1L; /** *

* instantiates a page element with it parent (either a document or another page element) *

* * @param specification the specification of the page element * @param parent the parent GUI element */ public HTMLPageElement(HTMLPageElementSpec specification, HTMLGUIElement parent) { super(specification, parent); } /** *

* returns the name of the tag represented by this specification *

* * @return the name of the tag represented by this specification */ public String getTagName() { return ((HTMLPageElementSpec) super.getSpecification()).getTagName(); } /** *

* returns the id of the tag represented by this specification *

* * @return the id of the tag represented by this specification */ public String getHtmlId() { return ((HTMLPageElementSpec) super.getSpecification()).getHtmlId(); } /** *

* returns the index of the tag *

* * @return the index of the tag */ public int getIndex() { return ((HTMLPageElementSpec) super.getSpecification()).getIndex(); } /* * (non-Javadoc) * * @see de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement#getElementDescriptor() */ @Override protected String getElementDescriptor() { return getTagName(); } }