[Jarspy-commits] CVS: JarSpy/src/com/ociweb/jarspy/preferences DefaultJarSpyPreferences.java,1.3,1.4
Status: Beta
Brought to you by:
brown_j
|
From: Jeff B. <br...@us...> - 2002-06-20 02:09:18
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/preferences
In directory usw-pr-cvs1:/tmp/cvs-serv24914
Modified Files:
DefaultJarSpyPreferences.java JarSpyPreferences.java
J2SEJarSpyPreferences.java
Log Message:
added support to save the last opened jar file
using preferences
Index: DefaultJarSpyPreferences.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/preferences/DefaultJarSpyPreferences.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DefaultJarSpyPreferences.java 20 Jun 2002 01:41:29 -0000 1.3
--- DefaultJarSpyPreferences.java 20 Jun 2002 02:09:15 -0000 1.4
***************
*** 84,86 ****
--- 84,100 ----
}
+ /**
+ * @return the path to the most recently opened jar file
+ */
+ public String getMostRecentJarFile() {
+ return null;
+ }
+
+ /**
+ * saves the path to the most recently opened jar file
+ */
+ public void saveMostRecentJarFile(String pathToJarFile) {
+ // do nothing
+ }
+
}
Index: JarSpyPreferences.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/preferences/JarSpyPreferences.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** JarSpyPreferences.java 20 Jun 2002 01:41:29 -0000 1.3
--- JarSpyPreferences.java 20 Jun 2002 02:09:15 -0000 1.4
***************
*** 62,64 ****
--- 62,74 ----
*/
public void savePreferredLookAndFeel(String plafClassName);
+
+ /**
+ * @return the path to the most recently opened jar file
+ */
+ public String getMostRecentJarFile();
+
+ /**
+ * saves the path to the most recently opened jar file
+ */
+ public void saveMostRecentJarFile(String pathToJarFile);
}
Index: J2SEJarSpyPreferences.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/preferences/J2SEJarSpyPreferences.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** J2SEJarSpyPreferences.java 20 Jun 2002 01:41:29 -0000 1.2
--- J2SEJarSpyPreferences.java 20 Jun 2002 02:09:15 -0000 1.3
***************
*** 49,52 ****
--- 49,53 ----
public static final String MAIN_DIVIDER_LOCATION = "MainDividerLocation";
public static final String PREFERRED_LOOK_AND_FEEL = "PreferredLookAndFeel";
+ public static final String MOST_RECENT_JAR = "MostRecentJar";
/**
***************
*** 145,147 ****
--- 146,173 ----
}
}
+
+ /**
+ * @return the path to the most recently opened jar file
+ */
+ public String getMostRecentJarFile() {
+ String pathToJar = null;
+
+ try {
+ pathToJar = prefs.get(MOST_RECENT_JAR, null);
+ } catch (Exception e) {
+ }
+
+ return pathToJar;
+ }
+
+ /**
+ * saves the path to the most recently opened jar file
+ */
+ public void saveMostRecentJarFile(String pathToJarFile) {
+ try {
+ prefs.put(MOST_RECENT_JAR, pathToJarFile);
+ } catch (Exception e) {
+ }
+ }
+
}
|