org.gnu.gtk
Class EntryCompletion

java.lang.Object
  extended byorg.gnu.glib.GObject
      extended byorg.gnu.gtk.EntryCompletion

public class EntryCompletion
extends GObject

EntryCompletion is an auxiliary object to be used in conjunction with Entry to provide the completion functionality. To add completion functionality to an Entry, use setCompletion(). In addition to regular completion matches, which will be inserted into the entry when they are selected, EntryCompletion also allows to display "actions" in the popup window. Their appearance is similar to menuitems, to differentiate them clearly from completion strings. When an action is selected, the ::action-activated signal is emitted.


Field Summary
 
Fields inherited from class org.gnu.glib.GObject
eventsInitialized
 
Constructor Summary
EntryCompletion()
          Creates a new EntryCompletion object.
EntryCompletion(Handle nativeHandle)
           
 
Method Summary
 void addListener(EntryCompletionListener listener)
          Register an object to handle dialog events.
 void complete()
          Requests a completion operation, or in other words a refiltering of the current list with completions, using the current key.
 void deleteAction(int index)
          Remove an action for the EntryCompletions action list.
protected  int findListener(java.util.Vector list, java.lang.Object listener)
          Give us a way to locate a specific listener in a Vector.
protected  void fireEntrySelectionEvent(EntryCompletionEvent event)
           
 Entry getEntry()
          Returns the Entry this completion is attached to.
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 EventType getEventType(java.lang.String signal)
           
 boolean getInlineCompletion()
          Returns whether the common prefix of the possible completion should be automatically inserted into the entry.
 int getMinimumKeyLength()
          Returns the minimum key length as set for completion.
 TreeModel getModel()
          Returns the model that the EntryCompletion is using as a data source.
 boolean getPopupCompletion()
          Returns whether the completion should be presented in a popup window.
 int getTextColumn()
          Returns the column in the model of completion to get strings from.
protected static void gtk_entry_completion_complete(Handle completion)
           
protected static void gtk_entry_completion_delete_action(Handle completion, int index)
           
protected static Handle gtk_entry_completion_get_entry(Handle completion)
           
protected static boolean gtk_entry_completion_get_inline_completion(Handle completion)
           
protected static int gtk_entry_completion_get_minimum_key_length(Handle completion)
           
protected static Handle gtk_entry_completion_get_model(Handle completion)
           
protected static boolean gtk_entry_completion_get_popup_completion(Handle completion)
           
protected static int gtk_entry_completion_get_text_column(Handle completion)
           
protected static int gtk_entry_completion_get_type()
           
protected static void gtk_entry_completion_insert_action_markup(Handle completion, int index, java.lang.String markup)
           
protected static void gtk_entry_completion_insert_action_text(Handle completion, int index, java.lang.String text)
           
protected static void gtk_entry_completion_insert_prefix(Handle completion)
           
protected static Handle gtk_entry_completion_new()
           
protected static void gtk_entry_completion_set_inline_completion(Handle completion, boolean inline)
           
protected static void gtk_entry_completion_set_minimum_key_length(Handle completion, int length)
           
protected static void gtk_entry_completion_set_model(Handle completion, Handle model)
           
protected static void gtk_entry_completion_set_popup_completion(Handle completion, boolean popup)
           
protected static void gtk_entry_completion_set_text_column(Handle completion, int column)
           
 void insertActionMarkup(int index, java.lang.String markup)
          Inserts an action in the EntryCompletion's action list with the position and text provided.
 void insertActionText(int index, java.lang.String text)
          Inserts an action in the EntryCompletion's action list with the position and text provided.
 void insertPrefix()
          Request a prefix insertion.
 void removeListener(EntryCompletionListener listener)
          Removes a listener
 void setInlineCompletion(boolean inlineCompletion)
          Sets whether the common prefix of the possible completion should be automatically inserted into the entry.
 void setMinimumKeyLength(int length)
          Requires the length of the search key for the EntryCompletion to be at least length.
 void setModel(TreeModel model)
          Sets the model for this EntryCompletion.
 void setPopupCompletion(boolean popupCompletion)
          Sets whether the completion should be presented in a popup window.
 void setTextColumn(int column)
          Specify which column in the model to use to display the strings.
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, equals, freezeNotify, getBooleanProperty, getData, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getHandle, getIntFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getNullHandle, getPixbufProperty, getProperty, getStringFromHandle, getStringProperty, hashCode, hasProperty, instantiateJGObjectFromGType, notify, removeEventHandler, removeListener, retrieveGObject, setBooleanProperty, setData, setData, setDoubleProperty, setFloatProperty, setHandle, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntryCompletion

public EntryCompletion()
Creates a new EntryCompletion object.


EntryCompletion

public EntryCompletion(Handle nativeHandle)
Method Detail

getEntry

public Entry getEntry()
Returns the Entry this completion is attached to.


setModel

public void setModel(TreeModel model)
Sets the model for this EntryCompletion. If there is already a model set it will remove it before setting the new mode.

Parameters:
model -

getModel

public TreeModel getModel()
Returns the model that the EntryCompletion is using as a data source.


setMinimumKeyLength

public void setMinimumKeyLength(int length)
Requires the length of the search key for the EntryCompletion to be at least length. This is useful for long lists where completing using a small key takes a lot of time and will come up with meaningless results.

Parameters:
length -

getMinimumKeyLength

public int getMinimumKeyLength()
Returns the minimum key length as set for completion.


complete

public void complete()
Requests a completion operation, or in other words a refiltering of the current list with completions, using the current key.


insertPrefix

public void insertPrefix()
Request a prefix insertion.


insertActionText

public void insertActionText(int index,
                             java.lang.String text)
Inserts an action in the EntryCompletion's action list with the position and text provided. If this item is selected an event will be triggered of type ACTION_ACTIVATED. You can get the index value from the EntryCompletionEvent object.

Parameters:
index -
text -

insertActionMarkup

public void insertActionMarkup(int index,
                               java.lang.String markup)
Inserts an action in the EntryCompletion's action list with the position and text provided. If this item is selected an event will be triggered of type ACTION_ACTIVATED. You can get the index value from the EntryCompletionEvent object.

Parameters:
index -
markup -

deleteAction

public void deleteAction(int index)
Remove an action for the EntryCompletions action list.

Parameters:
index -

setInlineCompletion

public void setInlineCompletion(boolean inlineCompletion)
Sets whether the common prefix of the possible completion should be automatically inserted into the entry.

Parameters:
inlineCompletion -

getInlineCompletion

public boolean getInlineCompletion()
Returns whether the common prefix of the possible completion should be automatically inserted into the entry.


setPopupCompletion

public void setPopupCompletion(boolean popupCompletion)
Sets whether the completion should be presented in a popup window.

Parameters:
popupCompletion -

getPopupCompletion

public boolean getPopupCompletion()
Returns whether the completion should be presented in a popup window.


setTextColumn

public void setTextColumn(int column)
Specify which column in the model to use to display the strings.

Parameters:
column -

getTextColumn

public int getTextColumn()
Returns the column in the model of completion to get strings from.


addListener

public void addListener(EntryCompletionListener listener)
Register an object to handle dialog events.

See Also:
EntryCompletionListener

removeListener

public void removeListener(EntryCompletionListener listener)
Removes a listener

See Also:
addListener(EntryCompletionListener)

fireEntrySelectionEvent

protected void fireEntrySelectionEvent(EntryCompletionEvent event)

getEventListenerClass

public java.lang.Class getEventListenerClass(java.lang.String signal)
Overrides:
getEventListenerClass in class GObject

getEventType

public EventType getEventType(java.lang.String signal)
Overrides:
getEventType in class GObject

findListener

protected int findListener(java.util.Vector list,
                           java.lang.Object listener)
Give us a way to locate a specific listener in a Vector.

Parameters:
list - The Vector of listeners to search.
listener - The object that is to be located in the Vector.
Returns:
Returns the index of the listener in the Vector, or -1 if the listener is not contained in the Vector.

gtk_entry_completion_get_type

protected static final int gtk_entry_completion_get_type()

gtk_entry_completion_new

protected static final Handle gtk_entry_completion_new()

gtk_entry_completion_get_entry

protected static final Handle gtk_entry_completion_get_entry(Handle completion)

gtk_entry_completion_set_model

protected static final void gtk_entry_completion_set_model(Handle completion,
                                                           Handle model)

gtk_entry_completion_get_model

protected static final Handle gtk_entry_completion_get_model(Handle completion)

gtk_entry_completion_set_minimum_key_length

protected static final void gtk_entry_completion_set_minimum_key_length(Handle completion,
                                                                        int length)

gtk_entry_completion_get_minimum_key_length

protected static final int gtk_entry_completion_get_minimum_key_length(Handle completion)

gtk_entry_completion_complete

protected static final void gtk_entry_completion_complete(Handle completion)

gtk_entry_completion_insert_prefix

protected static final void gtk_entry_completion_insert_prefix(Handle completion)

gtk_entry_completion_insert_action_text

protected static final void gtk_entry_completion_insert_action_text(Handle completion,
                                                                    int index,
                                                                    java.lang.String text)

gtk_entry_completion_insert_action_markup

protected static final void gtk_entry_completion_insert_action_markup(Handle completion,
                                                                      int index,
                                                                      java.lang.String markup)

gtk_entry_completion_delete_action

protected static final void gtk_entry_completion_delete_action(Handle completion,
                                                               int index)

gtk_entry_completion_set_inline_completion

protected static final void gtk_entry_completion_set_inline_completion(Handle completion,
                                                                       boolean inline)

gtk_entry_completion_get_inline_completion

protected static final boolean gtk_entry_completion_get_inline_completion(Handle completion)

gtk_entry_completion_set_popup_completion

protected static final void gtk_entry_completion_set_popup_completion(Handle completion,
                                                                      boolean popup)

gtk_entry_completion_get_popup_completion

protected static final boolean gtk_entry_completion_get_popup_completion(Handle completion)

gtk_entry_completion_set_text_column

protected static final void gtk_entry_completion_set_text_column(Handle completion,
                                                                 int column)

gtk_entry_completion_get_text_column

protected static final int gtk_entry_completion_get_text_column(Handle completion)