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