KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lobobrowser > html > domimpl > HTMLFrameElementImpl


1 /*
2     GNU LESSER GENERAL PUBLIC LICENSE
3     Copyright (C) 2006 The Lobo Project
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Lesser General Public
7     License as published by the Free Software Foundation; either
8     version 2.1 of the License, or (at your option) any later version.
9
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13     Lesser General Public License for more details.
14
15     You should have received a copy of the GNU Lesser General Public
16     License along with this library; if not, write to the Free Software
17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19     Contact info: xamjadmin@users.sourceforge.net
20 */

21 /*
22  * Created on Jan 28, 2006
23  */

24 package org.lobobrowser.html.domimpl;
25
26 import org.lobobrowser.html.BrowserFrame;
27 import org.lobobrowser.html.js.*;
28 import org.w3c.dom.Document JavaDoc;
29 import org.w3c.dom.html2.HTMLFrameElement;
30
31 public class HTMLFrameElementImpl extends HTMLElementImpl implements
32         HTMLFrameElement, FrameNode {
33     private volatile BrowserFrame browserFrame;
34     
35     public HTMLFrameElementImpl(String JavaDoc name, boolean noStyleSheet) {
36         super(name, noStyleSheet);
37     }
38
39     public HTMLFrameElementImpl(String JavaDoc name) {
40         super(name);
41     }
42
43     public void setBrowserFrame(BrowserFrame frame) {
44         this.browserFrame = frame;
45     }
46     
47     public BrowserFrame getBrowserFrame() {
48         return this.browserFrame;
49     }
50
51     public String JavaDoc getFrameBorder() {
52         return this.getAttribute("frameBorder");
53     }
54
55     public void setFrameBorder(String JavaDoc frameBorder) {
56         this.setAttribute("frameBorder", frameBorder);
57     }
58
59     public String JavaDoc getLongDesc() {
60         return this.getAttribute("longdesc");
61     }
62
63     public void setLongDesc(String JavaDoc longDesc) {
64         this.setAttribute("longdesc", longDesc);
65     }
66
67     public String JavaDoc getMarginHeight() {
68         return this.getAttribute("marginHeight");
69     }
70
71     public void setMarginHeight(String JavaDoc marginHeight) {
72         this.setAttribute("marginHeight", marginHeight);
73     }
74
75     public String JavaDoc getMarginWidth() {
76         return this.getAttribute("marginWidth");
77     }
78
79     public void setMarginWidth(String JavaDoc marginWidth) {
80         this.setAttribute("marginWidth", marginWidth);
81     }
82
83     public String JavaDoc getName() {
84         return this.getAttribute("name");
85     }
86
87     public void setName(String JavaDoc name) {
88         this.setAttribute("name", name);
89     }
90
91     private boolean noResize;
92     
93     public boolean getNoResize() {
94         return this.noResize;
95     }
96
97     public void setNoResize(boolean noResize) {
98         this.noResize = noResize;
99     }
100
101     public String JavaDoc getScrolling() {
102         return this.getAttribute("scrolling");
103     }
104
105     public void setScrolling(String JavaDoc scrolling) {
106         this.setAttribute("scrolling", scrolling);
107     }
108
109     public String JavaDoc getSrc() {
110         return this.getAttribute("src");
111     }
112
113     public void setSrc(String JavaDoc src) {
114         this.setAttribute("src", src);
115     }
116
117     public Document JavaDoc getContentDocument() {
118         BrowserFrame frame = this.browserFrame;
119         if(frame == null) {
120             // Not loaded yet
121
return null;
122         }
123         return frame.getContentDocument();
124     }
125     
126     public Window getContentWindow() {
127         BrowserFrame frame = this.browserFrame;
128         if(frame == null) {
129             // Not loaded yet
130
return null;
131         }
132         return Window.getWindow(frame.getHtmlRendererContext());
133     }
134
135 }
136
Popular Tags