1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 /* 24 * Created on 04.11.2003 25 * 26 * To change the template for this generated file go to 27 * Window>Preferences>Java>Code Generation>Code and Comments 28 */ 29 package com.sun.star.wizards.web.status; 30 31 import java.io.PrintStream; 32 33 /** 34 * @author rpiterman 35 * 36 * To change the template for this generated type comment go to 37 * Window>Preferences>Java>Code Generation>Code and Comments 38 */ 39 public class LogTaskListener implements TaskListener 40 { 41 42 private PrintStream out; 43 LogTaskListener(PrintStream os)44 public LogTaskListener(PrintStream os) 45 { 46 out = os; 47 } 48 49 /* (non-Javadoc) 50 * @see com.sun.star.wizards.web.status.TaskListener#taskStarted(com.sun.star.wizards.web.status.TaskEvent) 51 */ taskStarted(TaskEvent te)52 public void taskStarted(TaskEvent te) 53 { 54 out.println("TASK " + te.getTask().getTaskName() + " STARTED."); 55 56 } 57 58 /* (non-Javadoc) 59 * @see com.sun.star.wizards.web.status.TaskListener#taskFinished(com.sun.star.wizards.web.status.TaskEvent) 60 */ taskFinished(TaskEvent te)61 public void taskFinished(TaskEvent te) 62 { 63 out.println("TASK " + te.getTask().getTaskName() + " FINISHED: " + te.getTask().getSuccessfull() + "/" + te.getTask().getMax() + "Succeeded."); 64 65 } 66 67 /* (non-Javadoc) 68 * @see com.sun.star.wizards.web.status.TaskListener#taskStatusChanged(com.sun.star.wizards.web.status.TaskEvent) 69 */ taskStatusChanged(TaskEvent te)70 public void taskStatusChanged(TaskEvent te) 71 { 72 out.println("TASK " + te.getTask().getTaskName() + " status : " + te.getTask().getSuccessfull() + "(+" + te.getTask().getFailed() + ")/" + te.getTask().getMax()); 73 } 74 75 /* (non-Javadoc) 76 * @see com.sun.star.wizards.web.status.TaskListener#subtaskNameChanged(com.sun.star.wizards.web.status.TaskEvent) 77 */ subtaskNameChanged(TaskEvent te)78 public void subtaskNameChanged(TaskEvent te) 79 { 80 out.println("SUBTASK Name:" + te.getTask().getSubtaskName()); 81 } 82 } 83