|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.editor.ext.java; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.TreeSet; import org.netbeans.editor.SettingsUtil; import org.netbeans.editor.ext.ExtSettingsDefaults; import org.netbeans.editor.ext.ExtSettingsNames; /** Compound finder works over more finders and merge the search results. * * * @author Martin Roskanin, David Konecny * @since 10/2002 */ public class CompoundFinder implements JCFinder { private List finders; /** Kit class from which for which the settings like case sensitivity etc. will be read */ private Class kitClass; private static JCField artificialField = new JavaCompletion.BaseField( JavaCompletion.CLASS_CLASS, "class", JavaCompletion.CLASS_TYPE, Modifier.PUBLIC); // NOI18N /** Creates a new instance of CompoundFinder * * @param finders the List of the finders from which search results will be merged * @param kitClass kit class to which this finder is associated and for which * the settings will be read */ public CompoundFinder(List finders, Class kitClass) { this.finders = finders; this.kitClass = kitClass; Iterator it = finders.iterator(); while (it.hasNext()) { Object o = it.next(); if (o instanceof JCBaseFinder) { ((JCBaseFinder)o).setParentFinder(this); } else { //System.out.println("TODO CompoundFinder ");//assert false : "This should never happen"; // NOI18N } } } /** Find classes by name and possibly in some package. * The search results result will be merged from all finders appended to the compound finder. * @param pkg package where the classes should be searched for. It can be null * @param begining of the name of the class. The package name must be omitted. * @param exactMatch whether the given name is the exact requested name * of the class or not. * @return list of the matching classes * */ public List findClasses(JCPackage pkg, String name, boolean exactMatch) { List ret = new ArrayList(); for (int i = 0; i |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.