View Javadoc

1   /*
2    * $Id: INamespaceSuggester.java,v 1.6 2005/05/31 19:37:20 jlerner Exp $
3    *
4    * Copyright (c) 1999-2004, BBN Technologies, LLC.
5    * All rights reserved.
6    * http://www.daml.org/legal/opensource/bbn_license.html
7    */
8    
9   package com.bbn.swede.editor.contentassist;
10  
11  import java.util.List;
12  
13  /***
14   *  An interface for creating specialized autocompletion behaviour.
15   * 
16   *  @author aperezlo
17   */
18  public interface INamespaceSuggester
19  {
20     /***
21      * Performs initialization functions like resource allocation, 
22      * initial population, and OAST registration.
23      */
24     void init();
25     /***
26      * Performs cleanup activities - free up resources, unregister 
27      * with the OAST, etc.
28      */
29     void cleanup();
30     /***
31      * Given a representation of what has already been typed, check to see
32      * which classes and properties of this namespace are valid autocompletion
33      * suggestions. 
34      * 
35      * @param alreadyTyped what has already been typed by the user (with any namespaces removed) 
36      * @return a list of ISuggestionCandidate objects representing possible completions, or an empty list if none exist
37      * @see com.bbn.swede.editor.contentassist.ISuggestionCandidate
38      */
39     List getSuggestions(String alreadyTyped);
40     /***
41      * Given a representation of what has already been typed, check to see
42      * which named instances (i.e not classes or properties, and nothing anonymous)
43      * of this namespace are valid autocompletion suggestions. 
44      * 
45      * @param alreadyTyped what has already been typed by the user (with any namespaces removed)
46      * @return a list of ISuggestionCandidate objects representing possible completions, or an empty list if none exist
47      * @see com.bbn.swede.editor.contentassist.ISuggestionCandidate
48      */
49     List getInstanceSuggestions(String alreadyTyped);
50     /***
51      * Indicates whether the suggestor has any completion proposals for the text
52      * typed so far. 
53      * @param alreadyTyped what has already been typed by the user (with any namespaces removed)
54      * @return true if this suggester has suggestions, false otherwise
55      */
56     boolean hasSuggestions(String alreadyTyped);
57  }