1 /* 
2  * Copyright 2005 Paul Hinds
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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 */
16package org.tp23.antinstaller.renderer.text;
17
18import java.io.IOException;
19import java.io.PrintStream;
20
21import org.tp23.antinstaller.InstallException;
22import org.tp23.antinstaller.page.Page;
23import org.tp23.antinstaller.renderer.AntOutputRenderer;
24
25
26public class ProgressPageRenderer extends AbstractTextPageRenderer implements AntOutputRenderer {
27
28    public ProgressPageRenderer() {
29    }
30
31    /**
32     * getErr
33     *
34     * @return PrintStream
35     */
36    public PrintStream getErr() {
37        return System.err;
38    }
39
40
41
42    /**
43     * getOut
44     *
45     * @return PrintStream
46     */
47    public PrintStream getOut() {
48        return System.out;
49    }
50
51
52
53    /**
54     * renderPage
55     *
56     * @param page Page
57     * @return boolean
58     */
59    public boolean renderPage(Page page) throws InstallException {
60        try {
61            printHeader(page);
62        }
63        catch (IOException ex) {
64            throw new InstallException("Can not print header");// not very likely!!
65        }
66        return true;
67    }
68}
69