[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 | |
---|
[1012] | 17 | import de.ugoe.cs.autoquest.eventcore.guimodel.IDialog; |
---|
[961] | 18 | |
---|
| 19 | /** |
---|
| 20 | * <p> |
---|
[1276] | 21 | * a GUI element representing an HTML document, i.e., a page on an HTML server. This is the |
---|
| 22 | * element for a GUI model of an HTML web site being always and only the children of servers. It |
---|
| 23 | * is identified through the server on which it resists, its path, a potential query, and a title. |
---|
| 24 | * Its children are HTML page elements |
---|
[961] | 25 | * </p> |
---|
| 26 | * |
---|
| 27 | * @author Patrick Harms |
---|
| 28 | */ |
---|
[1069] | 29 | public class HTMLDocument extends HTMLGUIElement implements IDialog { |
---|
[961] | 30 | |
---|
[1276] | 31 | /** |
---|
| 32 | * <p> |
---|
| 33 | * default serial version UID |
---|
| 34 | * </p> |
---|
| 35 | */ |
---|
[961] | 36 | private static final long serialVersionUID = 1L; |
---|
| 37 | |
---|
| 38 | /** |
---|
| 39 | * <p> |
---|
[1276] | 40 | * instantiates the document with it specification and its parent, which is always a server |
---|
[961] | 41 | * </p> |
---|
| 42 | * |
---|
[1276] | 43 | * @param specification the specification of the document |
---|
| 44 | * @param parent the server on which the document resists |
---|
[961] | 45 | */ |
---|
[1069] | 46 | public HTMLDocument(HTMLDocumentSpec specification, HTMLServer parent) { |
---|
[961] | 47 | super(specification, parent); |
---|
| 48 | } |
---|
| 49 | |
---|
[1264] | 50 | /** |
---|
| 51 | * <p> |
---|
[1276] | 52 | * returns the path in the URL of the document |
---|
[1264] | 53 | * </p> |
---|
| 54 | * |
---|
[1276] | 55 | * @return the path in the URL of the document |
---|
[961] | 56 | */ |
---|
[1264] | 57 | public String getPath() { |
---|
| 58 | return ((HTMLDocumentSpec) super.getSpecification()).getPath(); |
---|
[961] | 59 | } |
---|
| 60 | |
---|
| 61 | /* |
---|
| 62 | * (non-Javadoc) |
---|
| 63 | * |
---|
| 64 | * @see de.ugoe.cs.autoquest.plugin.html.guimodel.HTMLGUIElement#getElementDescriptor() |
---|
| 65 | */ |
---|
| 66 | @Override |
---|
| 67 | protected String getElementDescriptor() { |
---|
[1069] | 68 | return "Document"; |
---|
[961] | 69 | } |
---|
| 70 | |
---|
| 71 | /** |
---|
| 72 | * <p> |
---|
[1276] | 73 | * returns the server on which the document resists |
---|
[961] | 74 | * </p> |
---|
| 75 | * |
---|
[1276] | 76 | * @return the server on which the document resists |
---|
[961] | 77 | */ |
---|
[1276] | 78 | HTMLServer getServer() { |
---|
| 79 | return (HTMLServer) super.getParent(); |
---|
[961] | 80 | } |
---|
| 81 | |
---|
| 82 | /** |
---|
| 83 | * <p> |
---|
[1276] | 84 | * returns the title of the document |
---|
[961] | 85 | * </p> |
---|
| 86 | * |
---|
[1276] | 87 | * @return the title of the document |
---|
[961] | 88 | */ |
---|
[1069] | 89 | String getTitle() { |
---|
| 90 | return ((HTMLDocumentSpec) super.getSpecification()).getTitle(); |
---|
[961] | 91 | } |
---|
| 92 | |
---|
| 93 | } |
---|