Author: pwang
Date: 2011-07-12 12:08:03 -0700 (Tue, 12 Jul 2011)
New Revision: 26154

Modified:
   
core3/work-swing-impl/trunk/impl/src/main/java/org/cytoscape/work/internal/tunables/FileHandler.java
Log:
Use filter "All image files" since we can not detect current specific filter 

Modified: 
core3/work-swing-impl/trunk/impl/src/main/java/org/cytoscape/work/internal/tunables/FileHandler.java
===================================================================
--- 
core3/work-swing-impl/trunk/impl/src/main/java/org/cytoscape/work/internal/tunables/FileHandler.java
        2011-07-12 19:05:35 UTC (rev 26153)
+++ 
core3/work-swing-impl/trunk/impl/src/main/java/org/cytoscape/work/internal/tunables/FileHandler.java
        2011-07-12 19:08:03 UTC (rev 26154)
@@ -13,6 +13,7 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.List;
+import java.util.ArrayList;
 import java.util.Properties;
 
 import javax.swing.GroupLayout;
@@ -187,10 +188,22 @@
        // Click on the "open" or "save" button action listener
        private final class myFileActionListener implements ActionListener{
                public void actionPerformed(ActionEvent ae) {
-try_again:              {
+                               try_again:  {
+       
+                               //We can not detect the filter current used, so 
we we use filter "All image files"
+                               FileChooserFilter filter = null;
+                               for (int i=0; i<filters.size(); i++){
+                                       filter = 
(FileChooserFilter)filters.get(i);
+                                       if 
(filter.getDescription().trim().equalsIgnoreCase("All image files")){
+                                               filters = new ArrayList();
+                                               filters.add(filter);
+                                               break;
+                                       }
+                               }
+       
                                final int load_or_save = input ? FileUtil.LOAD 
: FileUtil.SAVE;
                                final File file = 
fileUtil.getFile(SwingUtilities.getWindowAncestor(panel),
-                                                                  
titleLabel.getText(), load_or_save, filters);
+                                               titleLabel.getText(), 
load_or_save, filters);
                                if (file != null) {
                                        fileTextField.setFont(new Font(null, 
Font.PLAIN, 10));
                                        
fileTextField.setText(file.getAbsolutePath());

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to