@SuppressWarnings("unchecked") public void writeText(String p_146191_1_){
  String var2="";
  String var3=EmailAllowedCharacters.filterAllowedCharacters(p_146191_1_);
  int var4=cursorPosition < selectionEnd ? cursorPosition : selectionEnd;
  int var5=cursorPosition < selectionEnd ? selectionEnd : cursorPosition;
  int var6=maxStringLength - text.length() - (var4 - var5);
  if (text.length() > 0)   var2=var2 + text.substring(0,var4);
  int var8;
  if (var6 < var3.length()) {
    var2=var2 + var3.substring(0,var6);
    var8=var6;
  }
 else {
    var2=var2 + var3;
    var8=var3.length();
  }
  if (text.length() > 0 && var5 < text.length())   var2=var2 + text.substring(var5);
  if (field_175209_y.apply(var2)) {
    text=var2;
    moveCursorBy(var4 - selectionEnd + var8);
    if (field_175210_x != null)     field_175210_x.func_175319_a(field_175208_g,text);
  }
}

@ SuppressWarnings ( "unchecked" ) public void writeText ( String p_146191_1_ ) { String var2 = "" ; String var3 = EmailAllowedCharacters . filterAllowedCharacters ( p_146191_1_ ) ; int var4 = cursorPosition < selectionEnd ? cursorPosition : selectionEnd ; int var5 = cursorPosition < selectionEnd ? selectionEnd : cursorPosition ; int var6 = maxStringLength - text . length ( ) - ( var4 - var5 ) ; if ( text . length ( ) > 0 ) var2 = var2 + text . substring ( 0 , var4 ) ; int var8 ; if ( var6 < var3 . length ( ) ) { var2 = var2 + var3 . substring ( 0 , var6 ) ; var8 = var6 ; } else { var2 = var2 + var3 ; var8 = var3 . length ( ) ; } if ( text . length ( ) > 0 && var5 < text . length ( ) ) var2 = var2 + text . substring ( var5 ) ; if ( field_175209_y . apply ( var2 ) ) { text = var2 ; moveCursorBy ( var4 - selectionEnd + var8 ) ; if ( field_175210_x != null ) field_175210_x . func_175319_a ( field_175208_g , text ) ; } }
replaces selected text , or inserts text at the position on the cursor
