01: /*
02: * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
03: *
04: * http://izpack.org/
05: * http://izpack.codehaus.org/
06: *
07: * Copyright 2003 Tino Schwarze
08: *
09: * Licensed under the Apache License, Version 2.0 (the "License");
10: * you may not use this file except in compliance with the License.
11: * You may obtain a copy of the License at
12: *
13: * http://www.apache.org/licenses/LICENSE-2.0
14: *
15: * Unless required by applicable law or agreed to in writing, software
16: * distributed under the License is distributed on an "AS IS" BASIS,
17: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18: * See the License for the specific language governing permissions and
19: * limitations under the License.
20: */
21:
22: package com.izforge.izpack.installer;
23:
24: import com.izforge.izpack.util.AbstractUIHandler;
25:
26: /**
27: * Abstract class implementing basic functions needed by all panel automation helpers.
28: *
29: * @author tisc
30: */
31: abstract public class PanelAutomationHelper implements
32: AbstractUIHandler {
33:
34: /*
35: * @see com.izforge.izpack.util.AbstractUIHandler#emitNotification(java.lang.String)
36: */
37: public void emitNotification(String message) {
38: System.out.println(message);
39: }
40:
41: /*
42: * @see com.izforge.izpack.util.AbstractUIHandler#emitWarning(java.lang.String,
43: * java.lang.String)
44: */
45: public boolean emitWarning(String title, String message) {
46: System.err.println("[ WARNING: " + message + " ]");
47: // default: continue
48: return true;
49: }
50:
51: /*
52: * @see com.izforge.izpack.util.AbstractUIHandler#emitError(java.lang.String, java.lang.String)
53: */
54: public void emitError(String title, String message) {
55: System.err.println("[ ERROR: " + message + " ]");
56: }
57:
58: /*
59: * @see com.izforge.izpack.util.AbstractUIHandler#askQuestion(java.lang.String,
60: * java.lang.String, int)
61: */
62: public int askQuestion(String title, String question, int choices) {
63: // don't know what to answer
64: return AbstractUIHandler.ANSWER_CANCEL;
65: }
66:
67: /*
68: * @see com.izforge.izpack.util.AbstractUIHandler#askQuestion(java.lang.String,
69: * java.lang.String, int, int)
70: */
71: public int askQuestion(String title, String question, int choices,
72: int default_choice) {
73: return default_choice;
74: }
75:
76: }
|