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.IDialog; |
---|
18 | |
---|
19 | /** |
---|
20 | * <p> |
---|
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 |
---|
25 | * </p> |
---|
26 | * |
---|
27 | * @author Patrick Harms |
---|
28 | */ |
---|
29 | public class HTMLDocument extends HTMLGUIElement implements IDialog { |
---|
30 | |
---|
31 | /** |
---|
32 | * <p> |
---|
33 | * default serial version UID |
---|
34 | * </p> |
---|
35 | */ |
---|
36 | private static final long serialVersionUID = 1L; |
---|
37 | |
---|
38 | /** |
---|
39 | * <p> |
---|
40 | * instantiates the document with it specification and its parent, which is always a server |
---|
41 | * </p> |
---|
42 | * |
---|
43 | * @param specification the specification of the document |
---|
44 | * @param parent the server on which the document resists |
---|
45 | */ |
---|
46 | public HTMLDocument(HTMLDocumentSpec specification, HTMLServer parent) { |
---|
47 | super(specification, parent); |
---|
48 | } |
---|
49 | |
---|
50 | /** |
---|
51 | * <p> |
---|
52 | * returns the path in the URL of the document |
---|
53 | * </p> |
---|
54 | * |
---|
55 | * @return the path in the URL of the document |
---|
56 | */ |
---|
57 | public String getPath() { |
---|
58 | return ((HTMLDocumentSpec) super.getSpecification()).getPath(); |
---|
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() { |
---|
68 | return "Document"; |
---|
69 | } |
---|
70 | |
---|
71 | /** |
---|
72 | * <p> |
---|
73 | * returns the server on which the document resists |
---|
74 | * </p> |
---|
75 | * |
---|
76 | * @return the server on which the document resists |
---|
77 | */ |
---|
78 | HTMLServer getServer() { |
---|
79 | return (HTMLServer) super.getParent(); |
---|
80 | } |
---|
81 | |
---|
82 | /** |
---|
83 | * <p> |
---|
84 | * returns the title of the document |
---|
85 | * </p> |
---|
86 | * |
---|
87 | * @return the title of the document |
---|
88 | */ |
---|
89 | String getTitle() { |
---|
90 | return ((HTMLDocumentSpec) super.getSpecification()).getTitle(); |
---|
91 | } |
---|
92 | |
---|
93 | } |
---|