@Test public void testInsertIntoDocument() throws Exception { }
public void insertIntoDocument(JTextPane pane, int pos) throws BadLocationException { String stringToInsert = Character.toString(open) + Character.toString(close); pane.getStyledDocument().insertString(pos, stringToInsert, null); pane.setCaretPosition(pos + 1); }
OpenCloseChar { public void insertIntoDocument(JTextPane pane, int pos) throws BadLocationException { String stringToInsert = Character.toString(open) + Character.toString(close); pane.getStyledDocument().insertString(pos, stringToInsert, null); pane.setCaretPosition(pos + 1); } }
OpenCloseChar { public void insertIntoDocument(JTextPane pane, int pos) throws BadLocationException { String stringToInsert = Character.toString(open) + Character.toString(close); pane.getStyledDocument().insertString(pos, stringToInsert, null); pane.setCaretPosition(pos + 1); } OpenCloseChar(char open, char close); }
OpenCloseChar { public void insertIntoDocument(JTextPane pane, int pos) throws BadLocationException { String stringToInsert = Character.toString(open) + Character.toString(close); pane.getStyledDocument().insertString(pos, stringToInsert, null); pane.setCaretPosition(pos + 1); } OpenCloseChar(char open, char close); char getOpen(); char getClose(); void insertIntoDocument(JTextPane pane, int pos); }
OpenCloseChar { public void insertIntoDocument(JTextPane pane, int pos) throws BadLocationException { String stringToInsert = Character.toString(open) + Character.toString(close); pane.getStyledDocument().insertString(pos, stringToInsert, null); pane.setCaretPosition(pos + 1); } OpenCloseChar(char open, char close); char getOpen(); char getClose(); void insertIntoDocument(JTextPane pane, int pos);  }