Index: apichanges.xml =================================================================== RCS file: /cvs/java/source/apichanges.xml,v retrieving revision 1.5.2.1 retrieving revision 1.5 diff -u -r1.5.2.1 -r1.5 --- apichanges.xml 5 Apr 2007 09:27:08 -0000 1.5.2.1 +++ apichanges.xml 26 Mar 2007 20:55:43 -0000 1.5 @@ -82,22 +82,7 @@ - - - - Added a listener for listening on changes in the ClassIndex. - - - - - - The listener for listening on changes in the ClassIndex was added. The listener fires - events when a declared type was removed, added, changed in the ClassIndex oe when the underlaying - ClassPath was changed. - - - - + Adding template attribute package Index: nbproject/project.properties =================================================================== RCS file: /cvs/java/source/nbproject/project.properties,v retrieving revision 1.13.2.1 retrieving revision 1.13 diff -u -r1.13.2.1 -r1.13 --- nbproject/project.properties 5 Apr 2007 09:27:09 -0000 1.13.2.1 +++ nbproject/project.properties 26 Mar 2007 20:55:44 -0000 1.13 @@ -23,5 +23,5 @@ javadoc.title=Java Source javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=0.8.0 +spec.version.base=0.7.0 test.unit.run.cp.extra=${core.dir}/core/core.jar:${core.dir}/lib/boot.jar:../../junit/external/insanelib.jar Index: src/org/netbeans/api/java/source/ClassIndex.java =================================================================== RCS file: /cvs/java/source/src/org/netbeans/api/java/source/ClassIndex.java,v retrieving revision 1.4.24.5 retrieving revision 1.4 diff -u -r1.4.24.5 -r1.4 --- src/org/netbeans/api/java/source/ClassIndex.java 5 Apr 2007 09:27:10 -0000 1.4.24.5 +++ src/org/netbeans/api/java/source/ClassIndex.java 10 Nov 2006 12:17:34 -0000 1.4 @@ -168,36 +158,6 @@ this.bootPath = bootPath; this.classPath = classPath; this.sourcePath = sourcePath; - final ClassIndexManager manager = ClassIndexManager.getDefault(); - manager.addClassIndexManagerListener(WeakListeners.create(ClassIndexManagerListener.class, (ClassIndexManagerListener) this.spiListener, manager)); - this.sourceIndeces = new HashSet(); - this.oldSources = new HashSet(); - createQueriesForRoots (this.sourcePath, true, this.sourceIndeces, oldSources); - this.depsIndeces = new HashSet(); - this.oldDeps = new HashSet(); - createQueriesForRoots (this.bootPath, false, this.depsIndeces, oldDeps); - createQueriesForRoots (this.classPath, false, this.depsIndeces, oldDeps); - } - - - /** - * Adds an {@link ClassIndexListener}. The listener is notified about the - * changes of declared types in this {@link ClassIndex} - * @param listener to be added - */ - public void addClassIndexListener (final ClassIndexListener listener) { - assert listener != null; - listeners.add (listener); - } - - /** - * Removes an {@link ClassIndexListener}. The listener is notified about the - * changes of declared types in this {@link ClassIndex} - * @param listener to be removed - */ - public void removeClassIndexListener (final ClassIndexListener listener) { - assert listener != null; - listeners.remove(listener); } Index: src/org/netbeans/api/java/source/ClassIndexListener.java =================================================================== RCS file: src/org/netbeans/api/java/source/ClassIndexListener.java diff -N src/org/netbeans/api/java/source/ClassIndexListener.java --- src/org/netbeans/api/java/source/ClassIndexListener.java 4 Apr 2007 13:11:08 -0000 1.1.2.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,72 +0,0 @@ -/* - * The contents of this file are subject to the terms of the Common Development - * and Distribution License (the License). You may not use this file except in - * compliance with the License. - * - * You can obtain a copy of the License at http://www.netbeans.org/cddl.html - * or http://www.netbeans.org/cddl.txt. - * - * When distributing Covered Code, include this CDDL Header Notice in each file - * and include the License file at http://www.netbeans.org/cddl.txt. - * If applicable, add the following below the CDDL Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.netbeans.api.java.source; - -import java.util.EventListener; - -/** - * Listener for changes in {@link ClassIndex}. -*

-* When attached to a {ClassIndex} it listens for addition, -* removal and modification of declared types. -*

-* -* @see ClassIndex#addClassIndexListener - * @author Tomas Zezula - */ -public interface ClassIndexListener extends EventListener { - - /** - * Called when the new declared types are added - * into the {@link ClassIndex} - * @param event specifying the added types - */ - public void typesAdded (TypesEvent event); - - /** - * Called when declared types are removed - * from the {@link ClassIndex} - * @param event specifying the removed types - */ - public void typesRemoved (TypesEvent event); - - /** - * Called when some declared types are changed. - * @param event specifying the changed types - */ - public void typesChanged (TypesEvent event); - - /** - * Called when new roots are added - * into the {@link ClassPath} for which the {@link ClassIndex} - * was created. - * @param event specifying the added roots - */ - public void rootsAdded (RootsEvent event); - - /** - * Called when root are removed - * from the {@link ClassPath} for which the {@link ClassIndex} - * was created. - * @param event specifying the removed roots - */ - public void rootsRemoved (RootsEvent event); - -} Index: src/org/netbeans/api/java/source/RootsEvent.java =================================================================== RCS file: src/org/netbeans/api/java/source/RootsEvent.java diff -N src/org/netbeans/api/java/source/RootsEvent.java --- src/org/netbeans/api/java/source/RootsEvent.java 27 Mar 2007 13:24:57 -0000 1.1.2.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,55 +0,0 @@ -/* - * The contents of this file are subject to the terms of the Common Development - * and Distribution License (the License). You may not use this file except in - * compliance with the License. - * - * You can obtain a copy of the License at http://www.netbeans.org/cddl.html - * or http://www.netbeans.org/cddl.txt. - * - * When distributing Covered Code, include this CDDL Header Notice in each file - * and include the License file at http://www.netbeans.org/cddl.txt. - * If applicable, add the following below the CDDL Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.netbeans.api.java.source; - -import java.net.URL; -import java.util.EventObject; -import org.netbeans.api.java.classpath.ClassPath; - -/** - * Event used to notify the {@link ClassIndexListener} about - * a change in the underlying {@link ClassPath} - * @author Tomas Zezula - */ -public final class RootsEvent extends EventObject { - - private final Iterable roots; - - - RootsEvent(final Object source, final Iterable roots) { - super (source); - assert roots != null; - this.roots = roots; - } - - /** - * Returns the affected declared {@link ClassPath} roots. - * @return an {@link Iterable} of {@link URL} - */ - public Iterable getRoots () { - return this.roots; - } - - @Override - public String toString () { - return String.format ("RootsEvent [%s]",this.roots.toString()); - } - -} Index: src/org/netbeans/api/java/source/TypesEvent.java =================================================================== RCS file: src/org/netbeans/api/java/source/TypesEvent.java diff -N src/org/netbeans/api/java/source/TypesEvent.java --- src/org/netbeans/api/java/source/TypesEvent.java 27 Mar 2007 13:24:57 -0000 1.1.2.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,54 +0,0 @@ -/* - * The contents of this file are subject to the terms of the Common Development - * and Distribution License (the License). You may not use this file except in - * compliance with the License. - * - * You can obtain a copy of the License at http://www.netbeans.org/cddl.html - * or http://www.netbeans.org/cddl.txt. - * - * When distributing Covered Code, include this CDDL Header Notice in each file - * and include the License file at http://www.netbeans.org/cddl.txt. - * If applicable, add the following below the CDDL Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun - * Microsystems, Inc. All Rights Reserved. - */ - -package org.netbeans.api.java.source; - -import java.util.EventObject; -import javax.lang.model.element.TypeElement; -import org.netbeans.api.java.source.ElementHandle; - -/** - * Event used to notify the {@link ClassIndexListener} about - * a change of declared types in the {@link ClassIndex} - * @author Tomas Zezula - */ -public final class TypesEvent extends EventObject { - - private final Iterable> types; - - TypesEvent (final Object source, final Iterable> types) { - super (source); - assert types != null; - this.types = types; - } - - /** - * Returns the affected declared types. - * @return an {@link Iterable} of {@link TypeElement} handles - */ - public Iterable> getTypes () { - return this.types; - } - - @Override - public String toString () { - return String.format("TypesEvent [%s]", this.types.toString()); - } - -}