Source Code Cross Referenced for JDirectoryChooser.java in  » Swing-Library » l2fprod-common » com » l2fprod » common » swing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » l2fprod common » com.l2fprod.common.swing 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * L2FProd.com Common Components 7.3 License.
003:         *
004:         * Copyright 2005-2007 L2FProd.com
005:         *
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         *
010:         *     http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License.
017:         */package com.l2fprod.common.swing;
018:
019:        import com.l2fprod.common.swing.plaf.DirectoryChooserUI;
020:        import com.l2fprod.common.swing.plaf.JDirectoryChooserAddon;
021:        import com.l2fprod.common.swing.plaf.LookAndFeelAddons;
022:
023:        import java.awt.Component;
024:        import java.awt.HeadlessException;
025:        import java.io.File;
026:
027:        import javax.swing.JComponent;
028:        import javax.swing.JDialog;
029:        import javax.swing.JFileChooser;
030:        import javax.swing.filechooser.FileSystemView;
031:        import javax.swing.plaf.ComponentUI;
032:
033:        /**
034:         * An extension of the JFileChooser but dedicated to directory selection. <br>
035:         *  
036:         * @javabean.class
037:         *          name="JDirectoryChooser"
038:         *          shortDescription="JDirectoryChooser allows to select one or more directories."
039:         *          stopClass="javax.swing.JFileChooser"
040:         * 
041:         * @javabean.icons
042:         *          mono16="JDirectoryChooser16-mono.gif"
043:         *          color16="JDirectoryChooser16.gif"
044:         *          mono32="JDirectoryChooser32-mono.gif"
045:         *          color32="JDirectoryChooser32.gif"
046:         */
047:        public class JDirectoryChooser extends JFileChooser {
048:
049:            public final static String UI_CLASS_ID = "l2fprod/DirectoryChooserUI";
050:
051:            // ensure at least the default ui is registered
052:            static {
053:                LookAndFeelAddons.contribute(new JDirectoryChooserAddon());
054:            }
055:
056:            private boolean showingCreateDirectory;
057:
058:            /**
059:             * Used when generating PropertyChangeEvents for the "showingCreateDirectory" property
060:             */
061:            public static final String SHOWING_CREATE_DIRECTORY_CHANGED_KEY = "showingCreateDirectory";
062:
063:            /**
064:             * Creates a JDirectoryChooser pointing to the user's home directory.
065:             */
066:            public JDirectoryChooser() {
067:                super ();
068:                setShowingCreateDirectory(true);
069:            }
070:
071:            /**
072:             * Creates a JDirectoryChooser using the given File as the path.
073:             * 
074:             * @param currentDirectory
075:             */
076:            public JDirectoryChooser(File currentDirectory) {
077:                super (currentDirectory);
078:                setShowingCreateDirectory(true);
079:            }
080:
081:            /**
082:             * Creates a JDirectoryChooser using the given current directory and
083:             * FileSystemView
084:             * 
085:             * @param currentDirectory
086:             * @param fsv
087:             */
088:            public JDirectoryChooser(File currentDirectory, FileSystemView fsv) {
089:                super (currentDirectory, fsv);
090:                setShowingCreateDirectory(true);
091:            }
092:
093:            /**
094:             * Creates a JDirectoryChooser using the given FileSystemView
095:             * 
096:             * @param fsv
097:             */
098:            public JDirectoryChooser(FileSystemView fsv) {
099:                super (fsv);
100:                setShowingCreateDirectory(true);
101:            }
102:
103:            /**
104:             * Creates a JDirectoryChooser using the given path.
105:             * 
106:             * @param currentDirectoryPath
107:             */
108:            public JDirectoryChooser(String currentDirectoryPath) {
109:                super (currentDirectoryPath);
110:                setShowingCreateDirectory(true);
111:            }
112:
113:            public JDirectoryChooser(String currentDirectoryPath,
114:                    FileSystemView fsv) {
115:                super (currentDirectoryPath, fsv);
116:                setShowingCreateDirectory(true);
117:            }
118:
119:            /**
120:             * Notification from the <code>UIManager</code> that the L&F has changed.
121:             * Replaces the current UI object with the latest version from the <code>UIManager</code>.
122:             * 
123:             * @see javax.swing.JComponent#updateUI
124:             */
125:            public void updateUI() {
126:                setUI((DirectoryChooserUI) LookAndFeelAddons.getUI(this ,
127:                        DirectoryChooserUI.class));
128:            }
129:
130:            /**
131:             * Sets the L&F object that renders this component.
132:             * 
133:             * @param ui the <code>DirectoryChooserUI</code> L&F object
134:             * @see javax.swing.UIDefaults#getUI
135:             * 
136:             * @beaninfo bound: true hidden: true description: The UI object that
137:             * implements the taskpane group's LookAndFeel.
138:             */
139:            public void setUI(DirectoryChooserUI ui) {
140:                super .setUI((ComponentUI) ui);
141:            }
142:
143:            /**
144:             * Returns the name of the L&F class that renders this component.
145:             * 
146:             * @return the string {@link #UI_CLASS_ID}
147:             * @see javax.swing.JComponent#getUIClassID
148:             * @see javax.swing.UIDefaults#getUI
149:             */
150:            public String getUIClassID() {
151:                return UI_CLASS_ID;
152:            }
153:
154:            /**
155:             *
156:             * @return true if the "Make New Folder" button is shown, false otherwise
157:             */
158:            public boolean isShowingCreateDirectory() {
159:                return showingCreateDirectory;
160:            }
161:
162:            /**
163:             * Sets whether or not the "Make New Folder" button is shown in the control
164:             * button area. Default is true.
165:             * 
166:             * @param showingCreateDirectory
167:             * @javabean.property
168:             *          bound="true"
169:             *          preferred="true"
170:             */
171:            public void setShowingCreateDirectory(boolean showingCreateDirectory) {
172:                this .showingCreateDirectory = showingCreateDirectory;
173:                firePropertyChange(SHOWING_CREATE_DIRECTORY_CHANGED_KEY,
174:                        !showingCreateDirectory, showingCreateDirectory);
175:            }
176:
177:            protected JDialog createDialog(Component parent)
178:                    throws HeadlessException {
179:                JDialog dialog = super .createDialog(parent);
180:                ((JComponent) dialog.getContentPane())
181:                        .setBorder(LookAndFeelTweaks.WINDOW_BORDER);
182:                return dialog;
183:            }
184:
185:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.