dmolony-DiskBrowser/src/com/bytezone/diskbrowser/gui/FileSelectedEvent.java

40 lines
1.0 KiB
Java
Raw Normal View History

2015-06-01 09:35:51 +00:00
package com.bytezone.diskbrowser.gui;
import java.util.EventObject;
import com.bytezone.diskbrowser.applefile.AppleFileSource;
import com.bytezone.diskbrowser.disk.DualDosDisk;
public class FileSelectedEvent extends EventObject
{
public final AppleFileSource file;
boolean redo;
public FileSelectedEvent (Object source, AppleFileSource file)
{
super (source);
this.file = file;
// If a file is selected from a disk which is contained in a Dual-dos disk, then the DDS
// must be told so that it can ensure its internal currentDisk is set correctly
DualDosDisk ddd = (DualDosDisk) file.getFormattedDisk ().getParent ();
if (ddd != null)
ddd.setCurrentDisk (file);
}
@Override
public String toString ()
{
return file.getUniqueName ();
}
public String toText ()
{
return file.getUniqueName ();
}
public static FileSelectedEvent create (Object source, AppleFileSource afs)
{
return new FileSelectedEvent (source, afs);
}
}