1 /***
2 Copyright (C) 2005 The Java Community
3
4 This program is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free Software
6 Foundation; either version 2 of the License, or (at your option) any later
7 version.
8
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 Place, Suite 330, Boston, MA 02111-1307 USA.
16 */
17 package org.bejug.javacareers.common.ajax;
18
19 import javax.faces.context.FacesContext;
20
21 /***
22 * Interface implemented by classes which can provide completion results
23 * for a given prefix.
24 *
25 * @author Tor Norbye (Last modified by $Author: shally $)
26 * $Revision: 1.3 $ - $Date: 2005/12/08 14:53:45 $
27 */
28 public interface Completable {
29
30 /***
31 * This method is called asynchronously from client javascript calls;
32 * it should return a short list of possible matches for the given prefix
33 * as an array of Strings. These are returned by adding them to the
34 * result object. These items will then be presented to the user in
35 * an auto complete popup.
36 *
37 * @param context The faces context for the JSF application
38 * @param prefix A string prefix to select matches from (note that the
39 * prefix may be empty in which case it may be natural to
40 * return the first N matches.
41 * @param result A result object; call {@link CompletionResult#addItem(String)}
42 * to populate the completion result returned to the browser.
43 */
44 void complete(FacesContext context,
45 String prefix,
46 CompletionResult result);
47 }
48 /***
49 * $Log: Completable.java,v $
50 * Revision 1.3 2005/12/08 14:53:45 shally
51 * Opkuis voor checkstyle.
52 *
53 * Revision 1.2 2005/10/11 09:13:55 stephan_janssen
54 * Removed public modifier.
55 *
56 * Revision 1.1 2005/07/13 11:16:53 bavo_jcs
57 * Moved Ajax files
58 *
59 * Revision 1.1 2005/07/06 14:15:30 bavo_jcs
60 * Ajax integration
61 *
62 */