001/* 002 * IzPack - Copyright 2001-2005 Julien Ponge, All Rights Reserved. 003 * 004 * http://www.izforge.com/izpack/ 005 * http://developer.berlios.de/projects/izpack/ 006 * 007 * Copyright 2003 Tino Schwarze 008 * 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 */ 021 022package com.izforge.izpack.installer; 023 024import com.izforge.izpack.util.AbstractUIHandler; 025 026/** 027 * Abstract class implementing basic functions needed by all panel automation helpers. 028 * 029 * @author tisc 030 */ 031abstract public class PanelAutomationHelper implements AbstractUIHandler 032{ 033 034 /* 035 * @see com.izforge.izpack.util.AbstractUIHandler#emitNotification(java.lang.String) 036 */ 037 public void emitNotification(String message) 038 { 039 System.out.println(message); 040 } 041 042 /* 043 * @see com.izforge.izpack.util.AbstractUIHandler#emitWarning(java.lang.String, 044 * java.lang.String) 045 */ 046 public boolean emitWarning(String title, String message) 047 { 048 System.err.println("[ WARNING: " + message + " ]"); 049 // default: continue 050 return true; 051 } 052 053 /* 054 * @see com.izforge.izpack.util.AbstractUIHandler#emitError(java.lang.String, java.lang.String) 055 */ 056 public void emitError(String title, String message) 057 { 058 System.err.println("[ ERROR: " + message + " ]"); 059 } 060 061 /* 062 * @see com.izforge.izpack.util.AbstractUIHandler#askQuestion(java.lang.String, 063 * java.lang.String, int) 064 */ 065 public int askQuestion(String title, String question, int choices) 066 { 067 // don't know what to answer 068 return AbstractUIHandler.ANSWER_CANCEL; 069 } 070 071 /* 072 * @see com.izforge.izpack.util.AbstractUIHandler#askQuestion(java.lang.String, 073 * java.lang.String, int, int) 074 */ 075 public int askQuestion(String title, String question, int choices, int default_choice) 076 { 077 return default_choice; 078 } 079 080}