private boolean isRepresentingTab(String text){
  if (text == null)   return false;
  if (isInsertingSpacesForTab()) {
    if (text.length() == 0 || text.length() > getVisualTabLengthPreference())     return false;
    for (int i=0; i < text.length(); i++) {
      if (text.charAt(i) != ' ')       return false;
    }
    return true;
  }
 else   return text.length() == 1 && text.charAt(0) == '\t';
}

private boolean isRepresentingTab ( String text ) { if ( text == null ) return false ; if ( isInsertingSpacesForTab ( ) ) { if ( text . length ( ) == 0 || text . length ( ) > getVisualTabLengthPreference ( ) ) return false ; for ( int i = 0 ; i < text . length ( ) ; i ++ ) { if ( text . charAt ( i ) != ' ' ) return false ; } return true ; } else return text . length ( ) == 1 && text . charAt ( 0 ) == '\t' ; }
tells whether the given inserted string represents hitting the tab key .
