KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > loaders > FolderListListener


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.openide.loaders;
21
22 /** Listener that watches progress of recognizing objects
23 * in a folder. The listener may even influence the data object recognition
24 * and, in such a way, act as a filter.
25 *
26 * <p>Normally the methods of this class are called in the process of a task
27 * to collect the data objects within a folder, e.g. in
28 * {@link FolderList#computeChildrenList(FolderListListener)}. In such a task
29 * implementations of {@link #process(DataObject, java.util.List)} may act as
30 * filters by not added the data object to the result list. Implementations
31 * of {@link #finished(java.util.List)} may be used to inform the caller about
32 * the result of the task and for further processing of the result. E.g.
33 * {@link FolderList#computeChildrenList(FolderListListener)} has as its return
34 * value the task to compute the list and not the computed children. An
35 * implementation of {@link #finished(java.util.List)} may be used by the caller
36 * of {@link FolderList#computeChildrenList(FolderListListener)} to get informed
37 * about the result of children computation.</p>
38 *
39 * @author Jaroslav Tulach
40 */

41 interface FolderListListener {
42     /** Another object has been recognized.
43     * @param obj the object recognized
44     * @param arr array where the implementation should add the
45     * object
46     */

47     public void process (DataObject obj, java.util.List JavaDoc<DataObject> arr);
48
49     /** All objects has been recognized.
50     * @param arr list of DataObjects
51     */

52     public void finished (java.util.List JavaDoc<DataObject> arr);
53 }
54
Popular Tags