3261N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * Synth FileChooserUI implementation. 0N/A * part of the core Java APIs. They are a part of Sun's JDK and JRE 0N/A * distributions. Although other licensees may choose to distribute 0N/A * these classes, developers cannot depend on their availability in 0N/A * non-Sun implementations. Additionally this API may change in 0N/A * incompatible ways between releases. While this class is public, it 0N/A * shoud be considered an implementation detail, and subject to change. 0N/A * @author Leif Samuelsson 0N/A * @author Jeff Dinkins 0N/A // Preferred and Minimum sizes for the dialog box 0N/A // Labels, mnemonics, and tooltips (oh my!) 0N/A // ********************************* // 0N/A // **** Construct the top panel **** // 0N/A // ********************************* // 0N/A // Directory manipulation buttons 0N/A // Add the top panel to the fileChooser 0N/A // CurrentDir ComboBox 0N/A // Add 'Go Up' to context menu, plus 'Go Home' if on Unix 0N/A // New Directory Button 0N/A // View button group 0N/A // ************************************** // 0N/A // ******* Add the directory pane ******* // 0N/A // ************************************** // 0N/A // ********************************** // 0N/A // **** Construct the bottom panel ** // 0N/A // ********************************** // 0N/A // FileName label and textfield 0N/A // Filetype label and combobox 0N/A // ******************************************************* 0N/A // ************ FileChooser UI PLAF methods ************** 0N/A // ******************************************************* 0N/A // ***************************** 0N/A // ***** Directory Actions ***** 0N/A // ***************************** 0N/A // Renderer for DirectoryComboBox 1173N/A // Synth has some odd behavior with regards to renderers. Renderers are styled 1173N/A // in a specific manner by the SynthComboBoxUI. If we extend DefaultListCellRenderer 1173N/A // here, then we get none of those benefits or behaviors, leading to poor 1173N/A // So what we do here is delegate most jobs to the "real" or original renderer, 1173N/A // and simply monkey with the icon and text of the renderer. 0N/A // DataModel for DirectoryComboxbox 0N/A * Data model for a type-face selection combo-box. 0N/A // Add the current directory to the model, and make it the 0N/A // selectedDirectory 0N/A * Adds the directory to the model and sets it to be selected, 0N/A * additionally clears out the previous selected directory and 0N/A * the paths leading up to it, if any. 0N/A // Get the canonical (full) path. This has the side 0N/A // benefit of removing extraneous chars from the path, 0N/A // Maybe drive is not ready. Can't abort here. 0N/A // create File instances of each directory leading up to the top 0N/A // Insert chain at appropriate place in vector 0N/A for (
int j = i-
1; j >=
0; j--) {
0N/A for (
int j = i-
1; j >=
0; j--) {
0N/A * Acts when DirectoryComboBox has changed the selected item. 0N/A super(
"DirectoryComboBoxAction");
0N/A // Renderer for Types ComboBox 0N/A * Render different type sizes and styles. 1173N/A //this should always be true, since SynthComboBoxUI's SynthComboBoxRenderer 0N/A // DataModel for Types Comboxbox 0N/A * Data model for a type-face selection combo-box. 0N/A // Ensure that the current filter is in the list. 0N/A // NOTE: we shouldnt' have to do this, since JFileChooser adds 0N/A // the filter to the choosable filters list when the filter 0N/A // is set. Lets be paranoid just in case someone overrides 0N/A // setFileFilter in JFileChooser. 0N/A // This shouldn't happen. Try to recover gracefully. 0N/A * <code>ButtonAreaLayout</code> behaves in a similar manner to 0N/A * <code>FlowLayout</code>. It lays out all components from left to 0N/A * right, flushed right. The widths of all components will be set 0N/A * to the largest preferred size width. 0N/A // Align the width with all other labels in group.