(JTextComponent component, int position)
| 344 | } |
| 345 | |
| 346 | protected int toComponentPosition(JTextComponent component, int position) { |
| 347 | int[] windowsLineEndings = (int[])component.getDocument().getProperty(WINDOWS_LINE_ENDINGS); |
| 348 | if ( windowsLineEndings==null || windowsLineEndings.length==0 ) { |
| 349 | return position; |
| 350 | } |
| 351 | int index = Arrays.binarySearch(windowsLineEndings, position); |
| 352 | if ( index>=0 ) { |
| 353 | return position-index; |
| 354 | } |
| 355 | return position-(-index-1); |
| 356 | } |
| 357 | |
| 358 | protected int toEventPosition(JTextComponent component, int position) { |
| 359 | int result = position; |
no test coverage detected