01: /*
02: * Licensed under the Apache License, Version 2.0 (the "License");
03: * you may not use this file except in compliance with the License.
04: * You may obtain a copy of the License at
05: *
06: * http://www.apache.org/licenses/LICENSE-2.0
07: *
08: * Unless required by applicable law or agreed to in writing, software
09: * distributed under the License is distributed on an "AS IS" BASIS,
10: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11: * See the License for the specific language governing permissions and
12: * limitations under the License.
13: */
14: package org.tp23.antinstaller.renderer.text;
15:
16: import java.io.BufferedReader;
17: import java.io.IOException;
18: import java.io.PrintStream;
19:
20: import org.tp23.antinstaller.InstallerContext;
21: import org.tp23.antinstaller.input.HiddenPropertyInput;
22: import org.tp23.antinstaller.input.OutputField;
23:
24: /**
25: * Text UI Renderer for hidden properties - displays nothing
26: *
27: * @author mwilson
28: * @version $Id
29: * @since 0.7.4 patch 6
30: */
31: public class HiddenPropertyInputRenderer implements
32: TextOutputFieldRenderer {
33:
34: public void setContext(InstallerContext ctx) {
35:
36: }
37:
38: public void renderOutput(OutputField field, BufferedReader reader,
39: PrintStream out) throws IOException {
40: HiddenPropertyInput propertyField = (HiddenPropertyInput) field;
41:
42: if (!propertyField.isEditted()) {
43: propertyField.setInputResult(propertyField
44: .getDefaultValue());
45: }
46: }
47:
48: public void renderError(OutputField field, BufferedReader reader,
49: PrintStream out) throws IOException {
50:
51: }
52:
53: public boolean isAbort() {
54: return false;
55: }
56: }
|