[sword-svn] r75 - in trunk/app: . src/org/crosswire/flashcards
Apache
apache at crosswire.org
Sat Oct 30 20:19:03 MST 2004
Author:
Date: 2004-10-30 20:19:03 -0700 (Sat, 30 Oct 2004)
New Revision: 75
Modified:
trunk/app/Flash.jpx.local
trunk/app/src/org/crosswire/flashcards/LessonManager.java
Log:
Added path lesson loading
-TAG.
Modified: trunk/app/Flash.jpx.local
===================================================================
--- trunk/app/Flash.jpx.local 2004-10-31 02:49:39 UTC (rev 74)
+++ trunk/app/Flash.jpx.local 2004-10-31 03:19:03 UTC (rev 75)
@@ -5,7 +5,7 @@
classFilter.unittest.3[0]=com.borland.jbuilder.unittest.JBTestRunner
classFilter.unittest.4[0]=sun.reflect.NativeMethodAccessorImpl
classFilter.unittest.5[0]=sun.reflect.DelegatingMethodAccessorImpl
-content.layout.xml.[0]=<project-layout><tab_container selected_index="1"><tab node_name="src/org/crosswire/common/bak/util/CallContext.java"/><tab node_name="src/org/crosswire/flashcards/EditPane.java"/><tab node_name="src/org/crosswire/flashcards/FlashCardColumns.java"/><tab node_name="src/org/crosswire/flashcards/FlashCardPane.java"/><tab node_name="[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/util/Iterator.java"/><tab node_name="src/org/crosswire/flashcards/Lesson.java"/><tab node_name="src/org/crosswire/flashcards/LessonManager.java"/><tab node_name="src/org/crosswire/flashcards/LessonSet.java"/><tab node_name="src/org/crosswire/common/swing/RowTable.java"/><tab node_name="src/org/crosswire/flashcards/SetupPane.java"/></tab_container></project-layout>
+content.layout.xml.[0]=<project-layout><tab_container selected_index="5"><tab node_name="src/org/crosswire/flashcards/EditPane.java"/><tab node_name="src/org/crosswire/flashcards/FlashCardColumns.java"/><tab node_name="src/org/crosswire/flashcards/FlashCardPane.java"/><tab node_name="[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/util/Iterator.java"/><tab node_name="src/org/crosswire/flashcards/Lesson.java"/><tab node_name="src/org/crosswire/flashcards/LessonManager.java"/><tab node_name="src/org/crosswire/flashcards/LessonSet.java"/><tab node_name="src/org/crosswire/common/swing/RowTable.java"/><tab node_name="src/org/crosswire/flashcards/SetupPane.java"/></tab_container></project-layout>
debug.NoTracingClasses.1[0]=16 java.lang.Object1 1 -1
debug.NoTracingClasses.2[0]=21 java.lang.ClassLoader1 1 -1
debug.NoTracingClasses.3[0]=16 java.lang.String1 1 -1
@@ -13,17 +13,16 @@
debug.Watches.1[0]=1 110 lessonPath10 expression1 02 501 01 01 01 1 -1
debug.Watches.2[0]=1 111 description10 expression1 02 501 01 01 01 1 -1
debug.Watches.3[0]=1 19 entryName10 expression1 02 501 01 01 01 1 -1
-history.files.active[0]=src/org/crosswire/flashcards/EditPane.java,F;53,6541
-history.files.open.1[0]=src/org/crosswire/common/bak/util/CallContext.java,F;1,0
-history.files.open.10[0]=src/org/crosswire/flashcards/SetupPane.java,F;71,2278
-history.files.open.2[0]=src/org/crosswire/flashcards/EditPane.java,F;53,6541
-history.files.open.3[0]=src/org/crosswire/flashcards/FlashCardColumns.java,F;1,687
-history.files.open.4[0]=src/org/crosswire/flashcards/FlashCardPane.java,F;41,1342
-history.files.open.5[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/util/Iterator.java,F;29,1367
-history.files.open.6[0]=src/org/crosswire/flashcards/Lesson.java,F;93,2684
-history.files.open.7[0]=src/org/crosswire/flashcards/LessonManager.java,F;62,2839
-history.files.open.8[0]=src/org/crosswire/flashcards/LessonSet.java,F;244,8231
-history.files.open.9[0]=src/org/crosswire/common/swing/RowTable.java,F;227,6666
+history.files.active[0]=src/org/crosswire/flashcards/LessonManager.java,F;101,2152
+history.files.open.1[0]=src/org/crosswire/flashcards/EditPane.java,F;128,6541
+history.files.open.2[0]=src/org/crosswire/flashcards/FlashCardColumns.java,F;1,685
+history.files.open.3[0]=src/org/crosswire/flashcards/FlashCardPane.java,F;41,1342
+history.files.open.4[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/util/Iterator.java,F;29,1367
+history.files.open.5[0]=src/org/crosswire/flashcards/Lesson.java,F;93,2684
+history.files.open.6[0]=src/org/crosswire/flashcards/LessonManager.java,F;101,2152
+history.files.open.7[0]=src/org/crosswire/flashcards/LessonSet.java,F;244,8231
+history.files.open.8[0]=src/org/crosswire/common/swing/RowTable.java,F;227,6666
+history.files.open.9[0]=src/org/crosswire/flashcards/SetupPane.java,F;71,2273
import.optimize.legacyPropertiesRead[0]=1
java.classdefaults.1[0]=java.util.Enumeration
java.classdefaults.2[0]=javax.swing.filechooser.FileFilter
@@ -31,7 +30,8 @@
java.classdefaults.4[0]=java.util.Hashtable
java.classdefaults.5[0]=java.util.Set
java.classdefaults.6[0]=org.crosswire.flashcards.Debug
-java.classdefaults.7[0]=java.net.JarURLConnection
+java.classdefaults.7[0]=java.net.URLConnection
+java.classdefaults.8[0]=java.net.JarURLConnection
packagebrowser.lastClassName[0]=org.crosswire.flashcards.Editor
sys.Author[0]=
sys.DefaultPackage[0]=flash
@@ -98,7 +98,7 @@
sys.ReopenHistory.8[0]=src/org/crosswire/common/util/CWClassLoader.java
sys.ReopenHistory.9[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/lang/Class.java
team.ActiveVCS[0]=Subversion
-team.lastScanned[0]=1099190668569
+team.lastScanned[0]=1099192590199
wizard.package.package_history.1[0]=flash
wizards.classes.class_type_history.1[0]=boolean
wizards.classes.class_type_history.10[0]=java.lang.String
Modified: trunk/app/src/org/crosswire/flashcards/LessonManager.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/LessonManager.java 2004-10-31 02:49:39 UTC (rev 74)
+++ trunk/app/src/org/crosswire/flashcards/LessonManager.java 2004-10-31 03:19:03 UTC (rev 75)
@@ -28,6 +28,9 @@
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.io.FilenameFilter;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.JarURLConnection;
/**
@@ -98,8 +101,28 @@
* Load this lesson from persistent store named by the lesson's <code>LESSON_ROOT</code>.
*/
public void load() {
+ // see if there are any jars in our home directory with lesson sets
loadLessonSetsFromJarDir("./");
+ // see if there are any lesson sets in our home project dir
loadLessonSetsFromDir(homeLessonDir);
+ // see if there are any lessons on our path
+ // Dig into the jar for lessonSets
+ URL lessonsURL = this.getClass().getResource('/' + LESSON_ROOT);
+ if (lessonsURL == null) {
+ return;
+ }
+ URLConnection connection = null;
+ try {
+ connection = lessonsURL.openConnection();
+ }
+ catch (Exception e1) {
+ assert false;
+ }
+ if (connection instanceof JarURLConnection) {
+ JarURLConnection jarConnection = (JarURLConnection) connection;
+ loadJarLessonSets(new File(jarConnection.getJarFileURL().getFile()));
+ }
+
}
More information about the sword-cvs
mailing list