01: /*
02: * Copyright 2005 Paul Hinds
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.tp23.antinstaller.renderer.text;
17:
18: import java.io.IOException;
19:
20: import org.tp23.antinstaller.InstallException;
21: import org.tp23.antinstaller.page.Page;
22: import org.tp23.antinstaller.page.SplashPage;
23: import org.tp23.antinstaller.renderer.AIResourceBundle;
24:
25: public class SplashPageRenderer extends AbstractTextPageRenderer {
26:
27: private static final AIResourceBundle res = new AIResourceBundle();
28:
29: public SplashPageRenderer() {
30: }
31:
32: public boolean renderPage(Page page) throws InstallException {
33: if (page instanceof SplashPage) {
34: SplashPage sPage = (SplashPage) page;
35: return renderSplashPage(sPage);
36: } else {
37: throw new InstallException(
38: "Wrong Renderer in SplashPageRenderer.renderPage");
39: }
40: }
41:
42: private boolean renderSplashPage(SplashPage page)
43: throws InstallException {
44: try {
45: printHeader(page);
46: out.println();
47: out.println(page.getAltText());
48:
49: out.println();
50: out.println(res.getString("click.view.text"));
51: reader.readLine();
52: return true;
53: } catch (IOException ex) {
54: throw new InstallException("IOException");
55: }
56: }
57: }
|