KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > izforge > izpack > event > UninstallerListener


1 /*
2  * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
3  *
4  * http://www.izforge.com/izpack/
5  * http://developer.berlios.de/projects/izpack/
6  *
7  * Copyright 2004 Klaus Bartz
8  *
9  * 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.event;
23
24 import java.io.File JavaDoc;
25 import java.util.List JavaDoc;
26
27 import com.izforge.izpack.util.AbstractUIProgressHandler;
28
29 /**
30  * <p>
31  * Implementations of this class are used to handle customizing uninstallation. The defined methods
32  * are called from the destroyer at different, well defined points of uninstallation.
33  * </p>
34  *
35  * @author Klaus Bartz
36  *
37  */

38 public interface UninstallerListener
39 {
40
41     // ------------------------------------------------------------------------
42
// Constant Definitions
43
// ------------------------------------------------------------------------
44
public static final int BEFORE_DELETION = 1;
45
46     public static final int AFTER_DELETION = 2;
47
48     public static final int BEFORE_DELETE = 3;
49
50     public static final int AFTER_DELETE = 4;
51
52     /**
53      * This method will be called from the destroyer before the given files will be deleted.
54      *
55      * @param files all files which should be deleted
56      * @param handler a handler to the current used UIProgressHandler
57      * @throws Exception
58      */

59     void beforeDeletion(List JavaDoc files, AbstractUIProgressHandler handler) throws Exception JavaDoc;
60
61     /**
62      * Returns true if this listener would be informed at every delete operation, else false. If it
63      * is true, the listener will be called two times (before and after) of every action. Handle
64      * carefully, else performance problems are possible.
65      *
66      * @return true if this listener would be informed at every delete operation, else false
67      */

68     boolean isFileListener();
69
70     /**
71      * This method will be called from the destroyer before the given file will be deleted.
72      *
73      * @param file file which should be deleted
74      * @param handler a handler to the current used UIProgressHandler
75      * @throws Exception
76      */

77     void beforeDelete(File JavaDoc file, AbstractUIProgressHandler handler) throws Exception JavaDoc;
78
79     /**
80      * This method will be called from the destroyer after the given file was deleted.
81      *
82      * @param file file which was just deleted
83      * @param handler a handler to the current used UIProgressHandler
84      * @throws Exception
85      */

86     void afterDelete(File JavaDoc file, AbstractUIProgressHandler handler) throws Exception JavaDoc;
87
88     /**
89      * This method will be called from the destroyer after the given files are deleted.
90      *
91      * @param files all files which where deleted
92      * @param handler a handler to the current used UIProgressHandler
93      * @throws Exception
94      */

95     void afterDeletion(List JavaDoc files, AbstractUIProgressHandler handler) throws Exception JavaDoc;
96
97 }
98
Popular Tags