[Jarspy-commits] CVS: JarSpy/src/com/ociweb/jarspy/gui JarSpyGUI.java,1.22,1.23
Status: Beta
Brought to you by:
brown_j
|
From: Jeff B. <br...@us...> - 2002-06-20 02:11:32
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv25454
Modified Files:
JarSpyGUI.java
Log Message:
added code to save the most recent opened jar
file using preferences
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** JarSpyGUI.java 20 Jun 2002 01:41:29 -0000 1.22
--- JarSpyGUI.java 20 Jun 2002 02:11:29 -0000 1.23
***************
*** 37,40 ****
--- 37,41 ----
import java.util.List;
import java.util.Map;
+ import java.util.jar.JarFile;
import java.util.jar.Manifest;
***************
*** 111,114 ****
--- 112,125 ----
splitter.setDividerLocation(dividerLocation);
+ String pathToMostRecentJar = jarSpyPreferences.getMostRecentJarFile();
+ if (pathToMostRecentJar != null) {
+ try {
+ File jarFile = new File(pathToMostRecentJar);
+ if (jarFile.exists()) {
+ setFile(jarFile);
+ }
+ } catch (IOException e) {
+ }
+ }
setVisible(true);
new Splasher(this, new JarSpyInfoPanel(), 4500).start();
***************
*** 259,262 ****
--- 270,280 ----
jarSpyPreferences.saveMainDividerLocation(splitter.getDividerLocation());
jarSpyPreferences.savePreferredLookAndFeel(UIManager.getLookAndFeel().getClass().getName());
+ JarFile jarFile = jarInspector.getJarFile();
+ if (jarFile != null) {
+ String jarName = jarFile.getName();
+ if (jarName != null) {
+ jarSpyPreferences.saveMostRecentJarFile(jarName);
+ }
+ }
}
***************
*** 316,327 ****
JarSpyGUI jvg = new JarSpyGUI();
- if (a.length > 0) {
- File f = new File(a[0]);
- if (f.exists()) {
- jvg.setFile(f);
- } else {
- System.err.println("No such file: " + a[0]);
- }
- }
}
}
--- 334,337 ----
|