com.bbn.swede.editor.contentassist
Class RDFSNamespaceSuggester

java.lang.Object
  extended bycom.bbn.swede.editor.contentassist.DefaultNamespaceSuggester
      extended bycom.bbn.swede.editor.contentassist.RDFSNamespaceSuggester
All Implemented Interfaces:
INamespaceSuggester, IOASTChangeListener

public class RDFSNamespaceSuggester
extends DefaultNamespaceSuggester

Subclass of DefaultNamespaceSuggester preloaded with all of the classes and properties of the RDFS namespace.

Author:
aperezlo

Field Summary
protected  List _elements
          _elements represents a listing of all of the classes and properties in the OAST _tree.
protected  List _instances
          _instances is a list of all the instance data in a particular URI.
protected  IOWLAbstractSyntaxTree _tree
          _tree a reference to the OAST which maintains the internal representation of the URI for this suggester.
protected  String _uri
          _uri- the URI for which this suggester will make suggestions.
 
Constructor Summary
RDFSNamespaceSuggester()
          Default constructor.
 
Method Summary
 void cleanup()
          Unregisters the suggester from its OAST and performs other housekeeping type chores to ready itself for deletion.
 List getInstanceSuggestions(String alreadyTyped)
          Returns those instances in this suggester's namespace which start with what the user has already typed.
 List getSuggestions(String alreadyTyped)
          Returns those classes and properties from the suggester's namespace that start with what has already been typed.
 String getURI()
          Retrieves the URI of this suggester.
 boolean hasSuggestions(String alreadyTyped)
          Indicates whether the suggestor has any completion proposals for the text typed so far.
 void init()
          As per the INamespaceSuggester interface, this method can be called to populate the suggester with classes and properties from which it will make suggestions.
 void oastChanged(OASTEvent event)
          As per the IOASTChangeListener interface, this method is used to update the listing in the suggester of classes and properties.
protected  void synch(boolean checkForRemovedOrReplaced)
          Synchronize the internal state of the suggester with that of its OAST.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_elements

protected List _elements
_elements represents a listing of all of the classes and properties in the OAST _tree.


_tree

protected IOWLAbstractSyntaxTree _tree
_tree a reference to the OAST which maintains the internal representation of the URI for this suggester. The suggester handles OASTChangeEvents to stay current.


_uri

protected String _uri
_uri- the URI for which this suggester will make suggestions.


_instances

protected List _instances
_instances is a list of all the instance data in a particular URI.

Constructor Detail

RDFSNamespaceSuggester

public RDFSNamespaceSuggester()
Default constructor.

Method Detail

hasSuggestions

public boolean hasSuggestions(String alreadyTyped)
Indicates whether the suggestor has any completion proposals for the text typed so far. This implementation always returns true.

Specified by:
hasSuggestions in interface INamespaceSuggester
Overrides:
hasSuggestions in class DefaultNamespaceSuggester
Parameters:
alreadyTyped - what has already been typed by the user (with any namespaces removed)
Returns:
true
See Also:
INamespaceSuggester.hasSuggestions(java.lang.String)

getInstanceSuggestions

public List getInstanceSuggestions(String alreadyTyped)
Returns those instances in this suggester's namespace which start with what the user has already typed.

Specified by:
getInstanceSuggestions in interface INamespaceSuggester
Parameters:
alreadyTyped - The text that has been typed so far
Returns:
a list of ISuggestionCandidate objects representing instance objects
See Also:
INamespaceSuggester.getInstanceSuggestions(java.lang.String)

oastChanged

public void oastChanged(OASTEvent event)
As per the IOASTChangeListener interface, this method is used to update the listing in the suggester of classes and properties.

Specified by:
oastChanged in interface IOASTChangeListener
Parameters:
event - Describes the change that was just made to the OAST.
See Also:
IOASTChangeListener.oastChanged(com.bbn.swede.core.dom.OASTEvent)

synch

protected void synch(boolean checkForRemovedOrReplaced)
Synchronize the internal state of the suggester with that of its OAST.

Parameters:
checkForRemovedOrReplaced - true to check for changes in the OAST, false if not.

cleanup

public void cleanup()
Unregisters the suggester from its OAST and performs other housekeeping type chores to ready itself for deletion.

Specified by:
cleanup in interface INamespaceSuggester

getURI

public String getURI()
Retrieves the URI of this suggester.

Returns:
the URI for which this suggester makes suggestions

init

public void init()
As per the INamespaceSuggester interface, this method can be called to populate the suggester with classes and properties from which it will make suggestions.

Specified by:
init in interface INamespaceSuggester
See Also:
INamespaceSuggester.init()

getSuggestions

public List getSuggestions(String alreadyTyped)
Returns those classes and properties from the suggester's namespace that start with what has already been typed.

Specified by:
getSuggestions in interface INamespaceSuggester
Parameters:
alreadyTyped - the text that precedes the present cursor position
Returns:
a List of ISuggestionCandidate objects representing strings that should be suggested
See Also:
ISuggestionCandidate


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.