/**
  * Called when a user fixed text from input method or delete all composition text. This method
  * resets CompositionTextPainter.
  *
  * @param text Text from InputMethodEvent.
  * @param commited_count Numbers of committed characters in text.
  */
 public void endCompositionText(AttributedCharacterIterator text, int committed_count) {
   /*
    * If there are no committed characters, remove it all from textarea.
    * This case will happen if a user delete all composing characters by backspace or delete key.
    * If it does, these previous characters are needed to be deleted.
    */
   if (committed_count == 0) {
     removeNotCommittedText(text);
   }
   CompositionTextPainter compositionPainter = textArea.getPainter().getCompositionTextpainter();
   compositionPainter.invalidateComposedTextLayout(initialCaretPosition + committed_count);
   prevComposeString = "";
   isInputProcess = false;
 }