/**
   * This is an overrided call of text change. This method gets called on every text change in the
   * search box.
   *
   * @param textArea
   * @param previousText
   * @param currentText
   */
  public void onTextChange(
      PatchedTextArea textArea, String previousText, final String currentText) {
    if (!(Display.getInstance().getCurrent() instanceof FormInvitation)) {
      return;
    }
    Log.v(TAG, " ************* testing PatchedTextArea " + currentText);
    Log.v(TAG, " ************* String Length  " + currentText.length());
    final int index = currentText.lastIndexOf(';');

    Log.v(TAG, " ************* Last Index " + index);
    if (index > 0) {
      UIHelper.runOnLwuitUiThread(
          new Runnable() {
            public void run() {
              searchContactlist(currentText.substring(index + 1));
            }
          });

      Log.v(TAG, " ************* Last Character " + currentText.substring(index));
    } else {
      UIHelper.runOnLwuitUiThread(
          new Runnable() {
            public void run() {
              searchContactlist(currentText);
            }
          });
    }

    if (!inviteVector.isEmpty()) {
      inviteList.setSelectedIndex(0);
      inviteList.repaint();
    }
  }
Example #2
0
 /**
  * Sets the list items as selected / not selected based on the indices in an array.
  *
  * @param indices Array containing the selected indices.
  */
 public void setSelectedIndices(int[] indices) {
   if (indices.length > 0) {
     list.setSelectedIndex(indices[0]);
   }
 }