* This actually brings up a JFileChooser to select a new Folder for
* the value of the property.
*/
public void selectNewFolder() {
FileSystemView mfsv = createFileSystemView();
String defaultRoot = valueDisplay.getText();
if (defaultRoot.equals("")) {
defaultRoot = "/";
try {
String storeName = property.substring(property.indexOf('.') + 1, property.indexOf('.', property.indexOf('.') + 1));
StoreInfo si = Pooka.getStoreManager().getStoreInfo(storeName);
if (si != null) {
defaultRoot = storeName;
}
} catch (Exception e) {
}
} else {
if (defaultRoot.lastIndexOf('/') > -1) {
defaultRoot = defaultRoot.substring(0, defaultRoot.lastIndexOf('/'));
}
}
JFileChooser jfc =
new JFileChooser(defaultRoot, mfsv);
jfc.setMultiSelectionEnabled(false);
jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
// workaround for bug in jdk 1.4
jfc.setCurrentDirectory(mfsv.createFileObject(defaultRoot));
int returnValue =
jfc.showDialog(Pooka.getMainPanel(),
Pooka.getProperty("FolderEditorPane.Select",
"Select"));