| 1 | /* JFileChooser.java --
|
|---|
| 2 | Copyright (C) 2002 Free Software Foundation, Inc.
|
|---|
| 3 |
|
|---|
| 4 | This file is part of GNU Classpath.
|
|---|
| 5 |
|
|---|
| 6 | GNU Classpath is free software; you can redistribute it and/or modify
|
|---|
| 7 | it under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | any later version.
|
|---|
| 10 |
|
|---|
| 11 | GNU Classpath is distributed in the hope that it will be useful, but
|
|---|
| 12 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 14 | General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with GNU Classpath; see the file COPYING. If not, write to the
|
|---|
| 18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|---|
| 19 | 02111-1307 USA.
|
|---|
| 20 |
|
|---|
| 21 | Linking this library statically or dynamically with other modules is
|
|---|
| 22 | making a combined work based on this library. Thus, the terms and
|
|---|
| 23 | conditions of the GNU General Public License cover the whole
|
|---|
| 24 | combination.
|
|---|
| 25 |
|
|---|
| 26 | As a special exception, the copyright holders of this library give you
|
|---|
| 27 | permission to link this library with independent modules to produce an
|
|---|
| 28 | executable, regardless of the license terms of these independent
|
|---|
| 29 | modules, and to copy and distribute the resulting executable under
|
|---|
| 30 | terms of your choice, provided that you also meet, for each linked
|
|---|
| 31 | independent module, the terms and conditions of the license of that
|
|---|
| 32 | module. An independent module is a module which is not derived from
|
|---|
| 33 | or based on this library. If you modify this library, you may extend
|
|---|
| 34 | this exception to your version of the library, but you are not
|
|---|
| 35 | obligated to do so. If you do not wish to do so, delete this
|
|---|
| 36 | exception statement from your version. */
|
|---|
| 37 |
|
|---|
| 38 | package javax.swing;
|
|---|
| 39 |
|
|---|
| 40 | // Imports
|
|---|
| 41 | import java.awt.*;
|
|---|
| 42 | import java.awt.event.*;
|
|---|
| 43 | import java.io.*;
|
|---|
| 44 | import java.util.*;
|
|---|
| 45 | import javax.accessibility.*;
|
|---|
| 46 | import javax.swing.filechooser.*;
|
|---|
| 47 | import javax.swing.filechooser.FileFilter;
|
|---|
| 48 | import javax.swing.plaf.*;
|
|---|
| 49 |
|
|---|
| 50 | /**
|
|---|
| 51 | * JFileChooser
|
|---|
| 52 | * @author Andrew Selkirk
|
|---|
| 53 | * @version 1.0
|
|---|
| 54 | */
|
|---|
| 55 | public class JFileChooser extends JComponent implements Accessible {
|
|---|
| 56 |
|
|---|
| 57 | //-------------------------------------------------------------
|
|---|
| 58 | // Classes ----------------------------------------------------
|
|---|
| 59 | //-------------------------------------------------------------
|
|---|
| 60 |
|
|---|
| 61 | /**
|
|---|
| 62 | * AccessibleJFileChooser
|
|---|
| 63 | */
|
|---|
| 64 | protected class AccessibleJFileChooser extends AccessibleJComponent {
|
|---|
| 65 |
|
|---|
| 66 | //-------------------------------------------------------------
|
|---|
| 67 | // Variables --------------------------------------------------
|
|---|
| 68 | //-------------------------------------------------------------
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 | //-------------------------------------------------------------
|
|---|
| 72 | // Initialization ---------------------------------------------
|
|---|
| 73 | //-------------------------------------------------------------
|
|---|
| 74 |
|
|---|
| 75 | /**
|
|---|
| 76 | * Constructor AccessibleJFileChooser
|
|---|
| 77 | * @param component TODO
|
|---|
| 78 | */
|
|---|
| 79 | protected AccessibleJFileChooser(JFileChooser component) {
|
|---|
| 80 | super(component);
|
|---|
| 81 | // TODO
|
|---|
| 82 | } // AccessibleJFileChooser()
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 | //-------------------------------------------------------------
|
|---|
| 86 | // Methods ----------------------------------------------------
|
|---|
| 87 | //-------------------------------------------------------------
|
|---|
| 88 |
|
|---|
| 89 | /**
|
|---|
| 90 | * getAccessibleRole
|
|---|
| 91 | * @returns AccessibleRole
|
|---|
| 92 | */
|
|---|
| 93 | public AccessibleRole getAccessibleRole() {
|
|---|
| 94 | return AccessibleRole.FILE_CHOOSER;
|
|---|
| 95 | } // getAccessibleRole()
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 | } // AccessibleJFileChooser
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 | //-------------------------------------------------------------
|
|---|
| 102 | // Variables --------------------------------------------------
|
|---|
| 103 | //-------------------------------------------------------------
|
|---|
| 104 |
|
|---|
| 105 | /**
|
|---|
| 106 | * uiClassID
|
|---|
| 107 | */
|
|---|
| 108 | private static final String uiClassID = "FileChooserUI";
|
|---|
| 109 |
|
|---|
| 110 | /**
|
|---|
| 111 | * OPEN_DIALOG
|
|---|
| 112 | */
|
|---|
| 113 | public static final int OPEN_DIALOG = 0;
|
|---|
| 114 |
|
|---|
| 115 | /**
|
|---|
| 116 | * SAVE_DIALOG
|
|---|
| 117 | */
|
|---|
| 118 | public static final int SAVE_DIALOG = 1;
|
|---|
| 119 |
|
|---|
| 120 | /**
|
|---|
| 121 | * CUSTOM_DIALOG
|
|---|
| 122 | */
|
|---|
| 123 | public static final int CUSTOM_DIALOG = 2;
|
|---|
| 124 |
|
|---|
| 125 | /**
|
|---|
| 126 | * CANCEL_OPTION
|
|---|
| 127 | */
|
|---|
| 128 | public static final int CANCEL_OPTION = 1;
|
|---|
| 129 |
|
|---|
| 130 | /**
|
|---|
| 131 | * APPROVE_OPTION
|
|---|
| 132 | */
|
|---|
| 133 | public static final int APPROVE_OPTION = 0;
|
|---|
| 134 |
|
|---|
| 135 | /**
|
|---|
| 136 | * ERROR_OPTION
|
|---|
| 137 | */
|
|---|
| 138 | public static final int ERROR_OPTION = -1;
|
|---|
| 139 |
|
|---|
| 140 | /**
|
|---|
| 141 | * FILES_ONLY
|
|---|
| 142 | */
|
|---|
| 143 | public static final int FILES_ONLY = 0;
|
|---|
| 144 |
|
|---|
| 145 | /**
|
|---|
| 146 | * DIRECTORIES_ONLY
|
|---|
| 147 | */
|
|---|
| 148 | public static final int DIRECTORIES_ONLY = 1;
|
|---|
| 149 |
|
|---|
| 150 | /**
|
|---|
| 151 | * FILES_AND_DIRECTORIES
|
|---|
| 152 | */
|
|---|
| 153 | public static final int FILES_AND_DIRECTORIES = 2;
|
|---|
| 154 |
|
|---|
| 155 | /**
|
|---|
| 156 | * CANCEL_SELECTION
|
|---|
| 157 | */
|
|---|
| 158 | public static final String CANCEL_SELECTION = "CancelSelection";
|
|---|
| 159 |
|
|---|
| 160 | /**
|
|---|
| 161 | * APPROVE_SELECTION
|
|---|
| 162 | */
|
|---|
| 163 | public static final String APPROVE_SELECTION = "ApproveSelection";
|
|---|
| 164 |
|
|---|
| 165 | /**
|
|---|
| 166 | * APPROVE_BUTTON_TEXT_CHANGED_PROPERTY
|
|---|
| 167 | */
|
|---|
| 168 | public static final String APPROVE_BUTTON_TEXT_CHANGED_PROPERTY = "ApproveButtonTextChangedProperty";
|
|---|
| 169 |
|
|---|
| 170 | /**
|
|---|
| 171 | * APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY
|
|---|
| 172 | */
|
|---|
| 173 | public static final String APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY = "ApproveButtonToolTipTextChangedProperty";
|
|---|
| 174 |
|
|---|
| 175 | /**
|
|---|
| 176 | * APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY
|
|---|
| 177 | */
|
|---|
| 178 | public static final String APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY = "ApproveButtonMnemonicChangedProperty";
|
|---|
| 179 |
|
|---|
| 180 | /**
|
|---|
| 181 | * CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY
|
|---|
| 182 | */
|
|---|
| 183 | public static final String CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY = "ControlButtonsAreShownChangedProperty";
|
|---|
| 184 |
|
|---|
| 185 | /**
|
|---|
| 186 | * DIRECTORY_CHANGED_PROPERTY
|
|---|
| 187 | */
|
|---|
| 188 | public static final String DIRECTORY_CHANGED_PROPERTY = "directoryChanged";
|
|---|
| 189 |
|
|---|
| 190 | /**
|
|---|
| 191 | * SELECTED_FILE_CHANGED_PROPERTY
|
|---|
| 192 | */
|
|---|
| 193 | public static final String SELECTED_FILE_CHANGED_PROPERTY = "SelectedFileChangedProperty";
|
|---|
| 194 |
|
|---|
| 195 | /**
|
|---|
| 196 | * SELECTED_FILES_CHANGED_PROPERTY
|
|---|
| 197 | */
|
|---|
| 198 | public static final String SELECTED_FILES_CHANGED_PROPERTY = "SelectedFilesChangedProperty";
|
|---|
| 199 |
|
|---|
| 200 | /**
|
|---|
| 201 | * MULTI_SELECTION_ENABLED_CHANGED_PROPERTY
|
|---|
| 202 | */
|
|---|
| 203 | public static final String MULTI_SELECTION_ENABLED_CHANGED_PROPERTY = "MultiSelectionEnabledChangedProperty";
|
|---|
| 204 |
|
|---|
| 205 | /**
|
|---|
| 206 | * FILE_SYSTEM_VIEW_CHANGED_PROPERTY
|
|---|
| 207 | */
|
|---|
| 208 | public static final String FILE_SYSTEM_VIEW_CHANGED_PROPERTY = "FileSystemViewChanged";
|
|---|
| 209 |
|
|---|
| 210 | /**
|
|---|
| 211 | * FILE_VIEW_CHANGED_PROPERTY
|
|---|
| 212 | */
|
|---|
| 213 | public static final String FILE_VIEW_CHANGED_PROPERTY = "fileViewChanged";
|
|---|
| 214 |
|
|---|
| 215 | /**
|
|---|
| 216 | * FILE_HIDING_CHANGED_PROPERTY
|
|---|
| 217 | */
|
|---|
| 218 | public static final String FILE_HIDING_CHANGED_PROPERTY = "FileHidingChanged";
|
|---|
| 219 |
|
|---|
| 220 | /**
|
|---|
| 221 | * FILE_FILTER_CHANGED_PROPERTY
|
|---|
| 222 | */
|
|---|
| 223 | public static final String FILE_FILTER_CHANGED_PROPERTY = "fileFilterChanged";
|
|---|
| 224 |
|
|---|
| 225 | /**
|
|---|
| 226 | * FILE_SELECTION_MODE_CHANGED_PROPERTY
|
|---|
|
|---|