jarspy-commits Mailing List for JarSpy- Java Archive Spying Utility (Page 13)
Status: Beta
Brought to you by:
brown_j
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(39) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(39) |
Feb
(12) |
Mar
|
Apr
(10) |
May
|
Jun
(24) |
Jul
(38) |
Aug
(9) |
Sep
(58) |
Oct
(34) |
Nov
|
Dec
(13) |
| 2003 |
Jan
(64) |
Feb
(3) |
Mar
(17) |
Apr
(20) |
May
(8) |
Jun
(3) |
Jul
|
Aug
(6) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
|
| 2005 |
Jan
(41) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Jeff B. <br...@us...> - 2002-07-20 00:09:14
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv22892/src/com/ociweb/jarspy/gui
Modified Files:
JarSpyGUI.java StatusScreen.java
Log Message:
use swingutilities to manage threaded updates to gui
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** JarSpyGUI.java 19 Jul 2002 00:22:55 -0000 1.31
--- JarSpyGUI.java 20 Jul 2002 00:09:00 -0000 1.32
***************
*** 70,73 ****
--- 70,74 ----
import java.util.Map;
import java.util.jar.JarFile;
+ import java.lang.reflect.InvocationTargetException;
/**
***************
*** 232,241 ****
setTitle("JarSpy");
! StatusScreen ss = null;
try {
clearLists();
- ss = new StatusScreen(JarSpyGUI.this);
jarInspector.setProcessingListener(ss);
! ss.setVisible(true);
jarInspector.setFile(file);
refreshClassList();
--- 233,245 ----
setTitle("JarSpy");
! final StatusScreen ss = new StatusScreen(JarSpyGUI.this);
try {
clearLists();
jarInspector.setProcessingListener(ss);
! SwingUtilities.invokeAndWait(new Runnable() {
! public void run() {
! ss.setVisible(true);
! }
! });
jarInspector.setFile(file);
refreshClassList();
***************
*** 245,252 ****
e.printStackTrace();
throw e;
} finally {
if (ss != null) {
try {
! ss.setVisible(false);
} catch (Exception e1) {
}
--- 249,264 ----
e.printStackTrace();
throw e;
+ } catch (InvocationTargetException ite) {
+ ite.printStackTrace();
+ } catch (InterruptedException ie) {
+ ie.printStackTrace();
} finally {
if (ss != null) {
try {
! SwingUtilities.invokeLater(new Runnable() {
! public void run() {
! ss.setVisible(false);
! }
! });
} catch (Exception e1) {
}
Index: StatusScreen.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/StatusScreen.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** StatusScreen.java 19 Jul 2002 00:24:37 -0000 1.1
--- StatusScreen.java 20 Jul 2002 00:09:00 -0000 1.2
***************
*** 26,29 ****
--- 26,30 ----
import javax.swing.JPanel;
import javax.swing.JProgressBar;
+ import javax.swing.SwingUtilities;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
***************
*** 104,110 ****
}
! public void updateJarProcessingProgress(String entry, int pct) {
! statusLabel.setText("Processing: " + entry);
! progressBar.setValue(pct);
}
--- 105,115 ----
}
! public void updateJarProcessingProgress(final String entry, final int pct) {
! SwingUtilities.invokeLater(new Runnable() {
! public void run() {
! statusLabel.setText("Processing: " + entry);
! progressBar.setValue(pct);
! }
! });
}
|
|
From: Jeff B. <br...@us...> - 2002-07-19 01:09:07
|
Update of /cvsroot/jarspy/JarSpy In directory usw-pr-cvs1:/tmp/cvs-serv26454 Modified Files: CHANGES Log Message: Index: CHANGES =================================================================== RCS file: /cvsroot/jarspy/JarSpy/CHANGES,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CHANGES 19 Jul 2002 01:06:32 -0000 1.1 --- CHANGES 19 Jul 2002 01:09:04 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- - reorganized all action objects into their own package - threaded the processing of an archive + - added screen to show all archive contents Changes in version 0.5.4 |
|
From: Jeff B. <br...@us...> - 2002-07-19 01:06:34
|
Update of /cvsroot/jarspy/JarSpy
In directory usw-pr-cvs1:/tmp/cvs-serv25984
Added Files:
CHANGES
Log Message:
added CHANGES
--- NEW FILE: CHANGES ---
Changes in version 0.6
- added more preferences to the list of items
being saved if 1.4 is used
- added code to provide visual feedback as
archives are being processed
- reorganized all action objects into their own package
- threaded the processing of an archive
Changes in version 0.5.4
- fixed bug that prevented file open dialogs from
properly updating their UI when the look and feel
changes
- added preferences mechanism to save application
preferences
* if J2SE 1.4 or later is used, the java.util.prefs
API is used for storing preferneces
* if J2SE prior to 1.4 is used, a dummy mechanism is
in place that does not save anything
* currently saved information includes...
- most recently accessed jar file
- main window location
- main window size
- location of slider in main window
|
|
From: Jeff B. <br...@us...> - 2002-07-19 00:46:46
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions
In directory usw-pr-cvs1:/tmp/cvs-serv21505/src/com/ociweb/jarspy/gui/actions
Modified Files:
AboutAction.java DecompileAction.java ExitAction.java
ExtractArchiveAction.java OpenArchiveAction.java
ViewJarContentsAction.java ViewManifestAction.java
Log Message:
fixed resource paths to images
Index: AboutAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/AboutAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AboutAction.java 17 Jul 2002 14:04:24 -0000 1.2
--- AboutAction.java 19 Jul 2002 00:46:43 -0000 1.3
***************
*** 33,37 ****
super(gui,
ActionNames.ABOUT_ACTION,
! "../images/question.gif",
false);
}
--- 33,37 ----
super(gui,
ActionNames.ABOUT_ACTION,
! "/com/ociweb/jarspy/gui/images/question.gif",
false);
}
Index: DecompileAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/DecompileAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DecompileAction.java 17 Jul 2002 14:04:24 -0000 1.2
--- DecompileAction.java 19 Jul 2002 00:46:43 -0000 1.3
***************
*** 49,53 ****
super(gui,
ActionNames.DECOMPILE_ACTION,
! "../images/decompile.gif",
false);
this.jarInspector = jarInspector;
--- 49,53 ----
super(gui,
ActionNames.DECOMPILE_ACTION,
! "/com/ociweb/jarspy/gui/images/decompile.gif",
false);
this.jarInspector = jarInspector;
Index: ExitAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/ExitAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ExitAction.java 17 Jul 2002 14:04:24 -0000 1.2
--- ExitAction.java 19 Jul 2002 00:46:43 -0000 1.3
***************
*** 33,37 ****
public ExitAction(JarSpyGUI gui) {
! super(gui, ActionNames.EXIT_ACTION, "../images/exit.gif", false);
}
--- 33,37 ----
public ExitAction(JarSpyGUI gui) {
! super(gui, ActionNames.EXIT_ACTION, "/com/ociweb/jarspy/gui/images/exit.gif", false);
}
Index: ExtractArchiveAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/ExtractArchiveAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ExtractArchiveAction.java 17 Jul 2002 14:04:24 -0000 1.2
--- ExtractArchiveAction.java 19 Jul 2002 00:46:43 -0000 1.3
***************
*** 38,42 ****
super(gui,
ActionNames.EXTRACT_ARCHIVE_ACTION,
! "../images/extract.gif",
true);
jarInspector = inspector;
--- 38,42 ----
super(gui,
ActionNames.EXTRACT_ARCHIVE_ACTION,
! "/com/ociweb/jarspy/gui/images/extract.gif",
true);
jarInspector = inspector;
Index: OpenArchiveAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/OpenArchiveAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** OpenArchiveAction.java 19 Jul 2002 00:22:55 -0000 1.3
--- OpenArchiveAction.java 19 Jul 2002 00:46:43 -0000 1.4
***************
*** 35,39 ****
public OpenArchiveAction(JarSpyGUI gui) {
! super(gui, ActionNames.OPEN_ARCHIVE_ACTION, "../images/open.gif", false);
}
--- 35,39 ----
public OpenArchiveAction(JarSpyGUI gui) {
! super(gui, ActionNames.OPEN_ARCHIVE_ACTION, "/com/ociweb/jarspy/gui/images/open.gif", false);
}
Index: ViewJarContentsAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/ViewJarContentsAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ViewJarContentsAction.java 17 Jul 2002 14:04:24 -0000 1.2
--- ViewJarContentsAction.java 19 Jul 2002 00:46:43 -0000 1.3
***************
*** 49,53 ****
super(jarSpyGUI,
ActionNames.VIEW_JAR_CONTENTS_ACTION,
! "../images/jarcontents.gif",
true);
setEnabled(false);
--- 49,53 ----
super(jarSpyGUI,
ActionNames.VIEW_JAR_CONTENTS_ACTION,
! "/com/ociweb/jarspy/gui/images/jarcontents.gif",
true);
setEnabled(false);
Index: ViewManifestAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/ViewManifestAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ViewManifestAction.java 17 Jul 2002 14:04:24 -0000 1.2
--- ViewManifestAction.java 19 Jul 2002 00:46:43 -0000 1.3
***************
*** 40,44 ****
super(gui,
ActionNames.VIEW_MANIFEST_ACTION,
! "../images/manifest.gif",
true);
this.jarInspector = jarInspector;
--- 40,44 ----
super(gui,
ActionNames.VIEW_MANIFEST_ACTION,
! "/com/ociweb/jarspy/gui/images/manifest.gif",
true);
this.jarInspector = jarInspector;
|
|
From: Jeff B. <br...@us...> - 2002-07-19 00:27:15
|
Update of /cvsroot/jarspy/JarSpy In directory usw-pr-cvs1:/tmp/cvs-serv14985 Modified Files: README Log Message: Index: README =================================================================== RCS file: /cvsroot/jarspy/JarSpy/README,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** README 25 Jan 2002 03:08:15 -0000 1.12 --- README 19 Jul 2002 00:27:12 -0000 1.13 *************** *** 1,3 **** ! JarSpy v0.4.7 http://www.jarspy.org/ ======================================= --- 1,3 ---- ! JarSpy v0.6 http://www.jarspy.org/ ======================================= *************** *** 16,19 **** --- 16,22 ---- - A list of all fields declared in each class or interface, including the field type and all access specifiers + - Decompile java classes back into Java source code + - View the Manifest + - A list of all entries in the archive (not just class files) Planned functionality includes... *************** *** 32,43 **** ------------ ! Installation is very straightforward. The tool is designed and intended ! primarily for Java developers so it is assumed that the user is familiar ! with setting up the Java runtime environment. The jarspy.jar file located ! in the lib/ directory of this distribution is an executable jar. ! ! java -jar lib/jarspy.jar ! ... should do the trick. --- 35,44 ---- ------------ ! As of version 0.5, JarSpy is deployed using Sun's Java Web Start ! technology. To install the application, please visit ! http://www.jarspy.org/. ! For more information on Web Start, please visit ! http://java.sun.com/products/javawebstart/. |
|
From: Jeff B. <br...@us...> - 2002-07-19 00:24:42
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy
In directory usw-pr-cvs1:/tmp/cvs-serv14043/com/ociweb/jarspy
Added Files:
JarProcessingListener.java
Log Message:
added progress feedback screen
--- NEW FILE: JarProcessingListener.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy;
/**
* JarProcessingListener objects are notified of progress as a
* JarInspector is processing the contents of an archive
*
* @verson $Id: JarProcessingListener.java,v 1.1 2002/07/19 00:24:37 brown_j Exp $
*/
public interface JarProcessingListener {
public void updateJarProcessingProgress(String entry, int pct);
public void finishedProcessingJar();
}
|
|
From: Jeff B. <br...@us...> - 2002-07-19 00:24:42
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv14043/com/ociweb/jarspy/gui
Added Files:
StatusScreen.java
Log Message:
added progress feedback screen
--- NEW FILE: StatusScreen.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui;
import com.ociweb.jarspy.JarProcessingListener;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Window;
/**
* A screen for displaying status information as archives are being processed
*
* @version $Id: StatusScreen.java,v 1.1 2002/07/19 00:24:37 brown_j Exp $
*/
public class StatusScreen extends Window implements JarProcessingListener {
JLabel statusLabel = new JLabel("Status...");
private JProgressBar progressBar = new JProgressBar(0, 100);
public StatusScreen(JarSpyGUI parent) {
super(parent);
try {
setLayout(new BorderLayout());
JPanel p = new JPanel(new GridBagLayout());
ImageIcon icon =
new ImageIcon(getClass().getResource("images/jar.gif"));
Border titleBorder = BorderFactory.createTitledBorder("JarSpy - Processing Jar:");
Border bevelBorder = BorderFactory.createBevelBorder(BevelBorder.RAISED,
Color.gray, Color.gray.darker());
p.setBorder(BorderFactory.createCompoundBorder(bevelBorder, titleBorder));
JLabel iconLabel = new JLabel(icon);
iconLabel.setBorder(BorderFactory.createRaisedBevelBorder());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridwidth = gbc.gridheight = 1;
gbc.gridy = gbc.RELATIVE;
gbc.weightx = 1;
gbc.weighty = 1;
gbc.anchor = gbc.CENTER;
gbc.fill = gbc.NONE;
gbc.insets = new Insets(10, 10, 10, 10);
p.add(iconLabel, gbc);
gbc.weighty = 0;
gbc.fill = gbc.HORIZONTAL;
p.add(statusLabel, gbc);
p.add(progressBar, gbc);
add(BorderLayout.CENTER, p);
pack();
Dimension windowSize = getSize();
windowSize.width = 375;
setSize(windowSize);
Point parentLocation = parent.getLocation();
Dimension parentSize = parent.getSize();
windowSize = getSize();
int windowX = (parentSize.width / 2) +
parentLocation.x -
(windowSize.width / 2);
int windowY = (parentSize.height / 2) +
parentLocation.y -
(windowSize.height / 2);
setLocation(windowX, windowY);
} catch (Exception exc) {
exc.printStackTrace();
}
}
public void updateJarProcessingProgress(String entry, int pct) {
statusLabel.setText("Processing: " + entry);
progressBar.setValue(pct);
}
public void finishedProcessingJar() {
}
}
|
|
From: Jeff B. <br...@us...> - 2002-07-19 00:22:59
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy
In directory usw-pr-cvs1:/tmp/cvs-serv13461/com/ociweb/jarspy
Modified Files:
JarInspector.java
Log Message:
added progress feedback screen
Index: JarInspector.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/JarInspector.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** JarInspector.java 20 Jun 2002 02:08:27 -0000 1.7
--- JarInspector.java 19 Jul 2002 00:22:55 -0000 1.8
***************
*** 40,43 ****
--- 40,44 ----
JarFile jarFile = null;
private Set classSet = new TreeSet();
+ private JarProcessingListener processingListener;
private void closeJar() {
***************
*** 62,80 ****
}
public synchronized void setJarFile(JarFile jarFile) throws IOException {
closeJar();
this.jarFile = jarFile;
- //int numberOfEntries = 0;
- //ClassInfo[] tmpArray = new ClassInfo[64];
classSet.clear();
Enumeration entries = jarFile.entries();
while (entries.hasMoreElements()) {
JarEntry entry = (JarEntry) entries.nextElement();
if (entry.getName().endsWith(".class")) {
ClassInfo ci = new ClassInfo(jarFile.getInputStream(entry));
classSet.add(ci);
}
}
manifest = jarFile.getManifest();
}
--- 63,100 ----
}
+ /**
+ * Register a processing listener. Right now, only one listener may
+ * be registered at a time.
+ *
+ * @param l the listener being registered with this JarInspector
+ */
+ public void setProcessingListener(JarProcessingListener l) {
+ processingListener = l;
+ }
+
public synchronized void setJarFile(JarFile jarFile) throws IOException {
closeJar();
this.jarFile = jarFile;
classSet.clear();
Enumeration entries = jarFile.entries();
+ int total = jarFile.size();
+ int counter = 0;
while (entries.hasMoreElements()) {
+ counter++;
JarEntry entry = (JarEntry) entries.nextElement();
if (entry.getName().endsWith(".class")) {
ClassInfo ci = new ClassInfo(jarFile.getInputStream(entry));
+ if (processingListener != null) {
+ processingListener
+ .updateJarProcessingProgress(ci.getClassName(),
+ (100 * counter) / total);
+ }
classSet.add(ci);
}
}
manifest = jarFile.getManifest();
+ if (processingListener != null) {
+ processingListener.finishedProcessingJar();
+ }
}
***************
*** 92,96 ****
(!directory.isDirectory())) {
throw new IllegalArgumentException("Invalid dir: " +
! directory);
}
String directoryName = directory.getPath();
--- 112,116 ----
(!directory.isDirectory())) {
throw new IllegalArgumentException("Invalid dir: " +
! directory);
}
String directoryName = directory.getPath();
***************
*** 115,119 ****
try {
out = new FileOutputStream(directoryName +
! entryName);
in = jarFile.getInputStream(entry);
byte[] data = new byte[1024];
--- 135,139 ----
try {
out = new FileOutputStream(directoryName +
! entryName);
in = jarFile.getInputStream(entry);
byte[] data = new byte[1024];
|
|
From: Jeff B. <br...@us...> - 2002-07-19 00:22:59
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv13461/com/ociweb/jarspy/gui
Modified Files:
JarSpyGUI.java
Log Message:
added progress feedback screen
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** JarSpyGUI.java 17 Jul 2002 14:00:24 -0000 1.30
--- JarSpyGUI.java 19 Jul 2002 00:22:55 -0000 1.31
***************
*** 26,31 ****
import com.ociweb.jarspy.gui.actions.ActionNames;
import com.ociweb.jarspy.gui.actions.DecompileAction;
- import com.ociweb.jarspy.gui.actions.ExtractArchiveAction;
import com.ociweb.jarspy.gui.actions.ExitAction;
import com.ociweb.jarspy.gui.actions.OpenArchiveAction;
import com.ociweb.jarspy.gui.actions.ViewJarContentsAction;
--- 26,31 ----
import com.ociweb.jarspy.gui.actions.ActionNames;
import com.ociweb.jarspy.gui.actions.DecompileAction;
import com.ociweb.jarspy.gui.actions.ExitAction;
+ import com.ociweb.jarspy.gui.actions.ExtractArchiveAction;
import com.ociweb.jarspy.gui.actions.OpenArchiveAction;
import com.ociweb.jarspy.gui.actions.ViewJarContentsAction;
***************
*** 209,213 ****
menu = new JMenu("Help");
- // menuBar.setHelpMenu(menu);
menuBar.add(menu);
--- 209,212 ----
***************
*** 232,242 ****
setTitle("JarSpy");
- clearLists();
- jarInspector.setFile(file);
- refreshClassList();
-
- notifyFileSelectionListeners(file);
! setTitle("JarSpy - " + file.getName());
}
--- 231,256 ----
setTitle("JarSpy");
! StatusScreen ss = null;
! try {
! clearLists();
! ss = new StatusScreen(JarSpyGUI.this);
! jarInspector.setProcessingListener(ss);
! ss.setVisible(true);
! jarInspector.setFile(file);
! refreshClassList();
! notifyFileSelectionListeners(file);
! setTitle("JarSpy - " + file.getName());
! } catch (IOException e) {
! e.printStackTrace();
! throw e;
! } finally {
! if (ss != null) {
! try {
! ss.setVisible(false);
! } catch (Exception e1) {
! }
! }
! }
}
|
|
From: Jeff B. <br...@us...> - 2002-07-19 00:22:59
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions
In directory usw-pr-cvs1:/tmp/cvs-serv13461/com/ociweb/jarspy/gui/actions
Modified Files:
OpenArchiveAction.java
Log Message:
added progress feedback screen
Index: OpenArchiveAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/OpenArchiveAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** OpenArchiveAction.java 17 Jul 2002 14:04:24 -0000 1.2
--- OpenArchiveAction.java 19 Jul 2002 00:22:55 -0000 1.3
***************
*** 42,45 ****
--- 42,47 ----
int returnVal = fileChooser.showOpenDialog(jarSpyGUI);
if (returnVal == fileChooser.APPROVE_OPTION) {
+ Thread t = new Thread() {
+ public void run() {
File file = null;
jarSpyGUI.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
***************
*** 60,63 ****
--- 62,68 ----
jarSpyGUI.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
+ }
+ };
+ t.start();
}
}
|
|
From: Jeff B. <br...@us...> - 2002-07-19 00:17:23
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv11659
Modified Files:
JarSpyInfoPanel.java
Log Message:
incremented version number
Index: JarSpyInfoPanel.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyInfoPanel.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** JarSpyInfoPanel.java 13 Jun 2002 03:06:11 -0000 1.19
--- JarSpyInfoPanel.java 19 Jul 2002 00:17:20 -0000 1.20
***************
*** 46,50 ****
gbc.insets.top = gbc.insets.bottom = 0;
! add(new JLabel("JarSpy v0.5.2"), gbc);
add(new JLabel("http://www.jarspy.org/"), gbc);
add(new JLabel("Email: co...@ja..."), gbc);
--- 46,50 ----
gbc.insets.top = gbc.insets.bottom = 0;
! add(new JLabel("JarSpy v0.6"), gbc);
add(new JLabel("http://www.jarspy.org/"), gbc);
add(new JLabel("Email: co...@ja..."), gbc);
|
|
From: Jeff B. <br...@us...> - 2002-07-17 14:04:27
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions
In directory usw-pr-cvs1:/tmp/cvs-serv28610/com/ociweb/jarspy/gui/actions
Modified Files:
AboutAction.java DecompileAction.java ExitAction.java
ExtractArchiveAction.java OpenArchiveAction.java
ViewJarContentsAction.java ViewManifestAction.java
Log Message:
fixed up relative image paths
Index: AboutAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/AboutAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AboutAction.java 17 Jul 2002 14:00:25 -0000 1.1
--- AboutAction.java 17 Jul 2002 14:04:24 -0000 1.2
***************
*** 33,37 ****
super(gui,
ActionNames.ABOUT_ACTION,
! "images/question.gif",
false);
}
--- 33,37 ----
super(gui,
ActionNames.ABOUT_ACTION,
! "../images/question.gif",
false);
}
Index: DecompileAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/DecompileAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DecompileAction.java 17 Jul 2002 14:00:25 -0000 1.1
--- DecompileAction.java 17 Jul 2002 14:04:24 -0000 1.2
***************
*** 49,53 ****
super(gui,
ActionNames.DECOMPILE_ACTION,
! "images/decompile.gif",
false);
this.jarInspector = jarInspector;
--- 49,53 ----
super(gui,
ActionNames.DECOMPILE_ACTION,
! "../images/decompile.gif",
false);
this.jarInspector = jarInspector;
Index: ExitAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/ExitAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ExitAction.java 17 Jul 2002 14:00:25 -0000 1.1
--- ExitAction.java 17 Jul 2002 14:04:24 -0000 1.2
***************
*** 33,37 ****
public ExitAction(JarSpyGUI gui) {
! super(gui, ActionNames.EXIT_ACTION, "images/exit.gif", false);
}
--- 33,37 ----
public ExitAction(JarSpyGUI gui) {
! super(gui, ActionNames.EXIT_ACTION, "../images/exit.gif", false);
}
Index: ExtractArchiveAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/ExtractArchiveAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ExtractArchiveAction.java 17 Jul 2002 14:00:25 -0000 1.1
--- ExtractArchiveAction.java 17 Jul 2002 14:04:24 -0000 1.2
***************
*** 38,42 ****
super(gui,
ActionNames.EXTRACT_ARCHIVE_ACTION,
! "images/extract.gif",
true);
jarInspector = inspector;
--- 38,42 ----
super(gui,
ActionNames.EXTRACT_ARCHIVE_ACTION,
! "../images/extract.gif",
true);
jarInspector = inspector;
Index: OpenArchiveAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/OpenArchiveAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** OpenArchiveAction.java 17 Jul 2002 14:00:25 -0000 1.1
--- OpenArchiveAction.java 17 Jul 2002 14:04:24 -0000 1.2
***************
*** 35,39 ****
public OpenArchiveAction(JarSpyGUI gui) {
! super(gui, ActionNames.OPEN_ARCHIVE_ACTION, "images/open.gif", false);
}
--- 35,39 ----
public OpenArchiveAction(JarSpyGUI gui) {
! super(gui, ActionNames.OPEN_ARCHIVE_ACTION, "../images/open.gif", false);
}
Index: ViewJarContentsAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/ViewJarContentsAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ViewJarContentsAction.java 17 Jul 2002 14:00:25 -0000 1.1
--- ViewJarContentsAction.java 17 Jul 2002 14:04:24 -0000 1.2
***************
*** 49,53 ****
super(jarSpyGUI,
ActionNames.VIEW_JAR_CONTENTS_ACTION,
! "images/jarcontents.gif",
true);
setEnabled(false);
--- 49,53 ----
super(jarSpyGUI,
ActionNames.VIEW_JAR_CONTENTS_ACTION,
! "../images/jarcontents.gif",
true);
setEnabled(false);
Index: ViewManifestAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions/ViewManifestAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ViewManifestAction.java 17 Jul 2002 14:00:25 -0000 1.1
--- ViewManifestAction.java 17 Jul 2002 14:04:24 -0000 1.2
***************
*** 40,44 ****
super(gui,
ActionNames.VIEW_MANIFEST_ACTION,
! "images/manifest.gif",
true);
this.jarInspector = jarInspector;
--- 40,44 ----
super(gui,
ActionNames.VIEW_MANIFEST_ACTION,
! "../images/manifest.gif",
true);
this.jarInspector = jarInspector;
|
|
From: Jeff B. <br...@us...> - 2002-07-17 14:00:28
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions
In directory usw-pr-cvs1:/tmp/cvs-serv26270/com/ociweb/jarspy/gui/actions
Added Files:
AboutAction.java ActionNames.java DecompileAction.java
ExitAction.java ExtractArchiveAction.java JarSpyAction.java
OpenArchiveAction.java ViewJarContentsAction.java
ViewManifestAction.java
Log Message:
moved actions to their own package and adjusted access specifiers accordingly
--- NEW FILE: AboutAction.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui.actions;
import com.ociweb.jarspy.gui.JarSpyGUI;
import com.ociweb.jarspy.gui.AboutJarSpy;
import java.awt.event.ActionEvent;
/**
* @author Jeff Brown
* @version $Id: AboutAction.java,v 1.1 2002/07/17 14:00:25 brown_j Exp $
*/
public class AboutAction extends JarSpyAction {
public AboutAction(JarSpyGUI gui) {
super(gui,
ActionNames.ABOUT_ACTION,
"images/question.gif",
false);
}
public void actionPerformed(ActionEvent ae) {
AboutJarSpy ajs = new AboutJarSpy(jarSpyGUI);
ajs.setVisible(true);
ajs.dispose();
}
}
--- NEW FILE: ActionNames.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui.actions;
/**
* @author Jeff Brown
* @version $Id: ActionNames.java,v 1.1 2002/07/17 14:00:25 brown_j Exp $
*/
public interface ActionNames {
String OPEN_ARCHIVE_ACTION = "Open Archive";
String EXIT_ACTION = "Exit";
String ABOUT_ACTION = "About";
String VIEW_MANIFEST_ACTION = "View Manifest";
String EXTRACT_ARCHIVE_ACTION = "Extract Archive";
String DECOMPILE_ACTION = "Decompile Class";
String VIEW_JAR_CONTENTS_ACTION = "View Jar Contents";
}
--- NEW FILE: DecompileAction.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui.actions;
import com.ociweb.jarspy.ClassInfo;
import com.ociweb.jarspy.JarInspector;
import com.ociweb.jarspy.gui.JarFileSelectionListener;
import com.ociweb.jarspy.gui.JarSpyGUI;
import com.ociweb.jarspy.gui.DecompileGUI;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.event.ActionEvent;
import java.io.File;
/**
* @author Jeff Brown
* @version $Id: DecompileAction.java,v 1.1 2002/07/17 14:00:25 brown_j Exp $
*/
public class DecompileAction extends JarSpyAction
implements JarFileSelectionListener, ListSelectionListener {
private String className;
private JList classList;
private String pathToJarFile;
private JarInspector jarInspector;
public DecompileAction(JarSpyGUI gui,
JList classList,
JarInspector jarInspector) {
super(gui,
ActionNames.DECOMPILE_ACTION,
"images/decompile.gif",
false);
this.jarInspector = jarInspector;
setEnabled(false);
this.classList = classList;
classList.addListSelectionListener(this);
}
public void jarFileSelectionChanged(File jarFile) {
super.jarFileSelectionChanged(jarFile);
if (jarFile != null) {
pathToJarFile = jarFile.getPath();
}
}
public void actionPerformed(ActionEvent ae) {
try {
// dec.decompile(className,
// new java.io.PrintWriter(System.out),
// null);
DecompileGUI dg = new DecompileGUI(jarSpyGUI,
className,
pathToJarFile,
jarInspector);
dg.setVisible(true);
dg.dispose();
} catch (Exception exc) {
JOptionPane.showMessageDialog(jarSpyGUI,
"ERROR: " + exc.getMessage(),
"Decompile Failed",
JOptionPane.ERROR_MESSAGE);
}
}
public void valueChanged(ListSelectionEvent lse) {
if (!lse.getValueIsAdjusting()) {
className = null;
Object o = classList.getSelectedValue();
if (o instanceof ClassInfo) {
setEnabled(true);
className = ((ClassInfo) o).getClassName();
} else {
setEnabled(false);
}
}
}
}
--- NEW FILE: ExitAction.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui.actions;
import com.ociweb.jarspy.gui.JarSpyGUI;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
/**
* @author Jeff Brown
* @version $Id: ExitAction.java,v 1.1 2002/07/17 14:00:25 brown_j Exp $
*/
public class ExitAction extends JarSpyAction implements WindowListener {
public ExitAction(JarSpyGUI gui) {
super(gui, ActionNames.EXIT_ACTION, "images/exit.gif", false);
}
public void actionPerformed(ActionEvent ae) {
exitApplication();
}
public void windowClosing(WindowEvent we) {
exitApplication();
}
public void windowOpened(WindowEvent we) {
}
public void windowClosed(WindowEvent we) {
}
public void windowIconified(WindowEvent we) {
}
public void windowDeiconified(WindowEvent we) {
}
public void windowActivated(WindowEvent we) {
}
public void windowDeactivated(WindowEvent we) {
}
private void exitApplication() {
if (JOptionPane.showConfirmDialog(jarSpyGUI,
"Are You Sure You Want To Exit JarSpy?",
"Confirm Exit",
JOptionPane.YES_NO_OPTION) ==
JOptionPane.YES_OPTION) {
System.exit(0);
}
}
}
--- NEW FILE: ExtractArchiveAction.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui.actions;
import com.ociweb.jarspy.JarInspector;
import com.ociweb.jarspy.gui.JarSpyGUI;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.File;
/**
* @author Jeff Brown
* @version $Id: ExtractArchiveAction.java,v 1.1 2002/07/17 14:00:25 brown_j Exp $
*/
public class ExtractArchiveAction extends JarSpyAction {
private final JarInspector jarInspector;
public ExtractArchiveAction(JarSpyGUI gui,
JarInspector inspector) {
super(gui,
ActionNames.EXTRACT_ARCHIVE_ACTION,
"images/extract.gif",
true);
jarInspector = inspector;
}
public void actionPerformed(ActionEvent ae) {
extractArchive();
}
private void extractArchive() {
JFileChooser chooser = new JFileChooser();
chooser.setFileSelectionMode(chooser.DIRECTORIES_ONLY);
chooser.setDialogTitle("Extract Archive To...");
chooser.showOpenDialog(jarSpyGUI);
File file = chooser.getSelectedFile();
if (file != null) {
if (file.isDirectory()) {
try {
jarInspector.extractTo(file);
} catch (Exception exc) {
String msg = "Error occurred extracting archive!";
JOptionPane.showMessageDialog(jarSpyGUI,
msg,
"ERROR",
JOptionPane.ERROR_MESSAGE);
}
}
}
}
}
--- NEW FILE: JarSpyAction.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui.actions;
import com.ociweb.jarspy.gui.JarFileSelectionListener;
import com.ociweb.jarspy.gui.JarSpyGUI;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import java.io.File;
/**
* @author Jeff Brown
* @version $Id: JarSpyAction.java,v 1.1 2002/07/17 14:00:25 brown_j Exp $
*/
public abstract class JarSpyAction extends AbstractAction
implements JarFileSelectionListener {
/**
* this flag indicates wether or not this action should be disabled
* when there is not an archive currently opened
*/
private boolean disabledWhenNoJarIsOpen = false;
/**
* the main gui
*/
protected JarSpyGUI jarSpyGUI;
/**
* @param gui the main GUI
* @param actionName the string name of this action
* @param imagePath the path to the image associated with this action
* @param disabledWhenNoJarIsOpen indicates wether or not this action
* should be disabled when there is not an archive currently open
*/
public JarSpyAction(JarSpyGUI gui,
String actionName,
String imagePath,
boolean disabledWhenNoJarIsOpen) {
super(actionName);
putValue(SMALL_ICON,
new ImageIcon(getClass().getResource(imagePath)));
putValue(SHORT_DESCRIPTION, actionName);
gui.addJarFileSelectionListener(this);
jarSpyGUI = gui;
this.disabledWhenNoJarIsOpen = disabledWhenNoJarIsOpen;
}
public void jarFileSelectionChanged(File jarFile) {
if (disabledWhenNoJarIsOpen) {
setEnabled(jarFile != null);
}
}
}
--- NEW FILE: OpenArchiveAction.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui.actions;
import com.ociweb.jarspy.gui.JarSpyGUI;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
/**
* @author Jeff Brown
* @version $Id: OpenArchiveAction.java,v 1.1 2002/07/17 14:00:25 brown_j Exp $
*/
public class OpenArchiveAction extends JarSpyAction {
private final JFileChooser fileChooser = new JFileChooser();
public OpenArchiveAction(JarSpyGUI gui) {
super(gui, ActionNames.OPEN_ARCHIVE_ACTION, "images/open.gif", false);
}
public void actionPerformed(ActionEvent ae) {
SwingUtilities.updateComponentTreeUI(fileChooser);
int returnVal = fileChooser.showOpenDialog(jarSpyGUI);
if (returnVal == fileChooser.APPROVE_OPTION) {
File file = null;
jarSpyGUI.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try {
file = fileChooser.getSelectedFile();
jarSpyGUI.setFile(file);
} catch (Exception exc) {
String msg = "File: " + (file != null ?
file.getName() :
"(unknown)") +
"\n" +
exc.getMessage();
JOptionPane.showMessageDialog(jarSpyGUI,
msg,
"ERROR",
JOptionPane.ERROR_MESSAGE);
} finally {
jarSpyGUI.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
}
}
--- NEW FILE: ViewJarContentsAction.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui.actions;
import com.ociweb.jarspy.gui.JarFileSelectionListener;
import com.ociweb.jarspy.gui.JarSpyGUI;
import com.ociweb.jarspy.gui.JarContentsTableModel;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.TableModel;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;
import java.util.jar.JarFile;
/*
* ViewJarContentsAction
*
* @version $Id: ViewJarContentsAction.java,v 1.1 2002/07/17 14:00:25 brown_j Exp $
*/
public class ViewJarContentsAction extends JarSpyAction
implements JarFileSelectionListener {
private File jarFile = null;
public ViewJarContentsAction(JarSpyGUI jarSpyGUI) {
super(jarSpyGUI,
ActionNames.VIEW_JAR_CONTENTS_ACTION,
"images/jarcontents.gif",
true);
setEnabled(false);
}
public void actionPerformed(ActionEvent e) {
if (jarFile == null) {
// should never happen because the action should
// be disabled when the file is null...
JOptionPane.showMessageDialog(null,
"Jar File Is Null!",
"Error Opening Jar File",
JOptionPane.ERROR_MESSAGE);
} else {
try {
JDialog dlg = new JDialog((Frame) null,
"Jar Contents",
true);
TableModel jarContentsModel = new JarContentsTableModel(new JarFile(jarFile));
JScrollPane scroller = new JScrollPane(new JTable(jarContentsModel));
scroller.setPreferredSize(new Dimension(400, 200));
dlg.getContentPane().add(scroller);
dlg.pack();
dlg.setVisible(true);
dlg.dispose();
} catch (IOException exc) {
JOptionPane.showMessageDialog(null,
"ERROR: " + exc.getMessage(),
"Failure",
JOptionPane.ERROR_MESSAGE);
}
}
}
public void jarFileSelectionChanged(File jarFile) {
super.jarFileSelectionChanged(jarFile);
this.jarFile = jarFile;
}
}
--- NEW FILE: ViewManifestAction.java ---
// JarSpy
// Copyright (c) 2001, 2002 Jeff S. Brown
// This file is part of JarSpy.
//
// JarSpy is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// JarSpy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with JarSpy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package com.ociweb.jarspy.gui.actions;
import com.ociweb.jarspy.JarInspector;
import com.ociweb.jarspy.gui.JarSpyGUI;
import com.ociweb.jarspy.gui.ManifestDialog;
import javax.swing.JOptionPane;
import java.awt.event.ActionEvent;
import java.io.File;
import java.util.jar.Manifest;
/**
* @author Jeff Brown
* @version $Id: ViewManifestAction.java,v 1.1 2002/07/17 14:00:25 brown_j Exp $
*/
public class ViewManifestAction extends JarSpyAction {
private JarInspector jarInspector;
public ViewManifestAction(JarSpyGUI gui,
JarInspector jarInspector) {
super(gui,
ActionNames.VIEW_MANIFEST_ACTION,
"images/manifest.gif",
true);
this.jarInspector = jarInspector;
setEnabled(false);
}
public void actionPerformed(ActionEvent ae) {
Manifest manifest = jarInspector.getManifest();
if (manifest == null) {
JOptionPane.showMessageDialog(jarSpyGUI,
"No Manifest Found.",
"Not Found",
JOptionPane.INFORMATION_MESSAGE);
} else {
ManifestDialog md = new ManifestDialog(jarSpyGUI, manifest);
md.setVisible(true);
md.dispose();
}
}
}
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv26270/com/ociweb/jarspy/gui
Modified Files:
AboutJarSpy.java DecompileGUI.java
JarFileSelectionListener.java JarSpyGUI.java
ManifestDialog.java
Removed Files:
AboutAction.java ActionNames.java DecompileAction.java
ExitAction.java ExtractArchiveAction.java JarSpyAction.java
OpenArchiveAction.java ViewJarContentsAction.java
ViewManifestAction.java
Log Message:
moved actions to their own package and adjusted access specifiers accordingly
Index: AboutJarSpy.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/AboutJarSpy.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** AboutJarSpy.java 19 Jun 2002 01:19:10 -0000 1.4
--- AboutJarSpy.java 17 Jul 2002 14:00:24 -0000 1.5
***************
*** 28,34 ****
* @version $Id$
*/
! class AboutJarSpy extends JDialog {
! AboutJarSpy(JFrame parent) {
super(parent, "About JarSpy", true);
Container cont = getContentPane();
--- 28,34 ----
* @version $Id$
*/
! public class AboutJarSpy extends JDialog {
! public AboutJarSpy(JFrame parent) {
super(parent, "About JarSpy", true);
Container cont = getContentPane();
Index: DecompileGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/DecompileGUI.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DecompileGUI.java 19 Jun 2002 01:19:10 -0000 1.2
--- DecompileGUI.java 17 Jul 2002 14:00:24 -0000 1.3
***************
*** 30,36 ****
* @version $Id$
*/
! class DecompileGUI extends JDialog {
! DecompileGUI(JFrame parent,
String className,
String pathToJarFile,
--- 30,36 ----
* @version $Id$
*/
! public class DecompileGUI extends JDialog {
! public DecompileGUI(JFrame parent,
String className,
String pathToJarFile,
Index: JarFileSelectionListener.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarFileSelectionListener.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** JarFileSelectionListener.java 19 Jun 2002 01:19:10 -0000 1.2
--- JarFileSelectionListener.java 17 Jul 2002 14:00:24 -0000 1.3
***************
*** 21,25 ****
import java.io.File;
! interface JarFileSelectionListener {
void jarFileSelectionChanged(File jarFile);
}
--- 21,25 ----
import java.io.File;
! public interface JarFileSelectionListener {
void jarFileSelectionChanged(File jarFile);
}
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** JarSpyGUI.java 17 Jul 2002 13:21:08 -0000 1.29
--- JarSpyGUI.java 17 Jul 2002 14:00:24 -0000 1.30
***************
*** 23,26 ****
--- 23,34 ----
import com.ociweb.jarspy.ClassInfo;
import com.ociweb.jarspy.JarInspector;
+ import com.ociweb.jarspy.gui.actions.AboutAction;
+ import com.ociweb.jarspy.gui.actions.ActionNames;
+ import com.ociweb.jarspy.gui.actions.DecompileAction;
+ import com.ociweb.jarspy.gui.actions.ExtractArchiveAction;
+ import com.ociweb.jarspy.gui.actions.ExitAction;
+ import com.ociweb.jarspy.gui.actions.OpenArchiveAction;
+ import com.ociweb.jarspy.gui.actions.ViewJarContentsAction;
+ import com.ociweb.jarspy.gui.actions.ViewManifestAction;
import com.ociweb.jarspy.preferences.JarSpyPreferences;
import com.ociweb.jarspy.preferences.JarSpyPreferencesFactory;
***************
*** 220,224 ****
}
! void setFile(File file) throws IOException {
notifyFileSelectionListeners(null);
--- 228,232 ----
}
! public void setFile(File file) throws IOException {
notifyFileSelectionListeners(null);
Index: ManifestDialog.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/ManifestDialog.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ManifestDialog.java 19 Jun 2002 01:19:10 -0000 1.3
--- ManifestDialog.java 17 Jul 2002 14:00:24 -0000 1.4
***************
*** 32,38 ****
* @version $Id$
*/
! class ManifestDialog extends JDialog {
! ManifestDialog(JFrame parent,
Manifest manifest) {
super(parent, "Manifest", true);
--- 32,38 ----
* @version $Id$
*/
! public class ManifestDialog extends JDialog {
! public ManifestDialog(JFrame parent,
Manifest manifest) {
super(parent, "Manifest", true);
--- AboutAction.java DELETED ---
--- ActionNames.java DELETED ---
--- DecompileAction.java DELETED ---
--- ExitAction.java DELETED ---
--- ExtractArchiveAction.java DELETED ---
--- JarSpyAction.java DELETED ---
--- OpenArchiveAction.java DELETED ---
--- ViewJarContentsAction.java DELETED ---
--- ViewManifestAction.java DELETED ---
|
|
From: Jeff B. <br...@us...> - 2002-07-17 13:50:45
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions In directory usw-pr-cvs1:/tmp/cvs-serv20074/actions Log Message: Directory /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/actions added to the repository |
|
From: Jeff B. <br...@us...> - 2002-07-17 13:50:24
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv19967/com/ociweb/jarspy/gui
Modified Files:
AboutAction.java DecompileAction.java ExitAction.java
ExtractArchiveAction.java JarSpyAction.java
OpenArchiveAction.java ViewJarContentsAction.java
ViewManifestAction.java
Log Message:
reconfig actions so they disable themselves when appropriate
Index: AboutAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/AboutAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** AboutAction.java 15 Jul 2002 22:54:48 -0000 1.3
--- AboutAction.java 17 Jul 2002 13:50:19 -0000 1.4
***************
*** 27,35 ****
class AboutAction extends JarSpyAction {
- private final JarSpyGUI jarSpyGUI;
AboutAction(JarSpyGUI gui) {
! super(ActionNames.ABOUT_ACTION, "images/question.gif");
! jarSpyGUI = gui;
}
--- 27,36 ----
class AboutAction extends JarSpyAction {
AboutAction(JarSpyGUI gui) {
! super(gui,
! ActionNames.ABOUT_ACTION,
! "images/question.gif",
! false);
}
Index: DecompileAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/DecompileAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DecompileAction.java 15 Jul 2002 22:54:48 -0000 1.3
--- DecompileAction.java 17 Jul 2002 13:50:19 -0000 1.4
***************
*** 36,41 ****
implements JarFileSelectionListener, ListSelectionListener {
- private final JarSpyGUI jarSpyGUI;
- // private final Decompiler dec = new Decompiler();
private String className;
private JList classList;
--- 36,39 ----
***************
*** 46,60 ****
JList classList,
JarInspector jarInspector) {
! super(ActionNames.DECOMPILE_ACTION, "images/decompile.gif");
this.jarInspector = jarInspector;
- jarSpyGUI = gui;
setEnabled(false);
this.classList = classList;
classList.addListSelectionListener(this);
- jarSpyGUI.addJarFileSelectionListener(this);
}
public void jarFileSelectionChanged(File jarFile) {
! setEnabled(false);
if (jarFile != null) {
pathToJarFile = jarFile.getPath();
--- 44,59 ----
JList classList,
JarInspector jarInspector) {
! super(gui,
! ActionNames.DECOMPILE_ACTION,
! "images/decompile.gif",
! false);
this.jarInspector = jarInspector;
setEnabled(false);
this.classList = classList;
classList.addListSelectionListener(this);
}
public void jarFileSelectionChanged(File jarFile) {
! super.jarFileSelectionChanged(jarFile);
if (jarFile != null) {
pathToJarFile = jarFile.getPath();
Index: ExitAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/ExitAction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ExitAction.java 19 Jun 2002 02:17:14 -0000 1.4
--- ExitAction.java 17 Jul 2002 13:50:19 -0000 1.5
***************
*** 30,38 ****
class ExitAction extends JarSpyAction implements WindowListener {
- private final JarSpyGUI jarSpyGUI;
-
ExitAction(JarSpyGUI gui) {
! super(ActionNames.EXIT_ACTION, "images/exit.gif");
! jarSpyGUI = gui;
}
--- 30,35 ----
class ExitAction extends JarSpyAction implements WindowListener {
ExitAction(JarSpyGUI gui) {
! super(gui, ActionNames.EXIT_ACTION, "images/exit.gif", false);
}
Index: ExtractArchiveAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/ExtractArchiveAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ExtractArchiveAction.java 17 Jul 2002 13:17:52 -0000 1.3
--- ExtractArchiveAction.java 17 Jul 2002 13:50:19 -0000 1.4
***************
*** 29,44 ****
* @version $Id$
*/
! class ExtractArchiveAction extends JarSpyAction
! implements JarFileSelectionListener {
- private final JarSpyGUI jarSpyGUI;
private final JarInspector jarInspector;
ExtractArchiveAction(JarSpyGUI gui,
JarInspector inspector) {
! super(ActionNames.EXTRACT_ARCHIVE_ACTION, "images/extract.gif");
! jarSpyGUI = gui;
jarInspector = inspector;
- jarSpyGUI.addJarFileSelectionListener(this);
}
--- 29,43 ----
* @version $Id$
*/
! class ExtractArchiveAction extends JarSpyAction {
private final JarInspector jarInspector;
ExtractArchiveAction(JarSpyGUI gui,
JarInspector inspector) {
! super(gui,
! ActionNames.EXTRACT_ARCHIVE_ACTION,
! "images/extract.gif",
! true);
jarInspector = inspector;
}
***************
*** 66,73 ****
}
}
- }
-
- public void jarFileSelectionChanged(File jarFile) {
- setEnabled(jarFile != null);
}
}
--- 65,68 ----
Index: JarSpyAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** JarSpyAction.java 19 Jun 2002 01:19:10 -0000 1.2
--- JarSpyAction.java 17 Jul 2002 13:50:19 -0000 1.3
***************
*** 19,23 ****
package com.ociweb.jarspy.gui;
! import javax.swing.*;
/**
--- 19,25 ----
package com.ociweb.jarspy.gui;
! import javax.swing.AbstractAction;
! import javax.swing.ImageIcon;
! import java.io.File;
/**
***************
*** 25,36 ****
* @version $Id$
*/
! abstract class JarSpyAction extends AbstractAction {
! JarSpyAction(String actionName,
! String imagePath) {
super(actionName);
putValue(SMALL_ICON,
! new ImageIcon(getClass().getResource(imagePath)));
putValue(SHORT_DESCRIPTION, actionName);
}
}
--- 27,68 ----
* @version $Id$
*/
! abstract class JarSpyAction extends AbstractAction
! implements JarFileSelectionListener {
! /**
! * this flag indicates wether or not this action should be disabled
! * when there is not an archive currently opened
! */
! private boolean disabledWhenNoJarIsOpen = false;
!
! /**
! * the main gui
! */
! protected JarSpyGUI jarSpyGUI;
!
! /**
! * @param gui the main GUI
! * @param actionName the string name of this action
! * @param imagePath the path to the image associated with this action
! * @param disabledWhenNoJarIsOpen indicates wether or not this action
! * should be disabled when there is not an archive currently open
! */
! JarSpyAction(JarSpyGUI gui,
! String actionName,
! String imagePath,
! boolean disabledWhenNoJarIsOpen) {
super(actionName);
putValue(SMALL_ICON,
! new ImageIcon(getClass().getResource(imagePath)));
putValue(SHORT_DESCRIPTION, actionName);
+ gui.addJarFileSelectionListener(this);
+ jarSpyGUI = gui;
+ this.disabledWhenNoJarIsOpen = disabledWhenNoJarIsOpen;
+ }
+
+ public void jarFileSelectionChanged(File jarFile) {
+ if (disabledWhenNoJarIsOpen) {
+ setEnabled(jarFile != null);
+ }
}
}
Index: OpenArchiveAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/OpenArchiveAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** OpenArchiveAction.java 20 Jun 2002 02:04:50 -0000 1.3
--- OpenArchiveAction.java 17 Jul 2002 13:50:19 -0000 1.4
***************
*** 30,39 ****
class OpenArchiveAction extends JarSpyAction {
- private final JarSpyGUI jarSpyGUI;
private final JFileChooser fileChooser = new JFileChooser();
OpenArchiveAction(JarSpyGUI gui) {
! super(ActionNames.OPEN_ARCHIVE_ACTION, "images/open.gif");
! jarSpyGUI = gui;
}
--- 30,37 ----
class OpenArchiveAction extends JarSpyAction {
private final JFileChooser fileChooser = new JFileChooser();
OpenArchiveAction(JarSpyGUI gui) {
! super(gui, ActionNames.OPEN_ARCHIVE_ACTION, "images/open.gif", false);
}
Index: ViewJarContentsAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/ViewJarContentsAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ViewJarContentsAction.java 15 Jul 2002 22:54:49 -0000 1.2
--- ViewJarContentsAction.java 17 Jul 2002 13:50:19 -0000 1.3
***************
*** 19,25 ****
package com.ociweb.jarspy.gui;
! import javax.swing.*;
import javax.swing.table.TableModel;
! import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
--- 19,29 ----
package com.ociweb.jarspy.gui;
! import javax.swing.JDialog;
! import javax.swing.JOptionPane;
! import javax.swing.JScrollPane;
! import javax.swing.JTable;
import javax.swing.table.TableModel;
! import java.awt.Dimension;
! import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.io.File;
***************
*** 39,44 ****
ViewJarContentsAction(JarSpyGUI jarSpyGUI) {
! super(ActionNames.VIEW_JAR_CONTENTS_ACTION, "images/jarcontents.gif");
! jarSpyGUI.addJarFileSelectionListener(this);
setEnabled(false);
}
--- 43,50 ----
ViewJarContentsAction(JarSpyGUI jarSpyGUI) {
! super(jarSpyGUI,
! ActionNames.VIEW_JAR_CONTENTS_ACTION,
! "images/jarcontents.gif",
! true);
setEnabled(false);
}
***************
*** 49,61 ****
// be disabled when the file is null...
JOptionPane.showMessageDialog(null,
! "Jar File Is Null!",
! "Error Opening Jar File",
! JOptionPane.ERROR_MESSAGE);
} else {
try {
JDialog dlg = new JDialog((Frame) null,
! "Jar Contents",
! true);
TableModel jarContentsModel = new JarContentsTableModel(new JarFile(jarFile));
JScrollPane scroller = new JScrollPane(new JTable(jarContentsModel));
--- 55,67 ----
// be disabled when the file is null...
JOptionPane.showMessageDialog(null,
! "Jar File Is Null!",
! "Error Opening Jar File",
! JOptionPane.ERROR_MESSAGE);
} else {
try {
JDialog dlg = new JDialog((Frame) null,
! "Jar Contents",
! true);
TableModel jarContentsModel = new JarContentsTableModel(new JarFile(jarFile));
JScrollPane scroller = new JScrollPane(new JTable(jarContentsModel));
***************
*** 67,73 ****
} catch (IOException exc) {
JOptionPane.showMessageDialog(null,
! "ERROR: " + exc.getMessage(),
! "Failure",
! JOptionPane.ERROR_MESSAGE);
}
}
--- 73,79 ----
} catch (IOException exc) {
JOptionPane.showMessageDialog(null,
! "ERROR: " + exc.getMessage(),
! "Failure",
! JOptionPane.ERROR_MESSAGE);
}
}
***************
*** 75,80 ****
public void jarFileSelectionChanged(File jarFile) {
this.jarFile = jarFile;
- setEnabled(jarFile != null);
}
}
--- 81,86 ----
public void jarFileSelectionChanged(File jarFile) {
+ super.jarFileSelectionChanged(jarFile);
this.jarFile = jarFile;
}
}
Index: ViewManifestAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/ViewManifestAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ViewManifestAction.java 17 Jul 2002 13:04:48 -0000 1.3
--- ViewManifestAction.java 17 Jul 2002 13:50:19 -0000 1.4
***************
*** 30,46 ****
* @version $Id$
*/
! class ViewManifestAction extends JarSpyAction
! implements JarFileSelectionListener {
- private final JarSpyGUI jarSpyGUI;
private JarInspector jarInspector;
ViewManifestAction(JarSpyGUI gui,
JarInspector jarInspector) {
! super(ActionNames.VIEW_MANIFEST_ACTION, "images/manifest.gif");
this.jarInspector = jarInspector;
- jarSpyGUI = gui;
setEnabled(false);
- jarSpyGUI.addJarFileSelectionListener(this);
}
--- 30,45 ----
* @version $Id$
*/
! class ViewManifestAction extends JarSpyAction {
private JarInspector jarInspector;
ViewManifestAction(JarSpyGUI gui,
JarInspector jarInspector) {
! super(gui,
! ActionNames.VIEW_MANIFEST_ACTION,
! "images/manifest.gif",
! true);
this.jarInspector = jarInspector;
setEnabled(false);
}
***************
*** 58,65 ****
md.dispose();
}
- }
-
- public void jarFileSelectionChanged(File jarFile) {
- setEnabled(jarFile != null);
}
}
--- 57,60 ----
|
|
From: Jeff B. <br...@us...> - 2002-07-17 13:48:45
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/com In directory usw-pr-cvs1:/tmp/cvs-serv18917/com Log Message: Directory /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/com added to the repository |
|
From: Jeff B. <br...@us...> - 2002-07-17 13:21:10
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv9208
Modified Files:
JarSpyGUI.java
Log Message:
reorg import statements
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** JarSpyGUI.java 17 Jul 2002 13:17:52 -0000 1.28
--- JarSpyGUI.java 17 Jul 2002 13:21:08 -0000 1.29
***************
*** 26,33 ****
import com.ociweb.jarspy.preferences.JarSpyPreferencesFactory;
! import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
! import java.awt.*;
import java.awt.event.WindowListener;
import java.io.File;
--- 26,57 ----
import com.ociweb.jarspy.preferences.JarSpyPreferencesFactory;
! import javax.swing.Action;
! import javax.swing.BorderFactory;
! import javax.swing.DefaultListModel;
! import javax.swing.ImageIcon;
! import javax.swing.JComponent;
! import javax.swing.JFrame;
! import javax.swing.JLabel;
! import javax.swing.JList;
! import javax.swing.JMenu;
! import javax.swing.JMenuBar;
! import javax.swing.JMenuItem;
! import javax.swing.JOptionPane;
! import javax.swing.JPanel;
! import javax.swing.JScrollPane;
! import javax.swing.JSplitPane;
! import javax.swing.JToolBar;
! import javax.swing.ListModel;
! import javax.swing.ListSelectionModel;
! import javax.swing.SwingUtilities;
! import javax.swing.UIManager;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
! import java.awt.BorderLayout;
! import java.awt.Container;
! import java.awt.Cursor;
! import java.awt.Dimension;
! import java.awt.Font;
! import java.awt.Point;
import java.awt.event.WindowListener;
import java.io.File;
***************
*** 38,42 ****
import java.util.Map;
import java.util.jar.JarFile;
- import java.util.jar.Manifest;
/**
--- 62,65 ----
***************
*** 128,144 ****
private void createActions() {
actions.put(ActionNames.OPEN_ARCHIVE_ACTION,
! new OpenArchiveAction(this));
actions.put(ActionNames.EXIT_ACTION,
! new ExitAction(this));
actions.put(ActionNames.EXTRACT_ARCHIVE_ACTION,
! new ExtractArchiveAction(this, jarInspector));
actions.put(ActionNames.VIEW_MANIFEST_ACTION,
! new ViewManifestAction(this, jarInspector));
actions.put(ActionNames.ABOUT_ACTION,
! new AboutAction(this));
actions.put(ActionNames.DECOMPILE_ACTION,
! new DecompileAction(this, classList, jarInspector));
actions.put(ActionNames.VIEW_JAR_CONTENTS_ACTION,
! new ViewJarContentsAction(this));
}
--- 151,167 ----
private void createActions() {
actions.put(ActionNames.OPEN_ARCHIVE_ACTION,
! new OpenArchiveAction(this));
actions.put(ActionNames.EXIT_ACTION,
! new ExitAction(this));
actions.put(ActionNames.EXTRACT_ARCHIVE_ACTION,
! new ExtractArchiveAction(this, jarInspector));
actions.put(ActionNames.VIEW_MANIFEST_ACTION,
! new ViewManifestAction(this, jarInspector));
actions.put(ActionNames.ABOUT_ACTION,
! new AboutAction(this));
actions.put(ActionNames.DECOMPILE_ACTION,
! new DecompileAction(this, classList, jarInspector));
actions.put(ActionNames.VIEW_JAR_CONTENTS_ACTION,
! new ViewJarContentsAction(this));
}
***************
*** 305,311 ****
} catch (ClassNotFoundException e) {
JOptionPane.showMessageDialog(null,
! "JarSpy requires Java Runtime 1.3 or greater.",
! "Incompatible VM",
! JOptionPane.ERROR_MESSAGE);
System.exit(0);
}
--- 328,334 ----
} catch (ClassNotFoundException e) {
JOptionPane.showMessageDialog(null,
! "JarSpy requires Java Runtime 1.3 or greater.",
! "Incompatible VM",
! JOptionPane.ERROR_MESSAGE);
System.exit(0);
}
|
|
From: Jeff B. <br...@us...> - 2002-07-17 13:17:55
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv7852/com/ociweb/jarspy/gui
Modified Files:
ExtractArchiveAction.java JarSpyGUI.java
Log Message:
fix extract action so it disables itself when appropriate
Index: ExtractArchiveAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/ExtractArchiveAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ExtractArchiveAction.java 19 Jun 2002 01:19:10 -0000 1.2
--- ExtractArchiveAction.java 17 Jul 2002 13:17:52 -0000 1.3
***************
*** 29,33 ****
* @version $Id$
*/
! class ExtractArchiveAction extends JarSpyAction {
private final JarSpyGUI jarSpyGUI;
--- 29,34 ----
* @version $Id$
*/
! class ExtractArchiveAction extends JarSpyAction
! implements JarFileSelectionListener {
private final JarSpyGUI jarSpyGUI;
***************
*** 39,42 ****
--- 40,44 ----
jarSpyGUI = gui;
jarInspector = inspector;
+ jarSpyGUI.addJarFileSelectionListener(this);
}
***************
*** 64,67 ****
--- 66,73 ----
}
}
+ }
+
+ public void jarFileSelectionChanged(File jarFile) {
+ setEnabled(jarFile != null);
}
}
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** JarSpyGUI.java 17 Jul 2002 13:04:48 -0000 1.27
--- JarSpyGUI.java 17 Jul 2002 13:17:52 -0000 1.28
***************
*** 199,209 ****
void setFile(File file) throws IOException {
notifyFileSelectionListeners(null);
- Action extractAction =
- (Action) actions.get(ActionNames.EXTRACT_ARCHIVE_ACTION);
- Action viewManifestAction =
- (Action) actions.get(ActionNames.VIEW_MANIFEST_ACTION);
-
- extractAction.setEnabled(false);
- viewManifestAction.setEnabled(false);
setTitle("JarSpy");
--- 199,202 ----
***************
*** 211,216 ****
jarInspector.setFile(file);
refreshClassList();
! extractAction.setEnabled(true);
! viewManifestAction.setEnabled(true);
notifyFileSelectionListeners(file);
--- 204,208 ----
jarInspector.setFile(file);
refreshClassList();
!
notifyFileSelectionListeners(file);
|
|
From: Jeff B. <br...@us...> - 2002-07-17 13:04:52
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv2683/com/ociweb/jarspy/gui
Modified Files:
JarSpyGUI.java ViewManifestAction.java
Log Message:
modified view manifest action to be more consistent with other actions
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** JarSpyGUI.java 15 Jul 2002 22:54:49 -0000 1.26
--- JarSpyGUI.java 17 Jul 2002 13:04:48 -0000 1.27
***************
*** 134,138 ****
new ExtractArchiveAction(this, jarInspector));
actions.put(ActionNames.VIEW_MANIFEST_ACTION,
! new ViewManifestAction(this));
actions.put(ActionNames.ABOUT_ACTION,
new AboutAction(this));
--- 134,138 ----
new ExtractArchiveAction(this, jarInspector));
actions.put(ActionNames.VIEW_MANIFEST_ACTION,
! new ViewManifestAction(this, jarInspector));
actions.put(ActionNames.ABOUT_ACTION,
new AboutAction(this));
***************
*** 292,309 ****
(BorderFactory.createRaisedBevelBorder());
return classListPanel;
- }
-
- void viewManifest() {
- Manifest manifest = jarInspector.getManifest();
- if (manifest == null) {
- JOptionPane.showMessageDialog(this,
- "No Manifest Found.",
- "Not Found",
- JOptionPane.INFORMATION_MESSAGE);
- } else {
- ManifestDialog md = new ManifestDialog(this, manifest);
- md.setVisible(true);
- md.dispose();
- }
}
--- 292,295 ----
Index: ViewManifestAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/ViewManifestAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ViewManifestAction.java 19 Jun 2002 01:19:10 -0000 1.2
--- ViewManifestAction.java 17 Jul 2002 13:04:48 -0000 1.3
***************
*** 19,23 ****
--- 19,28 ----
package com.ociweb.jarspy.gui;
+ import com.ociweb.jarspy.JarInspector;
+
+ import javax.swing.JOptionPane;
import java.awt.event.ActionEvent;
+ import java.io.File;
+ import java.util.jar.Manifest;
/**
***************
*** 25,39 ****
* @version $Id$
*/
! class ViewManifestAction extends JarSpyAction {
private final JarSpyGUI jarSpyGUI;
! ViewManifestAction(JarSpyGUI gui) {
super(ActionNames.VIEW_MANIFEST_ACTION, "images/manifest.gif");
jarSpyGUI = gui;
}
public void actionPerformed(ActionEvent ae) {
! jarSpyGUI.viewManifest();
}
}
--- 30,65 ----
* @version $Id$
*/
! class ViewManifestAction extends JarSpyAction
! implements JarFileSelectionListener {
private final JarSpyGUI jarSpyGUI;
+ private JarInspector jarInspector;
! ViewManifestAction(JarSpyGUI gui,
! JarInspector jarInspector) {
super(ActionNames.VIEW_MANIFEST_ACTION, "images/manifest.gif");
+ this.jarInspector = jarInspector;
jarSpyGUI = gui;
+ setEnabled(false);
+ jarSpyGUI.addJarFileSelectionListener(this);
}
public void actionPerformed(ActionEvent ae) {
!
! Manifest manifest = jarInspector.getManifest();
! if (manifest == null) {
! JOptionPane.showMessageDialog(jarSpyGUI,
! "No Manifest Found.",
! "Not Found",
! JOptionPane.INFORMATION_MESSAGE);
! } else {
! ManifestDialog md = new ManifestDialog(jarSpyGUI, manifest);
! md.setVisible(true);
! md.dispose();
! }
! }
!
! public void jarFileSelectionChanged(File jarFile) {
! setEnabled(jarFile != null);
}
}
|
|
From: Jeff B. <br...@us...> - 2002-07-15 22:54:52
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv11640/com/ociweb/jarspy/gui
Modified Files:
AboutAction.java DecompileAction.java JarSpyGUI.java
ViewJarContentsAction.java
Log Message:
properly dispose modal dialogs so they may be
garbage collected
Index: AboutAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/AboutAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AboutAction.java 19 Jun 2002 01:19:10 -0000 1.2
--- AboutAction.java 15 Jul 2002 22:54:48 -0000 1.3
***************
*** 35,39 ****
public void actionPerformed(ActionEvent ae) {
! new AboutJarSpy(jarSpyGUI).setVisible(true);
}
}
--- 35,41 ----
public void actionPerformed(ActionEvent ae) {
! AboutJarSpy ajs = new AboutJarSpy(jarSpyGUI);
! ajs.setVisible(true);
! ajs.dispose();
}
}
Index: DecompileAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/DecompileAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DecompileAction.java 19 Jun 2002 01:19:10 -0000 1.2
--- DecompileAction.java 15 Jul 2002 22:54:48 -0000 1.3
***************
*** 22,26 ****
import com.ociweb.jarspy.JarInspector;
! import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
--- 22,27 ----
import com.ociweb.jarspy.JarInspector;
! import javax.swing.JList;
! import javax.swing.JOptionPane;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
***************
*** 66,78 ****
// new java.io.PrintWriter(System.out),
// null);
! new DecompileGUI(jarSpyGUI,
! className,
! pathToJarFile,
! jarInspector).setVisible(true);
} catch (Exception exc) {
JOptionPane.showMessageDialog(jarSpyGUI,
! "ERROR: " + exc.getMessage(),
! "Decompile Failed",
! JOptionPane.ERROR_MESSAGE);
}
}
--- 67,81 ----
// new java.io.PrintWriter(System.out),
// null);
! DecompileGUI dg = new DecompileGUI(jarSpyGUI,
! className,
! pathToJarFile,
! jarInspector);
! dg.setVisible(true);
! dg.dispose();
} catch (Exception exc) {
JOptionPane.showMessageDialog(jarSpyGUI,
! "ERROR: " + exc.getMessage(),
! "Decompile Failed",
! JOptionPane.ERROR_MESSAGE);
}
}
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** JarSpyGUI.java 15 Jul 2002 22:29:06 -0000 1.25
--- JarSpyGUI.java 15 Jul 2002 22:54:49 -0000 1.26
***************
*** 302,306 ****
JOptionPane.INFORMATION_MESSAGE);
} else {
! new ManifestDialog(this, manifest).setVisible(true);
}
}
--- 302,308 ----
JOptionPane.INFORMATION_MESSAGE);
} else {
! ManifestDialog md = new ManifestDialog(this, manifest);
! md.setVisible(true);
! md.dispose();
}
}
Index: ViewJarContentsAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/ViewJarContentsAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ViewJarContentsAction.java 13 Jun 2002 02:58:15 -0000 1.1
--- ViewJarContentsAction.java 15 Jul 2002 22:54:49 -0000 1.2
***************
*** 64,67 ****
--- 64,68 ----
dlg.pack();
dlg.setVisible(true);
+ dlg.dispose();
} catch (IOException exc) {
JOptionPane.showMessageDialog(null,
|
|
From: Jeff B. <br...@us...> - 2002-07-15 22:29:08
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv3379
Modified Files:
JarSpyGUI.java
Log Message:
remove code that was setting the list cell renderer
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** JarSpyGUI.java 15 Jul 2002 22:22:24 -0000 1.24
--- JarSpyGUI.java 15 Jul 2002 22:29:06 -0000 1.25
***************
*** 281,286 ****
private JComponent createClassListPanel() {
- classList.setCellRenderer(new ClassListCellRenderer());
-
JPanel classListPanel = new JPanel(new BorderLayout(0, 1));
--- 281,284 ----
|
|
From: Jeff B. <br...@us...> - 2002-07-15 22:22:28
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui
In directory usw-pr-cvs1:/tmp/cvs-serv1567/com/ociweb/jarspy/gui
Modified Files:
JarSpyGUI.java
Added Files:
JarSpyClassList.java
Removed Files:
ClassListCellRenderer.java
Log Message:
created JarSpyClassList to display jar contents properly
--- NEW FILE: JarSpyClassList.java ---
package com.ociweb.jarspy.gui;
import com.ociweb.jarspy.ClassInfo;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
import java.awt.Component;
import java.awt.Font;
/**
* JarSpyClassList is a JList specifically for displaying a list
* of classes in JarSpy
*/
public class JarSpyClassList extends JList {
/**
* This renderer delegates to another renderer. The other renderer
* is responsible for creating the render component. This wrapper
* modifies the font of the component generated by the real renderer
* to display interfaces in italic and classes in non italic.
*/
private class JarSpyListCellRenderer implements ListCellRenderer {
private final ListCellRenderer realRenderer;
JarSpyListCellRenderer(ListCellRenderer realRenderer) {
this.realRenderer = realRenderer;
}
public Component getListCellRendererComponent(
JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus) {
Component c =
realRenderer.getListCellRendererComponent(list,
value,
index,
isSelected,
cellHasFocus);
// this should always be true...
if (value instanceof ClassInfo) {
ClassInfo classInfo = (ClassInfo) value;
// if this is an interface, then use italics...
if (classInfo.isAnInterface()) {
Font font = c.getFont();
c.setFont(font.deriveFont(Font.ITALIC));
}
}
return c;
}
}
public void setCellRenderer(ListCellRenderer renderer) {
// wrap the real renderer in our renderer proxy class
// to enforce interfaces being displayed in italics...
super.setCellRenderer(new JarSpyListCellRenderer(renderer));
}
}
Index: JarSpyGUI.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/gui/JarSpyGUI.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** JarSpyGUI.java 20 Jun 2002 02:11:29 -0000 1.23
--- JarSpyGUI.java 15 Jul 2002 22:22:24 -0000 1.24
***************
*** 50,54 ****
private ClassDetailPanel classDetailPanel = new ClassDetailPanel();
private Map actions = new HashMap();
! private JList classList = new JList();
private List jarFileSelectionListeners = new ArrayList();
private JarSpyPreferences jarSpyPreferences = null;
--- 50,54 ----
private ClassDetailPanel classDetailPanel = new ClassDetailPanel();
private Map actions = new HashMap();
! private JList classList = new JarSpyClassList();
private List jarFileSelectionListeners = new ArrayList();
private JarSpyPreferences jarSpyPreferences = null;
--- ClassListCellRenderer.java DELETED ---
|
|
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 ----
|
|
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) {
+ }
+ }
+
}
|