/*
 * @(#) ListSelectEvent.java 1.0 2001/21/12 
 * Copyright (c) 2001 Lawrence Rodrigues
 */

package com.vistech.events;
import java.io.*;
import java.awt.*;

/** This is an event-state class for the list select event. 
  * This class can be used for generating a ListSelectEvent object when files selected
  * in a local directory or a jar file.  
  * @version 2.0  12 dec 2001
  * @author Lawrence Rodrigues
  **/
public class ListSelectEvent  extends java.awt.event.ActionEvent
         implements Serializable{
   protected File path;
   protected String[] fileList;
   /**
     *@param obj source object where the event originated.
     *@param command the action associated with the event. 
     * When the ListSelectEvent is generated for jar files, this parameter may contain the
     * the directory. 
     *@param dir the local directory. In the of case of jar file, this parameter holds the jar file.
     *@param flist the list of file names. It must not include the path. 
     */
   public ListSelectEvent(Object obj, String command,File dir, String[] flist){
      super(obj,(int)AWTEvent.ACTION_EVENT_MASK, command);
      this.path = dir;
      this.fileList = flist;
   }

   /**
     * @return the list of selected files.
     */
      
   public String[] getFileList(){
      return fileList;
   }
   
   /**
     * @return the directory in which the files reside. 
     */
   public File getPath(){
      return path;
   }
}

