## sidekick
Class SideKickCompletion

    java.lang.Object
      sidekick.SideKickCompletion

public abstract class SideKickCompletion
extends Object

A code completion instance.

This is a wrapper around a collection of possible completions, with callbacks for inserting and displaying the completions in a popup menu.

Since:
  SideKick 0.3
Version:
  $Id: SideKickCompletion.java,v 1.8 2006/06/04 15:03:49 ezust Exp $
Author:
  Slava Pestov

Field Summary
`protected List` `items`
`protected String` `text`
`protected JEditTextArea` `textArea`
`protected View` `view`

Constructor Summary
`SideKickCompletion()` Deprecated. Use the other constructor instead.
`SideKickCompletion(View view, String text)`
`SideKickCompletion(View view, String text, List items)`
`SideKickCompletion(View view, String text, Object[] items)`

Method Summary
`Object` `get(int index)`
`String` `getCompletionDescription(int index)`
`ListCellRenderer` `getRenderer()`
`int` `getTokenLength()` The length of the text being completed (popup will be positioned there).
`boolean` `handleKeystroke(int selectedIndex, char keyChar)`
`void` `insert(int index)`
`boolean` `isCompletionSelectable(int index)`
`int` `size()`
`boolean` `updateInPlace(EditPane editPane, int caret)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### view

    protected View view

### textArea

    protected JEditTextArea textArea

### text

    protected String text

### items

    protected List items

Constructor Detail

### SideKickCompletion

    public SideKickCompletion()

  Deprecated. Use the other constructor instead.

### SideKickCompletion

    public SideKickCompletion(View view,
                              String text)

Since:
  SideKick 0.3.2

### SideKickCompletion

    public SideKickCompletion(View view,
                              String text,
                              List items)

Parameters:
  `items` - - a list of strings containing the possible completions.
Since:
  SideKick 0.3.2

### SideKickCompletion

    public SideKickCompletion(View view,
                              String text,
                              Object[] items)

Since:
  SideKick 0.3.2

Method Detail

### size

    public int size()

### get

    public Object get(int index)

### getCompletionDescription

    public String getCompletionDescription(int index)

### isCompletionSelectable

    public boolean isCompletionSelectable(int index)

### updateInPlace

    public boolean updateInPlace(EditPane editPane,
                                 int caret)

  Returns:
    If this returns false, then we create a new completion object after user input.

### getRenderer

    public ListCellRenderer getRenderer()

### insert

    public void insert(int index)

### getTokenLength

    public int getTokenLength()

  The length of the text being completed (popup will be positioned there).

### handleKeystroke

    public boolean handleKeystroke(int selectedIndex,
                                   char keyChar)

  Parameters:
    `selectedIndex` - -1 if the popup is empty, otherwise the index of the selected completion.
    `keyChar` - the character typed by the user.
  Returns:
    True if completion should continue, false otherwise.
  Since:
    SideKick 0.3.2