-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathdisplayCode.html
More file actions
366 lines (336 loc) · 8.88 KB
/
Copy pathdisplayCode.html
File metadata and controls
366 lines (336 loc) · 8.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>Java Tutorials Sample Code</title>
<script language="JavaScript" type="text/javascript">
//<![CDATA[
var url;
var codeSampleURL;
var codeSampleName;
var fileType;
function getCodeSampleUrl() {
var queryStrNV = document.location.search.split("=");
codeSampleURL = decodeURI(queryStrNV[1]);
codeSampleName = codeSampleURL.split("/").pop();
fileType = codeSampleName.split(".").pop();
if (fileType == "jnlp") {
fileType = " xml";
} else if (fileType == "css") {
fileType = " css";
} else {
fileType = " java";
}
fileType = fileType + " gutter: false;"
document.title = codeSampleName;
return codeSampleURL;
}
// new prototype defintion
document.include = function () {
if ('undefined' == typeof(codeSampleURL)) return false;
var p,rnd;
if (document.all){
// For IE, create an ActiveX Object instance
p = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
// For mozilla, create an instance of XMLHttpRequest.
p = new XMLHttpRequest();
}
// Prevent browsers from caching the included page
// by appending a random number (optional)
rnd = Math.random().toString().substring(2);
codeSampleURL = codeSampleURL.indexOf('?')>-1 ? codeSampleURL+'&rnd='+rnd : codeSampleURL+'?rnd='+rnd;
// Open the codeSampleURL and write out the response
p.open("GET",codeSampleURL,false);
p.send(null);
var code = encodeSpecialChars(p.responseText);
document.write( code );
}
var HTML_ESCAPE_CHARS = [["&", "&"], ["<", "<"], [">", ">"]];
function encodeSpecialChars(code) {
var re;
for (i=0; i <3; i++) {
re = new RegExp(HTML_ESCAPE_CHARS[i][0], "g");
code = code.replace(re, HTML_ESCAPE_CHARS[i][1]);
}
return code;
}
//]]>
</script>
<script type="text/javascript" src=
"supporting/syntaxhighlighter_3.0.83/scripts/shCore.js">
</script>
<script type="text/javascript" src=
"supporting/syntaxhighlighter_3.0.83/scripts/shBrushJava.js">
</script>
<script type="text/javascript" src=
"supporting/syntaxhighlighter_3.0.83/scripts/shBrushXml.js">
</script>
<script type="text/javascript" src=
"supporting/syntaxhighlighter_3.0.83/scripts/shBrushCss.js">
</script>
<link type="text/css" rel="stylesheet" href=
"supporting/syntaxhighlighter_3.0.83/styles/shCoreDefault.css" />
<script type="text/javascript">
SyntaxHighlighter.all();
</script>
<style type="text/css">
/*<![CDATA[*/
/* styles specific to this page */
.syntaxhighlighter { overflow-y: hidden !important; }
.homepagediv {
float: right;
margin: 0px 15px 10px 3em;
}
.clear {
clear:both;
}
/* styles specific to this page end */
/* other standard tutorial styles start */
div#TopBar_bl {
background: url(images/java_bar_bl.gif) 0 100% no-repeat;
width: 100%;
height: 60px;
}
div#TopBar_br {
background: url(images/java_bar_br.gif) 100% 100% no-repeat;
width: 100%;
height: 60px;
}
div#TopBar_tl {
background: url(images/java_bar_tl.gif) 0 0 no-repeat;
width: 100%;
height: 60px;
}
div#TopBar_tr {
background: url(images/java_bar_tr.gif) 100% 0 no-repeat;
width: 100%;
height: 60px;
}
div#TopBar {
font-family: sans-serif;
background: #35556B url(images/java_bar.gif);
margin: 10px 10px 0 10px;
height:60px;
min-width:700px;
color: white;
font-weight: bold;
}
div#TopBar_left {
margin-left: 100px;
padding-top: 6px;
}
@media print {
div#TopBar_left {
margin-left: 0;
}
}
div#TopBar_right {
float: right;
padding-top: 8px;
padding-right: 30px;
text-align: center;
}
@media print {
div#TopBar_right {
display: none;
}
}
#TopBar_right a {
font-size: 12px;
margin: 3px;
padding: 0;
}
#TopBar a:visited, #TopBar a:link {
color: white;
text-decoration: none;
}
div#TopBar a:visited, div#TopBar a:link {
color: white;
}
div#TopBar a:hover, div#TopBar a:active {
background-color: white;
color: #35556B;
}
div#PageTitle {
margin: 0 5px 0.5em 0;
color: #F90000;
float: left;
}
}
div#LeftBar {
width: 13em;
float: left;
margin-left: 10px;
margin-top: 10px;
}
div#Footer {
font-family: sans-serif;
font-size: 10px;
padding-top: 10px;
margin: 3em;
clear: both;
}
div#Footer img#duke {
}
div#Footer img#sun {
}
div#TagNotes {
margin-top: 10px;
color: #35556B;
}
@media print {
span#TagNotes a:visited, span#TagNotes a:link {
text-decoration: none;
}
}
div#TutBody {
margin: 10px 3em 10px 3em;
}
div.RightBar {
font-family: sans-serif;
float: right;
}
div.RightBar img {
margin: 0 0 1em 0;
}
div.RightBox {
margin: 10px 3em 10px 0;
width: 15em;
border-style: double;
}
div.BlueRightBox {
margin: 10px 3em 10px 0;
width: 15em;
border-style: double;
background-color: #747170;
color: #FFFFFF;
}
div.Pad {
font-size: 80%;
padding: 1em;
}
div.Pad h3 {
text-align: center;
margin: 0;
}
div.Pad h3w {
text-align: center;
margin: 0;
}
div.Pad div {
display: list-item;
list-style-image: url(images/arrow-right-gray.gif);
margin: 0.3em 1em;
}
ul.BlueArrows {
list-style-image: url(images/ar_dbl_blue.gif);
}
ul.BlueArrows a:visited, ul.BlueArrows a:link {
text-decoration: none;
}
ul.BlueArrows a:hover, ul.BlueArrows a:active {
text-decoration: underline;
}
h1, h2, h3, h4, h5 {
color: #F90000;
font-family: sans-serif;
}
h2 {
font-weight: bold;
font-size: 17px;
}
h3 {
font-weight: bold;
font-size: 14px;
}
h4 {
font-size: 15px;
}
h5 {
font-size: 12px;
}
/*]]>*/
</style>
</head>
<body>
<noscript>A browser with JavaScript enabled is required for this
page to operate properly.</noscript>
<!-- tutorial boiler plate start -->
<div id="TopBar">
<div id="TopBar_tr">
<div id="TopBar_tl">
<div id="TopBar_br">
<div id="TopBar_bl">
<div id="TopBar_right"><a href="search.html" target=
"_top">Search</a><br />
<a href=
"http://docs.oracle.com/javase/feedback.html">Feedback</a></div>
</div>
</div>
</div>
</div>
</div>
<!-- tutorial boiler plate end -->
<div id="PageTitle">
<h1>Java Tutorials Code Sample –
<script language="javascript" type="text/javascript">
getCodeSampleUrl();
document.write(codeSampleName);
</script>
</h1>
</div>
<div class="homepagediv">
<p><a href="index.html">Home Page</a></p>
</div>
<div class="clear"></div>
<div id="TutBody">
<script language="javascript" type="text/javascript">
/* <![CDATA[ */
document.write("<p><a href='" + codeSampleURL + "'>Download<\/a> this sample.<\/p>");
document.write("<pre class='brush:" + fileType + "; '>");
document.include();
document.write("<\/pre>");
/* ]]> */
</script>
</div>
<!-- tutorial boiler plate start -->
<hr />
<div id="Footer">
<p><font size="1"><a name="license_info">Your use of this</a> page <a href="http://docs.oracle.com/javase/tutorial/">(http://docs.oracle.com/javase/tutorial</a>)
and all the material on pages under "The Java Tutorials" banner is subject to these
<a href="information/cpyr.html">legal notices</a>.
</font></p>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td headers="h1" width="20%">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td headers="h1" align="center"><img id="duke" src="images/DukeWave.gif"
width="55" height="55" alt="Waving Duke" /></td>
<td headers="h2" align="left" valign="middle"><img id="oracle" src=
"images/logo_oracle_footer.gif" width="100" height="29" alt=
"Oracle logo" /></td>
</tr>
</table>
</td>
<td width="55%" valign="middle" align="center"><font size="1"><a
href="http://www.oracle.com/us/corporate/index.html">About
Oracle</a> | <a href=
"http://www.oracle.com/technology/index.html">Oracle Technology
Network</a> | <a href=
"https://www.samplecode.oracle.com/servlets/CompulsoryClickThrough?type=TermsOfService">
Terms of Service</a> | <a href=
"information/docaccessibility.html">Documentation
Accessibility</a></font> </td>
<td width="25%" valign="middle" align="right"><font size=
"2">Copyright © 1995, 2011 Oracle and/or its affiliates. All
rights reserved.</font> </td>
</tr>
</table>
</div>
<!-- tutorial boiler plate end -->
</body>
</html>