org.gnu.gtk

Class 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.
Constructor Summary
EntryCompletion()
Creates a new EntryCompletion object.
EntryCompletion(Handle nativeHandle)
Method Summary
voidaddListener(EntryCompletionListener listener)
Register an object to handle dialog events.
voidcomplete()
Requests a completion operation, or in other words a refiltering of the current list with completions, using the current key.
voiddeleteAction(int index)
Remove an action for the EntryCompletions action list.
EntrygetEntry()
Returns the Entry this completion is attached to.
static EntryCompletiongetEntryCompletion(Handle handle)
Internal static factory method to be used by Java-Gnome only.
ClassgetEventListenerClass(String signal)
EventTypegetEventType(String signal)
booleangetInlineCompletion()
Returns whether the common prefix of the possible completion should be automatically inserted into the entry.
intgetMinimumKeyLength()
Returns the minimum key length as set for completion.
TreeModelgetModel()
Returns the model that the EntryCompletion is using as a data source.
booleangetPopupCompletion()
Returns whether the completion should be presented in a popup window.
booleangetPopupSetWidth()
intgetTextColumn()
Returns the column in the model of completion to get strings from.
voidinsertActionMarkup(int index, String markup)
Inserts an action in the EntryCompletion's action list with the position and text provided.
voidinsertActionText(int index, String text)
Inserts an action in the EntryCompletion's action list with the position and text provided.
voidinsertPrefix()
Request a prefix insertion.
voidremoveListener(EntryCompletionListener listener)
Removes a listener
voidsetInlineCompletion(boolean inlineCompletion)
Sets whether the common prefix of the possible completion should be automatically inserted into the entry.
voidsetMinimumKeyLength(int length)
Requires the length of the search key for the EntryCompletion to be at least length.
voidsetModel(TreeModel model)
Sets the model for this EntryCompletion.
voidsetPopupCompletion(boolean popupCompletion)
Sets whether the completion should be presented in a popup window.
voidsetPopupSetWidth(boolean setWidth)
voidsetTextColumn(int column)
Specify which column in the model to use to display the strings.

Constructor Detail

EntryCompletion

public EntryCompletion()
Creates a new EntryCompletion object.

EntryCompletion

public EntryCompletion(Handle nativeHandle)

Method Detail

addListener

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

See Also: EntryCompletionListener

complete

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

deleteAction

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

Parameters: index

getEntry

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

getEntryCompletion

public static EntryCompletion getEntryCompletion(Handle handle)
Internal static factory method to be used by Java-Gnome only.

getEventListenerClass

public Class getEventListenerClass(String signal)

getEventType

public EventType getEventType(String signal)

getInlineCompletion

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

getMinimumKeyLength

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

getModel

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

getPopupCompletion

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

getPopupSetWidth

public boolean getPopupSetWidth()

getTextColumn

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

insertActionMarkup

public void insertActionMarkup(int index, 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

insertActionText

public void insertActionText(int index, 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

insertPrefix

public void insertPrefix()
Request a prefix insertion.

removeListener

public void removeListener(EntryCompletionListener listener)
Removes a listener

See Also: addListener

setInlineCompletion

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

Parameters: inlineCompletion

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

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

setPopupCompletion

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

Parameters: popupCompletion

setPopupSetWidth

public void setPopupSetWidth(boolean setWidth)

setTextColumn

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

Parameters: column