source: release-kits/shared/ant-installer/src/org/tp23/antinstaller/antmod/FeedbackListener.java@ 17514

Last change on this file since 17514 was 17514, checked in by oranfry, 16 years ago

changes to the way ant-installer loads and reloads the language packs, and a new attribute to the select input which triggers it to change the language to the input value

File size: 3.1 KB
Line 
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.antmod;
17
18import java.util.ResourceBundle;
19
20import org.apache.tools.ant.BuildEvent;
21import org.apache.tools.ant.BuildListener;
22import org.tp23.antinstaller.renderer.swing.SwingInstallerContext;
23import org.tp23.antinstaller.Installer;
24
25/**
26 *
27 * <p>Reports a message in the swing UI this mesage is reported in the
28 * top of the window. </p>
29 * <p>The Listeners should apparently never uses System.out or System.err</p>
30 * This class is not really an Ant modification since it simply implements
31 * a public interface but is here on the offchance that one day Ant changes
32 * it's APIs
33 * @author Paul Hinds
34 * @version $Id: FeedbackListener.java,v 1.1.1.1 2005/10/18 18:20:52 teknopaul Exp $
35 */
36public class FeedbackListener implements BuildListener{
37
38 private final SwingInstallerContext swingCtx;
39
40 public FeedbackListener(SwingInstallerContext swingCtx) {
41 this.swingCtx=swingCtx;
42 }
43
44 /**
45 * buildStarted This event results in User notification
46 *
47 * @param buildEvent BuildEvent
48 */
49 public void buildStarted(BuildEvent buildEvent) {
50 //swingCtx.provideAntFeedBack(buildEvent.getMessage());
51 swingCtx.buildStarted(buildEvent);
52 }
53
54 /**
55 * buildFinished This event results in User notification
56 *
57 * @param buildEvent BuildEvent
58 */
59 public void buildFinished(BuildEvent buildEvent) {
60 swingCtx.provideAntFeedBack(org.tp23.antinstaller.Installer.langPack.getString("installFinished"));
61 swingCtx.buildFinished(buildEvent);
62 }
63
64 /**
65 * targetStarted This event results in User notification
66 *
67 * @param buildEvent BuildEvent
68 */
69 public void targetStarted(BuildEvent buildEvent) {
70 swingCtx.provideAntFeedBack(org.tp23.antinstaller.Installer.langPack.getString("running")+buildEvent.getTarget());
71 swingCtx.targetStarted(buildEvent);
72 }
73
74 /**
75 * targetFinished This event is ignored
76 * @param buildEvent BuildEvent
77 */
78 public void targetFinished(BuildEvent buildEvent) {
79 swingCtx.targetFinished(buildEvent);
80 }
81
82 /**
83 * taskStarted This event is ignored
84 * @param buildEvent BuildEvent
85 */
86 public void taskStarted(BuildEvent buildEvent) {
87 //swingCtx.provideAntFeedBack(buildEvent.getMessage());
88 }
89
90 /**
91 * taskFinished This event is ignored
92 * @param buildEvent BuildEvent
93 */
94 public void taskFinished(BuildEvent buildEvent) {
95 //swingCtx.provideAntFeedBack(buildEvent.getMessage());
96 }
97
98 /**
99 * messageLogged This event is ignored
100 * @param buildEvent BuildEvent
101 */
102 public void messageLogged(BuildEvent buildEvent) {
103 //swingCtx.provideAntFeedBack(buildEvent.getMessage());
104 }
105}
Note: See TracBrowser for help on using the repository browser.