(JTextComponent component, int position)
| 350 | } |
| 351 | |
| 352 | protected int toComponentPosition(JTextComponent component, int position) { |
| 353 | int[] windowsLineEndings = (int[])component.getDocument().getProperty(WINDOWS_LINE_ENDINGS); |
| 354 | if ( windowsLineEndings==null || windowsLineEndings.length==0 ) { |
| 355 | return position; |
| 356 | } |
| 357 | |
| 358 | int index = Arrays.binarySearch(windowsLineEndings, position); |
| 359 | if ( index>=0 ) { |
| 360 | return position-index; |
| 361 | } |
| 362 | return position-(-index-1); |
| 363 | } |
| 364 | |
| 365 | protected int toEventPosition(JTextComponent component, int position) { |
| 366 | int result = position; |
no test coverage detected