001: package org.acm.seguin.pmd.swingui.event;
002:
003: import java.io.File;
004: import java.util.EventObject;
005: import java.util.Iterator;
006: import java.util.List;
007:
008: /**
009: *
010: * @author Donald A. Leckie
011: * @since December 13, 2002
012: * @version $Revision: 1.1 $, $Date: 2003/07/29 20:51:59 $
013: */
014: public class SetupFilesEvent extends EventObject {
015:
016: private File[] m_fileList;
017:
018: /**
019: *****************************************************************************
020: *
021: */
022: private SetupFilesEvent(Object source) {
023: super (source);
024: }
025:
026: /**
027: *****************************************************************************
028: *
029: */
030: private SetupFilesEvent(Object source, File[] fileList) {
031: super (source);
032:
033: m_fileList = fileList;
034: }
035:
036: /**
037: ****************************************************************************
038: *
039: * @return
040: */
041: public File[] getFileList() {
042: return m_fileList;
043: }
044:
045: /**
046: *****************************************************************************
047: *
048: * @param file
049: */
050: public static final void notifySetFileList(Object source,
051: File[] fileList) {
052: SetupFilesEvent event = new SetupFilesEvent(source, fileList);
053: List listenerList = ListenerList
054: .getListeners(SetupFilesEventListener.class);
055: Iterator listeners = listenerList.iterator();
056:
057: while (listeners.hasNext()) {
058: SetupFilesEventListener listener;
059:
060: listener = (SetupFilesEventListener) listeners.next();
061: listener.setFileList(event);
062: }
063: }
064:
065: /**
066: *****************************************************************************
067: *
068: * @param file
069: */
070: public static final void notifyStartSetup(Object source) {
071: SetupFilesEvent event = new SetupFilesEvent(source);
072: List listenerList = ListenerList
073: .getListeners(SetupFilesEventListener.class);
074: Iterator listeners = listenerList.iterator();
075:
076: while (listeners.hasNext()) {
077: SetupFilesEventListener listener;
078:
079: listener = (SetupFilesEventListener) listeners.next();
080: listener.startSetup(event);
081: }
082: }
083:
084: /**
085: *****************************************************************************
086: *
087: * @param file
088: */
089: public static final void notifyStopSetup(Object source) {
090: SetupFilesEvent event = new SetupFilesEvent(source);
091: List listenerList = ListenerList
092: .getListeners(SetupFilesEventListener.class);
093: Iterator listeners = listenerList.iterator();
094:
095: while (listeners.hasNext()) {
096: SetupFilesEventListener listener;
097:
098: listener = (SetupFilesEventListener) listeners.next();
099: listener.stopSetup(event);
100: }
101: }
102: }
|