45 |
|
|
46 |
import org.jsampler.CC; |
import org.jsampler.CC; |
47 |
import org.jsampler.Instrument; |
import org.jsampler.Instrument; |
48 |
|
import org.jsampler.JSPrefs; |
49 |
|
|
50 |
import static org.jsampler.view.std.StdI18n.i18n; |
import static org.jsampler.view.std.StdI18n.i18n; |
51 |
|
|
165 |
updateState(); |
updateState(); |
166 |
} |
} |
167 |
|
|
168 |
|
protected JSPrefs |
169 |
|
preferences() { return CC.getViewConfig().preferences(); } |
170 |
|
|
171 |
private void |
private void |
172 |
updateInfo() { |
updateInfo() { |
173 |
tfName.setText(getInstrument().getName()); |
tfName.setText(getInstrument().getName()); |
231 |
// ActionListener |
// ActionListener |
232 |
public void |
public void |
233 |
actionPerformed(ActionEvent e) { |
actionPerformed(ActionEvent e) { |
234 |
JFileChooser fc = new JFileChooser(); |
String path = preferences().getStringProperty("lastInstrumentLocation"); |
235 |
|
JFileChooser fc = new JFileChooser(path); |
236 |
int result = fc.showOpenDialog(JSAddOrEditInstrumentDlg.this); |
int result = fc.showOpenDialog(JSAddOrEditInstrumentDlg.this); |
237 |
if(result != JFileChooser.APPROVE_OPTION) return; |
if(result != JFileChooser.APPROVE_OPTION) return; |
238 |
|
|
239 |
tfPath.setText(fc.getSelectedFile().getAbsolutePath()); |
tfPath.setText(fc.getSelectedFile().getAbsolutePath()); |
240 |
|
path = fc.getCurrentDirectory().getAbsolutePath(); |
241 |
|
preferences().setStringProperty("lastInstrumentLocation", path); |
242 |
} |
} |
243 |
} |
} |
244 |
} |
} |