@Test public void testTransformToLineNumber() throws Exception { JTextPane pane = new JTextPane(); pane.setText("12\n\n34\n5\n6"); int lineno = JTextPaneToolbox.transformToLineNumber(pane, 3); assertEquals(1, lineno); }
public static int transformToLineNumber(JTextPane pane, int absPos) { return transformToLineNumber(getText(pane), absPos); }
JTextPaneToolbox { public static int transformToLineNumber(JTextPane pane, int absPos) { return transformToLineNumber(getText(pane), absPos); } }
JTextPaneToolbox { public static int transformToLineNumber(JTextPane pane, int absPos) { return transformToLineNumber(getText(pane), absPos); }  }
JTextPaneToolbox { public static int transformToLineNumber(JTextPane pane, int absPos) { return transformToLineNumber(getText(pane), absPos); }  static String getText(JTextPane pane); static int getDistanceToClosestLineBeginning(JTextPane pane, int pos); static int transformToLineNumber(JTextPane pane, int absPos); static int transformToLineNumber(String code, int absPos); static int getLineBeginning(JTextPane pane, int line); static int getClosestLineBeginningAfter(JTextPane pane, int absPos); static ArrayList<Integer> getLinesBetween(JTextPane pane, int start, int end); static String getCharToTheLeftOfCaret(JTextPane pane); static String getCharToTheRightOfCaret(JTextPane pane); static int getFirstCharPosInLine(JTextPane pane, int line); static int getWordBeginningAtCursor(JTextPane pane); }
JTextPaneToolbox { public static int transformToLineNumber(JTextPane pane, int absPos) { return transformToLineNumber(getText(pane), absPos); }  static String getText(JTextPane pane); static int getDistanceToClosestLineBeginning(JTextPane pane, int pos); static int transformToLineNumber(JTextPane pane, int absPos); static int transformToLineNumber(String code, int absPos); static int getLineBeginning(JTextPane pane, int line); static int getClosestLineBeginningAfter(JTextPane pane, int absPos); static ArrayList<Integer> getLinesBetween(JTextPane pane, int start, int end); static String getCharToTheLeftOfCaret(JTextPane pane); static String getCharToTheRightOfCaret(JTextPane pane); static int getFirstCharPosInLine(JTextPane pane, int line); static int getWordBeginningAtCursor(JTextPane pane);  }