24 |
|
|
25 |
import java.util.Vector; |
import java.util.Vector; |
26 |
|
|
27 |
import javax.swing.event.ChangeEvent; |
import net.sf.juife.event.GenericEvent; |
28 |
import javax.swing.event.ChangeListener; |
import net.sf.juife.event.GenericListener; |
|
|
|
29 |
import net.sf.juife.event.TaskEvent; |
import net.sf.juife.event.TaskEvent; |
30 |
import net.sf.juife.event.TaskListener; |
import net.sf.juife.event.TaskListener; |
31 |
|
|
37 |
*/ |
*/ |
38 |
public class LostFilesModel { |
public class LostFilesModel { |
39 |
private final Vector<String> lostFiles = new Vector<String>(); |
private final Vector<String> lostFiles = new Vector<String>(); |
40 |
private final Vector<ChangeListener> listeners = new Vector<ChangeListener>(); |
private final Vector<GenericListener> listeners = new Vector<GenericListener>(); |
41 |
|
|
42 |
/** Creates a new instance of <code>LostFilesModel</code> */ |
/** Creates a new instance of <code>LostFilesModel</code> */ |
43 |
public |
public |
46 |
/** |
/** |
47 |
* Registers the specified listener to be notified when the list |
* Registers the specified listener to be notified when the list |
48 |
* of lost files is updated. |
* of lost files is updated. |
49 |
* @param l The <code>ChangeListener</code> to register. |
* @param l The <code>GenericListener</code> to register. |
50 |
*/ |
*/ |
51 |
public void |
public void |
52 |
addChangeListener(ChangeListener l) { listeners.add(l); } |
addChangeListener(GenericListener l) { listeners.add(l); } |
53 |
|
|
54 |
/** |
/** |
55 |
* Removes the specified listener. |
* Removes the specified listener. |
56 |
* @param l The <code>ChangeListener</code> to remove. |
* @param l The <code>GenericListener</code> to remove. |
57 |
*/ |
*/ |
58 |
public void |
public void |
59 |
removeChangeListener(ChangeListener l) { listeners.remove(l); } |
removeChangeListener(GenericListener l) { listeners.remove(l); } |
60 |
|
|
61 |
/** Returns a list of all lost files. */ |
/** Returns a list of all lost files. */ |
62 |
public String[] |
public String[] |
104 |
*/ |
*/ |
105 |
private void |
private void |
106 |
fireLostFileListUpdated() { |
fireLostFileListUpdated() { |
107 |
ChangeEvent e = new ChangeEvent(this); |
GenericEvent e = new GenericEvent(this); |
108 |
for(ChangeListener l : listeners) l.stateChanged(e); |
for(GenericListener l : listeners) l.jobDone(e); |
109 |
} |
} |
110 |
} |
} |