org.jcreme.swing
Interface CompletionModel

All Known Implementing Classes:
DefaultCompletionModel

public interface CompletionModel

This interface describes the method available to handle a completion task. The completion is based on a completion pattern (a suffix and a prefix) that will be matched to the possible completions. The completion works on any object provided they can be transformed into Strings using a Format class (Files for instance).

Version:
$Revision: 1.2 $
Author:
$Author: dbregeon $

Field Summary
static java.lang.String COMPLETION_LIST_ELEMENT_FORMAT_PROPERTY
          The property name for the completionListElementFormat.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          This method ensures that the implementations of this interface provide bean services.
 java.text.Format getCompletionListElementFormat()
          This method gives access to the Format implementation that enables to perform the completion on objects.
 java.lang.String getCompletionPrefix()
          Gives access to the current prefix of the completion pattern.
 java.util.Collection getCompletions(java.lang.String seed)
          Enables to access a list of possible completions for a given String.
 java.lang.String getCompletionSuffix()
          Gives access to the current suffix of the completion pattern.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          This method ensures that the implementations of this interface provide bean services.
 void setCompletionList(java.util.Collection c)
          This method enables to set the collection of values from which to look for a completion.
 void setCompletionListElementFormat(java.text.Format f)
          This method enables to change the Format implementation that will be used to transform non String objects into Strings to perform the completion.
 void setCompletionPrefix(java.lang.String prefix)
          Enables to change the pattern that will be matched in front of the text to complete.
 void setCompletionSuffix(java.lang.String suffix)
          Enables to change the pattern that will be matched in after the text to complete.
 

Field Detail

COMPLETION_LIST_ELEMENT_FORMAT_PROPERTY

public static final java.lang.String COMPLETION_LIST_ELEMENT_FORMAT_PROPERTY
The property name for the completionListElementFormat.

See Also:
Constant Field Values
Method Detail

setCompletionPrefix

public void setCompletionPrefix(java.lang.String prefix)
Enables to change the pattern that will be matched in front of the text to complete.

Parameters:
prefix - a pattern using % and ? as wildcards in the usual SQL manner.

getCompletionPrefix

public java.lang.String getCompletionPrefix()
Gives access to the current prefix of the completion pattern.

Returns:
the current prefix used.

setCompletionSuffix

public void setCompletionSuffix(java.lang.String suffix)
Enables to change the pattern that will be matched in after the text to complete.

Parameters:
suffix - a pattern using % and ? as wildcards in the usual SQL manner.

getCompletionSuffix

public java.lang.String getCompletionSuffix()
Gives access to the current suffix of the completion pattern.

Returns:
the current suffix used.

setCompletionList

public void setCompletionList(java.util.Collection c)
This method enables to set the collection of values from which to look for a completion. The collection can contain Objects of different types (not necessarily Strings) as long as the completionListElementFormat can handle them.

Parameters:
c - the collection from which a completion has to be found.

setCompletionListElementFormat

public void setCompletionListElementFormat(java.text.Format f)
This method enables to change the Format implementation that will be used to transform non String objects into Strings to perform the completion.

Parameters:
f - a Format implementation.

getCompletionListElementFormat

public java.text.Format getCompletionListElementFormat()
This method gives access to the Format implementation that enables to perform the completion on objects.

Returns:
the Format implementation currently in use.

getCompletions

public java.util.Collection getCompletions(java.lang.String seed)
Enables to access a list of possible completions for a given String.

Parameters:
seed - the String to complete in the completionList.
Returns:
a Collection of possible completions.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
This method ensures that the implementations of this interface provide bean services.

Parameters:
l - a listener.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
This method ensures that the implementations of this interface provide bean services.

Parameters:
l - a listener.


Copyright 2006 null. All Rights Reserved.