Changeset 3308 in josm for trunk/src


Ignore:
Timestamp:
2010-06-04T21:29:06+02:00 (14 years ago)
Author:
stoecker
Message:

fix #5102 - use directory selection dialog to select directories

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/StyleSourceEditor.java

    r3083 r3308  
    9393        tblActiveStyles.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    9494        tblActiveStyles.setTableHeader(null);
    95         tblActiveStyles.getColumnModel().getColumn(0).setCellEditor(new FileOrUrlCellEditor());
     95        tblActiveStyles.getColumnModel().getColumn(0).setCellEditor(new FileOrUrlCellEditor(true));
    9696        tblActiveStyles.setRowHeight(20);
    9797        activeStylesModel.setActiveStyles(Main.pref.getCollection(stylesPreferencesKey, null));
     
    117117            tblIconPaths.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    118118            tblIconPaths.setTableHeader(null);
    119             tblIconPaths.getColumnModel().getColumn(0).setCellEditor(new FileOrUrlCellEditor());
     119            tblIconPaths.getColumnModel().getColumn(0).setCellEditor(new FileOrUrlCellEditor(false));
    120120            tblIconPaths.setRowHeight(20);
    121121            iconPathsModel.setIconPaths(Main.pref.getCollection(iconsPreferenceKey, null));
     
    816816        private String value;
    817817        private JFileChooser fileChooser;
     818        private boolean isFile;
    818819
    819820        protected JFileChooser getFileChooser() {
    820821            if (fileChooser == null) {
    821822                this.fileChooser = new JFileChooser();
     823                if(!isFile)
     824                    fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    822825            }
    823826            return fileChooser;
     
    854857        }
    855858
    856         public FileOrUrlCellEditor() {
     859        public FileOrUrlCellEditor(boolean isFile) {
     860            this.isFile = isFile;
    857861            listeners = new CopyOnWriteArrayList<CellEditorListener>();
    858862            build();
Note: See TracChangeset for help on using the changeset viewer.