StageManager.addAndShow(jvs);
}
private void chooseHotSpotFile()
{
FileChooser fc = new FileChooser();
fc.setTitle("Choose HotSpot log file");
String osNameProperty = System.getProperty("os.name");
// don't use ExtensionFilter on OSX due to JavaFX2 missing combo bug
if (osNameProperty != null && !osNameProperty.toLowerCase().contains("mac"))
{
fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("Log Files", "*.log"),
new FileChooser.ExtensionFilter("All Files", "*.*"));
}
String searchDir = getConfig().getLastLogDir();
if (searchDir == null)
{
searchDir = System.getProperty("user.dir");
}
File dirFile = new File(searchDir);
if (!dirFile.exists() || !dirFile.isDirectory())
{
dirFile = new File(System.getProperty("user.dir"));
}
fc.setInitialDirectory(dirFile);
File result = fc.showOpenDialog(stage);
if (result != null)
{
setHotSpotLogFile(result);
}