|
From: <mwl...@us...> - 2009-07-14 15:33:24
|
Revision: 882
http://cishell.svn.sourceforge.net/cishell/?rev=882&view=rev
Author: mwlinnem
Date: 2009-07-14 15:33:20 +0000 (Tue, 14 Jul 2009)
Log Message:
-----------
Fixed FileLoad to work decently if preference service is not present.
Modified Paths:
--------------
trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java
trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoadFactory.java
Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java
===================================================================
--- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2009-06-25 20:35:42 UTC (rev 881)
+++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoad.java 2009-07-14 15:33:20 UTC (rev 882)
@@ -37,7 +37,17 @@
// unpack preference properties
if (defaultLoadDirectory == null) {
- defaultLoadDirectory = (String) prefProperties.get("loadDir");
+
+ /*
+ * get the default load directory from preferences,
+ * if it has been set.
+ */
+ Object result = prefProperties.get("loadDir");
+ if (result != null) {
+ defaultLoadDirectory = (String) result;
+ } else {
+ defaultLoadDirectory = "";
+ }
}
}
Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoadFactory.java
===================================================================
--- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoadFactory.java 2009-06-25 20:35:42 UTC (rev 881)
+++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/load/FileLoadFactory.java 2009-07-14 15:33:20 UTC (rev 882)
@@ -30,22 +30,22 @@
public void updated(Dictionary properties) throws ConfigurationException {
this.properties = properties;
- printPreferences(properties);
+ //printPreferences(properties);
}
- private void printPreferences(Dictionary properties) {
- System.out.println(" Preferences are as follows for File Load:");
- if (properties == null) {
- System.out.println(" Dictionary is null!");
- } else {
- Enumeration propertiesKeys = properties.keys();
-
- while (propertiesKeys.hasMoreElements()) {
- String propertiesKey = (String) propertiesKeys.nextElement();
-
- Object propertiesValue = properties.get(propertiesKey);
- System.out.println(" " + propertiesKey + ":" + propertiesValue);
- }
- }
- }
+// private void printPreferences(Dictionary properties) {
+// System.out.println(" Preferences are as follows for File Load:");
+// if (properties == null) {
+// System.out.println(" Dictionary is null!");
+// } else {
+// Enumeration propertiesKeys = properties.keys();
+//
+// while (propertiesKeys.hasMoreElements()) {
+// String propertiesKey = (String) propertiesKeys.nextElement();
+//
+// Object propertiesValue = properties.get(propertiesKey);
+// System.out.println(" " + propertiesKey + ":" + propertiesValue);
+// }
+// }
+// }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|