Commit f4fad842 authored by Marian Dovgialo's avatar Marian Dovgialo

#46094 open book/tag fix

parent 07f3a55b
......@@ -45,7 +45,17 @@ public ViewerFileChooser() {
getFileChooserPanel().setViewType(FileChooserViewType.table);
this.setPreferredSize(new Dimension(500, 380));
}
public void setSelectedFile(File file)
{
if (file!=null)
{
super.setSelectedFile(file);
}
else
{
super.setSelectedFile(new File(""));
}
}
public void initialize() {
FileNameExtensionFilter text = new FileNameExtensionFilter(_("Text (*.txt)"), "txt");
FileNameExtensionFilter csv = new FileNameExtensionFilter(_("CSV (*.csv)"), "csv");
......@@ -476,7 +486,7 @@ public File fixExtensionIfNecessary(JFileChooser fileChooser, File file) {
execute = new Execute(),
usedir = new UseDirectory();
}
protected enum OptionSet {
consoleSaveAsText(Operation.save, _("Choose text file to save"),
null, _("Save")),
......@@ -592,10 +602,12 @@ void use(ViewerFileChooser chooser) {
chooser.addChoosableFileFilter(this.fileFilters[i]);
if (fileFilters.length > 0)
chooser.setFileFilter(fileFilters[0]);
}
{
chooser.setFileFilter(fileFilters[0]);
}
}
}
void setFilters(FileNameExtensionFilter ... fileFilters) {
this.fileFilters = fileFilters;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment