View Javadoc

1   package org.lcsim.plugin;
2   
3   import java.io.IOException;
4   import org.freehep.application.studio.Studio;
5   import org.freehep.swing.ErrorDialog;
6   import org.freehep.swing.ExtensionFileFilter;
7   import org.lcsim.util.loop.LCIOEventSource;
8   
9   /**
10   *
11   * @author tonyj
12   */
13  class LCSimFileSelector extends FileSelector
14  {
15     private Studio app;
16     /** Creates a new instance of LCSimFileSelector */
17     public LCSimFileSelector(Studio app)
18     {
19        super(app,"LCIO","slcio.filelist",new ExtensionFileFilter("slcio","LCIO File"),new ExtensionFileFilter("slcio.filelist","LCIO File List"));
20        this.app = app;
21     }
22     
23     public void onFinish()
24     {
25        try
26        {
27           LCIOEventSource source = isMultiFileSelected() ? new LCIOEventSource(getSelectedFiles()) : new LCIOEventSource(getSelectedFile());
28           app.getLookup().add(source);
29           super.onFinish();
30        }
31        catch (IOException x)
32        {
33           ErrorDialog.showErrorDialog(this,"Error saving file list",x);
34        }
35     }
36  }