Search in sources :

Example 1 with DelimitersPanel

use of ambit2.ui.DelimitersPanel in project ambit-mirror by ideaconsult.

the class FileSelector method actionPerformed.

public void actionPerformed(ActionEvent e) {
    DelimitersPanel accessory = new DelimitersPanel();
    File file = MyIOUtilities.selectFile(JOptionPane.getFrameForComponent(this), "Select file", Preferences.getProperty(Preferences.DEFAULT_DIR), getObject().getSupportedExtensions(), getObject().getSupportedExtDescriptions(), getObject() instanceof IInputState, accessory);
    if (file != null) {
        getObject().setFile(file, accessory.getFormat());
        try {
            if (file.getParent() != null) {
                Preferences.setProperty(Preferences.DEFAULT_DIR, file.getParent());
                Preferences.saveProperties(getClass().getName());
            }
        } catch (Exception x) {
        }
        filename.setText(getObject().getFilename());
        filename.setToolTipText(getObject().getFilename());
    }
}
Also used : DelimitersPanel(ambit2.ui.DelimitersPanel) IInputState(ambit2.core.io.IInputState) File(java.io.File)

Aggregations

IInputState (ambit2.core.io.IInputState)1 DelimitersPanel (ambit2.ui.DelimitersPanel)1 File (java.io.File)1