Project

General

Profile

Actions

Bug #5191

closed

GUI improvements to Save As

Added by Derik Barseghian over 13 years ago. Updated over 13 years ago.

Status:
Resolved
Priority:
Normal
Category:
interface
Target version:
Start date:
09/28/2010
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
5191

Description

Jing reports that the File > Save As... file filter should be KAR, instead of all files.

I also notice the title of the dialog box for the Save As...action is "Save", when it should be "Save As".

Targeting 2.2 since these aren't critical.

Actions #1

Updated by Christopher Brooks over 13 years ago

My opinion is that this should be fixed before 2.1 goes out.
2.1 introduces new functionality. This is a bug in that functionality.

Actions #2

Updated by Derik Barseghian over 13 years ago

I've fixed the title part.

'Save Archive (KAR)' in 2.0 is now 'Save As...' in 2.1, so these are issues in 2.0 as well.
I don't think the filter part is a critical bug -- if when saving a kar file I could choose between seeing all files or kar files, I prefer all files, so that I have more points of reference wrt files on my OS. Also the Save As process tacks on a .kar to the file name if necessary, so that's not a concern.

A good compromise is how ptolemy's Save as... works, with two user-choosable filters, one for all files, and one for the relevant extension(s). I went to utilize TableauFrame's ExtensionFileFilter, but it's protected with this note:

protected static class ExtensionFileFilter extends FileFilter {
// NetBeans wants this protected. If it is package visibility,
// then there are problems accessing it from the same package
// but a different jar.

I'd rather not replicate this code, but I guess we can. Thoughts?

Actions #3

Updated by Christopher Brooks over 13 years ago

I agree that the issue is not critical. However, you are introducing new
functionality and it is not yet complete.

I'm not sure about TableauFrame. The log says:

r49540 | cxh | 2008-05-23 17:55:37 -0700 (Fri, 23 May 2008) | 7 lines

Ian Brown: Netbeans:
TableauFrame$ExtensionFileFilter was defined with package
visibility. This causes problems when accessing it from the same
package but different JAR. Not sure why - almost certainly a
classloader issue. In any case, I changed it to protected access so
that PlotTableauFrame can access it from a separate plug-in jar.

Did you want to make ExtensionsFileFilter public? I think that would
be ok. The issue is that it was package protected before and that
caused problems.

Actions #4

Updated by Derik Barseghian over 13 years ago

Yes, if making ExtensionsFileFilter public doesn't cause problems, I could use it.
Can you make this change if you're ok with it?

Actions #5

Updated by Christopher Brooks over 13 years ago

I made ExtensionFileFilter public and updated the rel-8-0-beta-2 tree.
This indicates that you would need to update your ptolemy-8.0 module.

Actions #6

Updated by Derik Barseghian over 13 years ago

Re: comment#5 - I've been waiting to hear from the leadership team re: having kepler require 1.6 before moving ptolemy forward. Once that's done I can make use of that change to fix this bug.

Actions #7

Updated by Derik Barseghian over 13 years ago

fixed at r26641.

Turns out Kepler has its own ExtensionFileFilter that I previously missed , which is different from ptolemy's (actually I see two in ptolemy now - ExtensionFileFilter and inner class ExtensionFileFilter in TableauFrame). The Kepler one is already in use by some Kepler dialogs, so to be consistent I've used it.

Christopher if you want you can revert the change you made for me r59343. Sorry about that.

Actions #8

Updated by Christopher Brooks over 13 years ago

BTW - org.kepler.gui.util.ExtensionFileFilter is very similar to
diva.gui.ExtensionFileFilter.

I cleaned up a few classes in Ptolemy so that we use diva.gui.ExtensionFileFilter.

Note that in Java 6, there is a new class:
javax.swing.filechooser.FileNameExtensionFilter which appears
to be a good replacement for both org.kepler.gui.util.ExtensionFileFilter
and diva.gui.ExtensionFileFilter. I added a comment about this to
both classes. I deprecated ExtensionFileFilter in TableauFrame and
have it extending diva.gui.ExtensionFileFilter.

I'm too chicken to require Java 6 in the Ptolemy core at this time.
We might want to compile a subset of Ptolemy under Java 1.5 at some point.

BTW - Under Mac OS X Java 1.6, it looks like JFileChooser.showSaveDialog()
ignore the the file filter added by calling addChoosableFileFilter(). The
issue is that the files marked as acceptable are not highlighted. One
workaround is to call JFileChooser.showDialog() instead of showSaveDialog().
However, showDialog() has slight different button labels than showSaveDialog().

Actions #9

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 5191

Actions

Also available in: Atom PDF