jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
changeset 458 54413b296bdf
parent 2 90ce3da70b43
child 715 f16baef3a20e
equal deleted inserted replaced
457:8682623ee3c3 458:54413b296bdf
    95     private JTextField fileNameTextField;
    95     private JTextField fileNameTextField;
    96 
    96 
    97     private static final Dimension hstrut3 = new Dimension(3, 1);
    97     private static final Dimension hstrut3 = new Dimension(3, 1);
    98     private static final Dimension vstrut10 = new Dimension(1, 10);
    98     private static final Dimension vstrut10 = new Dimension(1, 10);
    99 
    99 
   100     private static final Insets insets = new Insets(10, 10, 10, 10);
       
   101 
       
   102     private static Dimension prefListSize = new Dimension(75, 150);
   100     private static Dimension prefListSize = new Dimension(75, 150);
   103 
   101 
   104     private static Dimension PREF_SIZE = new Dimension(435, 360);
   102     private static Dimension PREF_SIZE = new Dimension(435, 360);
   105     private static Dimension MIN_SIZE = new Dimension(200, 300);
   103     private static Dimension MIN_SIZE = new Dimension(200, 300);
   106 
   104 
   107     private static Dimension PREF_ACC_SIZE = new Dimension(10, 10);
       
   108     private static Dimension ZERO_ACC_SIZE = new Dimension(1, 1);
   105     private static Dimension ZERO_ACC_SIZE = new Dimension(1, 1);
   109 
   106 
   110     private static Dimension MAX_SIZE = new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
   107     private static Dimension MAX_SIZE = new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
   111 
   108 
   112     private static final Insets buttonMargin = new Insets(3, 3, 3, 3);
   109     private static final Insets buttonMargin = new Insets(3, 3, 3, 3);
   123     private DirectoryComboBoxModel directoryComboBoxModel;
   120     private DirectoryComboBoxModel directoryComboBoxModel;
   124     private Action directoryComboBoxAction = new DirectoryComboBoxAction();
   121     private Action directoryComboBoxAction = new DirectoryComboBoxAction();
   125     private JPanel bottomButtonPanel;
   122     private JPanel bottomButtonPanel;
   126     private GTKDirectoryModel model = null;
   123     private GTKDirectoryModel model = null;
   127     private Action newFolderAction;
   124     private Action newFolderAction;
   128     private JPanel interior;
       
   129     private boolean readOnly;
   125     private boolean readOnly;
   130     private boolean showDirectoryIcons;
   126     private boolean showDirectoryIcons;
   131     private boolean showFileIcons;
   127     private boolean showFileIcons;
   132     private GTKFileView fileView = new GTKFileView();
   128     private GTKFileView fileView = new GTKFileView();
   133     private PropertyChangeListener gtkFCPropertyChangeListener;
   129     private PropertyChangeListener gtkFCPropertyChangeListener;
   708         // Add buttons
   704         // Add buttons
   709         bottomButtonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
   705         bottomButtonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
   710         bottomButtonPanel.setName("GTKFileChooser.bottomButtonPanel");
   706         bottomButtonPanel.setName("GTKFileChooser.bottomButtonPanel");
   711         align(bottomButtonPanel);
   707         align(bottomButtonPanel);
   712 
   708 
       
   709         JPanel pnButtons = new JPanel(new GridLayout(1, 2, 5, 0));
       
   710 
   713         JButton cancelButton = getCancelButton(fc);
   711         JButton cancelButton = getCancelButton(fc);
   714         align(cancelButton);
   712         align(cancelButton);
   715         cancelButton.setMargin(buttonMargin);
   713         cancelButton.setMargin(buttonMargin);
   716         bottomButtonPanel.add(cancelButton);
   714         pnButtons.add(cancelButton);
   717 
   715 
   718         JButton approveButton = getApproveButton(fc);;
   716         JButton approveButton = getApproveButton(fc);
   719         align(approveButton);
   717         align(approveButton);
   720         approveButton.setMargin(buttonMargin);
   718         approveButton.setMargin(buttonMargin);
   721         bottomButtonPanel.add(approveButton);
   719         pnButtons.add(approveButton);
       
   720 
       
   721         bottomButtonPanel.add(pnButtons);
   722 
   722 
   723         if (fc.getControlButtonsAreShown()) {
   723         if (fc.getControlButtonsAreShown()) {
   724             fc.add(bottomButtonPanel, BorderLayout.SOUTH);
   724             fc.add(bottomButtonPanel, BorderLayout.SOUTH);
   725         }
   725         }
   726     }
   726     }
  1106             }
  1106             }
  1107 
  1107 
  1108             // Get the canonical (full) path. This has the side
  1108             // Get the canonical (full) path. This has the side
  1109             // benefit of removing extraneous chars from the path,
  1109             // benefit of removing extraneous chars from the path,
  1110             // for example /foo/bar/ becomes /foo/bar
  1110             // for example /foo/bar/ becomes /foo/bar
  1111             File canonical = null;
  1111             File canonical;
  1112             try {
  1112             try {
  1113                 canonical = fsv.createFileObject(ShellFolder.getNormalizedFile(directory).getPath());
  1113                 canonical = fsv.createFileObject(ShellFolder.getNormalizedFile(directory).getPath());
  1114             } catch (IOException e) {
  1114             } catch (IOException e) {
  1115                 // Maybe drive is not ready. Can't abort here.
  1115                 // Maybe drive is not ready. Can't abort here.
  1116                 canonical = directory;
  1116                 canonical = directory;