@Override
public void associatedData_actionPerformed(ActionEvent e)
{
- JalviewFileChooser chooser = new JalviewFileChooser(
+ final JalviewFileChooser chooser = new JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(
MessageManager.getString("label.load_jalview_annotations"));
chooser.setToolTipText(
MessageManager.getString("label.load_jalview_annotations"));
-
- Desktop.getDesktop().dialogData = new Object[] { "SelectedFile",
- new Runnable()
+ chooser.response(new RunResponse(JalviewFileChooser.APPROVE_OPTION)
{
@Override
public void run()
{
- Object[] data = Desktop.getDesktop().dialogData;
- int value = ((Integer) data[0]).intValue();
-
- if (value == JFileChooser.APPROVE_OPTION)
- {
- JalviewFileChooser chooser = (JalviewFileChooser) data[2];
- String choice = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
- loadJalviewDataFile(choice, null, null, null);
- }
+ String choice = chooser.getSelectedFile().getPath();
+ jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
+ loadJalviewDataFile(chooser.getSelectedFile(), null, null, null);
}
- }, chooser };
-
- chooser.showOpenDialog(null);
-
-
+ });
+ chooser.openDialog(this);
}
/**