Author: rfelden
Date: Thu May 24 09:44:13 2007
New Revision: 42
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D42&repname=3D=
jahia_upgrade
Log:
integrity update
Added:
trunk/integrity/src/main/java/org/jahia/tools/GUITools.java
Added: trunk/integrity/src/main/java/org/jahia/tools/GUITools.java
URL: https://svndev.jahia.net/websvn/filedetails.php?path=3D/trunk/integrit=
y/src/main/java/org/jahia/tools/GUITools.java&rev=3D42&repname=3Djahia_upgr=
ade
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/integrity/src/main/java/org/jahia/tools/GUITools.java (added)
+++ trunk/integrity/src/main/java/org/jahia/tools/GUITools.java Thu May 24 =
09:44:13 2007
@@ -0,0 +1,34 @@
+package org.jahia.tools;
+
+import javax.swing.*;
+import java.io.File;
+import java.awt.*;
+
+/**
+ * @author Romain Felden
+ * @version 2007-05-23
+ */
+public class GUITools {
+
+ /**
+ * Display a save dialog in order to select a location where to save.
+ *
+ * @param cp the parent component
+ * @param title dialog title
+ * @param startDirectory path to start from
+ * @param hide keep hidden files invisible
+ * @return the selected directory
+ */
+ public static File selectSaveLocation(Component cp, String title, Stri=
ng startDirectory, boolean hide) {
+ JFileChooser fileChooser =3D new JFileChooser(startDirectory);
+ fileChooser.setDialogTitle(title);
+ fileChooser.setFileHidingEnabled(hide);
+ fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+ int choice =3D fileChooser.showSaveDialog(cp);
+ if (choice =3D=3D JFileChooser.APPROVE_OPTION) {
+ return fileChooser.getSelectedFile();
+ }
+ else return null ;
+ }
+
+}
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list