[Jarspy-commits] CVS: JarSpy/src/com/ociweb/jarspy JarInspectorListener.java,NONE,1.1 JarInspector.j
Status: Beta
Brought to you by:
brown_j
|
From: Jeff B. <br...@us...> - 2002-07-20 18:12:27
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy
In directory usw-pr-cvs1:/tmp/cvs-serv12138/src/com/ociweb/jarspy
Modified Files:
JarInspector.java
Added Files:
JarInspectorListener.java
Log Message:
added new tree view option
--- NEW FILE: JarInspectorListener.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;
/**
* JarInspectorListeners are notified any time the contents of a JarInspector
* are updated
*
* @version $Id: JarInspectorListener.java,v 1.1 2002/07/20 18:12:23 brown_j Exp $
*/
public interface JarInspectorListener {
/**
* Notify listener that a JarInspector has been updated
* @param inspector the JarInspector which has been updated
*/
public void jarInspectorUpdated(JarInspector inspector);
}
Index: JarInspector.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/JarInspector.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** JarInspector.java 19 Jul 2002 00:22:55 -0000 1.8
--- JarInspector.java 20 Jul 2002 18:12:23 -0000 1.9
***************
*** 26,29 ****
--- 26,31 ----
import java.util.Set;
import java.util.TreeSet;
+ import java.util.Vector;
+ import java.util.Iterator;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
***************
*** 41,44 ****
--- 43,47 ----
private Set classSet = new TreeSet();
private JarProcessingListener processingListener;
+ private Vector jarInspectorListeners = new Vector();
private void closeJar() {
***************
*** 63,66 ****
--- 66,83 ----
}
+ private synchronized void notifyJarInspectorListeners() {
+ Iterator iter = jarInspectorListeners.iterator();
+ while (iter.hasNext()) {
+ JarInspectorListener listener = (JarInspectorListener) iter.next();
+ listener.jarInspectorUpdated(this);
+ }
+ }
+
+ public synchronized void addJarInspectorListener(JarInspectorListener l) {
+ if(!jarInspectorListeners.contains(l)) {
+ jarInspectorListeners.add(l);
+ }
+ }
+
/**
* Register a processing listener. Right now, only one listener may
***************
*** 97,100 ****
--- 114,118 ----
processingListener.finishedProcessingJar();
}
+ notifyJarInspectorListeners();
}
|