/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import javax.accessibility.*;
/**
* GTK FileChooserUI.
*
* @author Leif Samuelsson
* @author Jeff Dinkins
*/
// The accessoryPanel is a container to place the JFileChooser accessory component
// From Motif
private boolean readOnly;
private boolean showDirectoryIcons;
private boolean showFileIcons;
super(filechooser);
}
return map;
}
if (!fc.isMultiSelectionEnabled()) {
return typedInName;
}
// we return all selected file names
for (int i = 0; i < len; i++) {
}
// plus the file name typed into the text field, if not already there
}
// construct the resulting string
for (int i=0; i<len; i++) {
if (i > 0) {
}
if (len > 1) {
}
if (len > 1) {
}
}
}
if (fileNameTextField != null) {
}
}
// public String getDirectoryName() {
// return pathField.getText();
// }
}
// PENDING
}
}
return accessoryPanel;
}
// ***********************
// * FileView operations *
// ***********************
return fileView;
}
public GTKFileView() {
}
public void clearIconCache() {
}
return null;
}
}
}
}
private void updateDefaultButton() {
return;
}
if (filechooser.getControlButtonsAreShown()) {
}
} else {
}
}
}
super.doSelectedFileChanged(e);
if (f != null) {
}
}
if (sm instanceof DefaultListSelectionModel) {
}
if (sm instanceof DefaultListSelectionModel) {
}
if (currentDirectory != null) {
try {
} catch (IOException ioe) {
}
if ((getFileChooser().getFileSelectionMode() == JFileChooser.DIRECTORIES_ONLY) && !getFileChooser().isMultiSelectionEnabled()) {
}
}
super.doDirectoryChanged(e);
}
if (getAccessoryPanel() != null) {
if (e.getOldValue() != null) {
}
} else {
}
}
}
super.doFileSelectionModeChanged(e);
}
if (getFileChooser().isMultiSelectionEnabled()) {
} else {
}
super.doMultiSelectionChanged(e);
}
super.doControlButtonsChanged(e);
if (filechooser.getControlButtonsAreShown()) {
} else {
}
}
// Ancestor was added, set initial focus
}
super.doAncestorChanged(e);
}
// ********************************************
// ************ Create Listeners **************
// ********************************************
return new SelectionListener();
}
}
if (index >= 0) {
try {
// Strip trailing ".."
f = ShellFolder.getNormalizedFile(f);
} catch (IOException ex) {
// That's ok, we'll use f as is
}
if (getFileChooser().isTraversable(f)) {
} else {
}
} else {
}
}
}
}
}
}
}
}
}
return new DoubleClickListener(list);
}
if (!e.getValueIsAdjusting()) {
if (chooser.isMultiSelectionEnabled()) {
setDirectorySelected(true);
} else {
}
}
}
setDirectorySelected(false);
}
}
} else {
&& file.isDirectory()
setDirectorySelected(true);
} else {
setDirectorySelected(false);
}
}
}
}
}
}
//
// ComponentUI Interface Implementation methods
//
return new GTKFileChooserUI((JFileChooser)c);
}
super.installUI(c);
}
super.uninstallUI(c);
if (accessoryPanel != null) {
}
getFileChooser().removeAll();
}
super.installComponents(fc);
// Top row of buttons
}
deleteFileButton.setEnabled(false);
if (readOnly) {
rfa.setEnabled(false);
}
0, 0) {
super.layoutContainer(target);
}
}
});
// CurrentDir ComboBox
// CENTER: left, right, accessory
// SPLIT PANEL: left, right
// left panel - Filter & directoryList
// Add the Directory List
// Create a label that looks like button (should be a table header)
false, false, 0, 0);
// create files list
false, false, 0, 0);
if (accessoryPanel != null) {
} else {
}
}
0, 0));
if (currentDirectory != null) {
}
public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize();
return d;
}
};
// add the fileName field
fileNameTextField = new JTextField() {
public Dimension getMaximumSize() {
Dimension d = super.getMaximumSize();
return d;
}
};
fileNameTextField.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, forwardTraversalKeys);
fileNameTextField.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "fileNameCompletionAction");
// Add the filter combo box
// Add buttons
if (fc.getControlButtonsAreShown()) {
}
}
super.installListeners(fc);
}
}
super.uninstallListeners(fc);
if (gtkFCPropertyChangeListener != null) {
}
}
}
}
}
super.installDefaults(fc);
}
}
super.installStrings(fc);
newFolderNoDirectoryErrorTitleText = UIManager.getString("FileChooser.newFolderNoDirectoryErrorTitleText", l);
newFolderNoDirectoryErrorText = UIManager.getString("FileChooser.newFolderNoDirectoryErrorText", l);
}
super.uninstallStrings(fc);
}
if (getFileChooser().isMultiSelectionEnabled()) {
} else {
}
return scrollpane;
}
directoryList = new JList();
directoryListModel = new GTKDirectoryListModel();
return scrollpane;
}
protected void createModel() {
model = new GTKDirectoryModel();
}
return model;
}
return approveSelectionAction;
}
}
};
public GTKDirectoryModel() {
super(getFileChooser());
}
}
}
public GTKDirectoryListModel() {
getModel().addListDataListener(this);
}
public int getSize() {
}
}
}
}
// PENDING - this is inefficient - should sent out
// incremental adjustment values instead of saying that the
// whole list has changed.
public void fireContentsChanged() {
}
// PENDING - fire the correct interval changed - currently sending
// out that everything has changed
}
private void directoryChanged() {
}
}
public GTKFileListModel() {
getModel().addListDataListener(this);
}
public int getSize() {
}
}
}
}
}
}
// PENDING - this is inefficient - should sent out
// incremental adjustment values instead of saying that the
// whole list has changed.
public void fireContentsChanged() {
}
// PENDING - fire the interval changed
}
}
boolean isSelected, boolean cellHasFocus) {
if (showFileIcons) {
}
return this;
}
}
boolean isSelected, boolean cellHasFocus) {
if (showDirectoryIcons) {
} else {
}
return this;
}
}
}
if (d != null) {
} else {
return prefSize;
}
}
}
}
}
if (newFolderAction == null) {
newFolderAction = new NewFolderAction();
}
return newFolderAction;
}
//
// DataModel for DirectoryComboxbox
//
return new DirectoryComboBoxModel();
}
/**
* Data model for a type-face selection combo-box.
*/
public DirectoryComboBoxModel() {
// Add the current directory to the model, and make it the
// selectedDirectory
}
}
/**
* Adds the directory to the model and sets it to be selected,
* additionally clears out the previous selected directory and
* the paths leading up to it, if any.
*/
return;
}
directories.clear();
if (oldSize > 0) {
}
// Get the canonical (full) path. This has the side
// benefit of removing extraneous chars from the path,
try {
} catch (IOException e) {
// Maybe drive is not ready. Can't abort here.
}
// create File instances of each directory leading up to the top
do {
directories.add(f);
} while ((f = f.getParentFile()) != null);
if (newSize > 0) {
}
}
}
return selectedDirectory;
}
public int getSize() {
return directories.size();
}
}
}
/**
* Acts when DirectoryComboBox has changed the selected item.
*/
protected DirectoryComboBoxAction() {
super("DirectoryComboBoxAction");
}
}
}
/**
* Creates a new folder.
*/
protected NewFolderAction() {
super(FilePane.ACTION_NEW_FOLDER);
}
if (readOnly) {
return;
}
if (!currentDirectory.exists()) {
return;
}
dirName + "\"",
}
}
}
}
if (isDirectorySelected()) {
try {
// Strip trailing ".."
}
} catch (IOException ex) {
// Ok, use f as is
}
if (sm instanceof DefaultListSelectionModel) {
}
return;
}
}
super.actionPerformed(e);
}
}
/**
* Renames file
*/
protected RenameFileAction() {
super(FilePane.ACTION_EDIT_FILE_NAME);
}
return;
}
(new Object[] { getFileName() }),
getFileName());
if (newFileName != null) {
(currentDirectory, getFileName());
} else {
}
}
}
}
//
// Renderer for Filter ComboBox
//
return new FilterComboBoxRenderer();
}
/**
* Render different filters
*/
// As SynthComboBoxRenderer's are asked for a size BEFORE they
// are parented getName is overriden to force the name to be
// ComboBox.renderer if it isn't set. If we didn't do this the
// wrong style could be used for size calculations.
return "ComboBox.renderer";
}
return name;
}
int index, boolean isSelected,
boolean cellHasFocus) {
setName("ComboBox.listRenderer");
if (value instanceof FileFilter) {
}
} else {
setText("");
}
return this;
}
}
//
// DataModel for Filter Combobox
//
return new FilterComboBoxModel();
}
/**
* Data model for filter combo-box.
*/
implements ComboBoxModel, PropertyChangeListener {
protected FilterComboBoxModel() {
super();
}
}
}
}
}
// Ensure that the current filter is in the list.
// NOTE: we shouldnt' have to do this, since JFileChooser adds
// the filter to the choosable filters list when the filter
// is set. Lets be paranoid just in case someone overrides
// setFileFilter in JFileChooser.
boolean found = false;
if (currentFilter != null) {
if (filter == currentFilter) {
found = true;
}
}
if (found == false) {
}
}
return getFileChooser().getFileFilter();
}
public int getSize() {
} else {
return 0;
}
}
// This shouldn't happen. Try to recover gracefully.
return getFileChooser().getFileFilter();
}
} else {
return null;
}
}
}
}