/[svn]/jsampler/trunk/src/org/jsampler/view/std/JSLostFilesDlg.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/std/JSLostFilesDlg.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1870 by iliev, Tue Apr 29 22:22:40 2008 UTC revision 1871 by iliev, Sun Mar 22 18:11:39 2009 UTC
# Line 1  Line 1 
1  /*  /*
2   *   JSampler - a java front-end for LinuxSampler   *   JSampler - a java front-end for LinuxSampler
3   *   *
4   *   Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com>   *   Copyright (C) 2005-2009 Grigor Iliev <grigor@grigoriliev.com>
5   *   *
6   *   This file is part of JSampler.   *   This file is part of JSampler.
7   *   *
# Line 32  import java.awt.Insets; Line 32  import java.awt.Insets;
32  import java.awt.event.ActionEvent;  import java.awt.event.ActionEvent;
33  import java.awt.event.ActionListener;  import java.awt.event.ActionListener;
34    
35    import java.io.File;
36    
37  import javax.swing.BorderFactory;  import javax.swing.BorderFactory;
38  import javax.swing.Box;  import javax.swing.Box;
39  import javax.swing.BoxLayout;  import javax.swing.BoxLayout;
40  import javax.swing.Icon;  import javax.swing.Icon;
41  import javax.swing.JButton;  import javax.swing.JButton;
 import javax.swing.JFileChooser;  
42  import javax.swing.JLabel;  import javax.swing.JLabel;
43  import javax.swing.JPanel;  import javax.swing.JPanel;
44  import javax.swing.JScrollPane;  import javax.swing.JScrollPane;
# Line 127  public class JSLostFilesDlg extends Info Line 128  public class JSLostFilesDlg extends Info
128          getHandler() { return eventHandler; }          getHandler() { return eventHandler; }
129                    
130          private class EventHandler implements ListSelectionListener, ChangeListener {          private class EventHandler implements ListSelectionListener, ChangeListener {
131                    @Override
132                  public void                  public void
133                  valueChanged(ListSelectionEvent e) {                  valueChanged(ListSelectionEvent e) {
134                          if(e.getValueIsAdjusting()) return;                          if(e.getValueIsAdjusting()) return;
# Line 135  public class JSLostFilesDlg extends Info Line 137  public class JSLostFilesDlg extends Info
137                          btnRename.setEnabled(!lsm.isSelectionEmpty());                          btnRename.setEnabled(!lsm.isSelectionEmpty());
138                  }                  }
139                                    
140                    @Override
141                  public void                  public void
142                  stateChanged(ChangeEvent e) {                  stateChanged(ChangeEvent e) {
143                          boolean b = CC.getLostFilesModel().getLostFileCount() != 0;                          boolean b = CC.getLostFilesModel().getLostFileCount() != 0;
# Line 324  class JSReplaceLostFilesDlg extends Info Line 327  class JSReplaceLostFilesDlg extends Info
327                    
328          private String          private String
329          browse() {          browse() {
330                  JFileChooser fc = new JFileChooser();                  File f = StdUtils.showOpenDirectoryChooser(this, null);
331                  fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);                  if(f == null) return null;
                 int result = fc.showOpenDialog(this);  
                 if(result != JFileChooser.APPROVE_OPTION) return null;  
332                                    
333                  String path = fc.getSelectedFile().getAbsolutePath();                  String path = f.getAbsolutePath();
334                  if(path.length() < 2) return path;                  if(path.length() < 2) return path;
335                                    
336                  char sep = java.io.File.separatorChar;                  char sep = java.io.File.separatorChar;
# Line 345  class JSReplaceLostFilesDlg extends Info Line 346  class JSReplaceLostFilesDlg extends Info
346                    
347          private class EventHandler implements DocumentListener {          private class EventHandler implements DocumentListener {
348                  // DocumentListener                  // DocumentListener
349                    @Override
350                  public void                  public void
351                  insertUpdate(DocumentEvent e) { updateState(); }                  insertUpdate(DocumentEvent e) { updateState(); }
352                                    
353                    @Override
354                  public void                  public void
355                  removeUpdate(DocumentEvent e) { updateState(); }                  removeUpdate(DocumentEvent e) { updateState(); }
356                                    
357                    @Override
358                  public void                  public void
359                  changedUpdate(DocumentEvent e) { updateState(); }                  changedUpdate(DocumentEvent e) { updateState(); }
360          }          }

Legend:
Removed from v.1870  
changed lines
  Added in v.1871

  ViewVC Help
Powered by ViewVC