[Jarspy-commits] CVS: JarSpy/src/com/ociweb/jarspy/gui JarSpyGUI.java,1.26,1.27 ViewManifestAction.j
Status: Beta
Brought to you by:
brown_j
|
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);
}
}
|