mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-20 04:29:02 +00:00
40 lines
917 B
Java
Executable File
40 lines
917 B
Java
Executable File
package com.bytezone.diskbrowser.gui;
|
|
|
|
import java.util.EventObject;
|
|
|
|
import com.bytezone.diskbrowser.disk.DiskFactory;
|
|
import com.bytezone.diskbrowser.disk.FormattedDisk;
|
|
|
|
public class DiskSelectedEvent extends EventObject
|
|
{
|
|
private final FormattedDisk owner;
|
|
boolean redo;
|
|
|
|
public DiskSelectedEvent (Object source, FormattedDisk disk)
|
|
{
|
|
super (source);
|
|
this.owner = disk;
|
|
}
|
|
|
|
public FormattedDisk getFormattedDisk ()
|
|
{
|
|
return owner;
|
|
}
|
|
|
|
@Override
|
|
public String toString ()
|
|
{
|
|
return owner.getDisk ().getFile ().getAbsolutePath ();
|
|
}
|
|
|
|
public String toText ()
|
|
{
|
|
return owner.getAbsolutePath ();
|
|
}
|
|
|
|
public static DiskSelectedEvent create (Object source, String path)
|
|
{
|
|
FormattedDisk formattedDisk = DiskFactory.createDisk (path);
|
|
return formattedDisk == null ? null : new DiskSelectedEvent (source, formattedDisk);
|
|
}
|
|
} |