/** * Calls <code>perform</code> on all <code>Edit</code>s in <code>edits</code>. * * @param edits a list of <code>Edit</code>s * @throws BadLocationException if an <code>Edit</code> threw such an exception. */ protected void executeEdits(List<Edit> edits) throws BadLocationException { for (Iterator<Edit> it= edits.iterator(); it.hasNext();) { Edit edit= it.next(); edit.perform(); } }
/** * Creates a new edition on the document of this factory. * * @param offset the offset of the edition at the point when is created. * @param length the length of the edition (not updated via the position update mechanism) * @param text the text to be replaced on the document * @return an <code>Edit</code> reflecting the edition on the document */ public Edit createEdit(int offset, int length, String text) throws BadLocationException { if (!fDocument.containsPositionCategory(fCategory)) { fDocument.addPositionCategory(fCategory); fUpdater= new DefaultPositionUpdater(fCategory); fDocument.addPositionUpdater(fUpdater); } Position position= new Position(offset); try { fDocument.addPosition(fCategory, position); } catch (BadPositionCategoryException e) { Assert.isTrue(false); } return new Edit(fDocument, length, text, position); }
/** * Creates a new edition on the document of this factory. * * @param offset the offset of the edition at the point when is created. * @param length the length of the edition (not updated via the position update mechanism) * @param text the text to be replaced on the document * @return an <code>Edit</code> reflecting the edition on the document */ public Edit createEdit(int offset, int length, String text) throws BadLocationException { if (!fDocument.containsPositionCategory(fCategory)) { fDocument.addPositionCategory(fCategory); fUpdater= new DefaultPositionUpdater(fCategory); fDocument.addPositionUpdater(fUpdater); } Position position= new Position(offset); try { fDocument.addPosition(fCategory, position); } catch (BadPositionCategoryException e) { Assert.isTrue(false); } return new Edit(fDocument, length, text, position); }
/** * Creates a new edition on the document of this factory. * * @param offset the offset of the edition at the point when is created. * @param length the length of the edition (not updated via the position update mechanism) * @param text the text to be replaced on the document * @return an <code>Edit</code> reflecting the edition on the document */ public Edit createEdit(int offset, int length, String text) throws BadLocationException { if (!fDocument.containsPositionCategory(fCategory)) { fDocument.addPositionCategory(fCategory); fUpdater= new DefaultPositionUpdater(fCategory); fDocument.addPositionUpdater(fUpdater); } Position position= new Position(offset); try { fDocument.addPosition(fCategory, position); } catch (BadPositionCategoryException e) { Assert.isTrue(false); } return new Edit(fDocument, length, text, position); }
/** * Calls <code>perform</code> on all <code>Edit</code>s in <code>edits</code>. * * @param edits a list of <code>Edit</code>s * @throws BadLocationException if an <code>Edit</code> threw such an exception. */ protected void executeEdits(List<Edit> edits) throws BadLocationException { for (Iterator<Edit> it= edits.iterator(); it.hasNext();) { Edit edit= it.next(); edit.perform(); } }
/** * Calls <code>perform</code> on all <code>Edit</code>s in <code>edits</code>. * * @param edits a list of <code>Edit</code>s * @throws BadLocationException if an <code>Edit</code> threw such an exception. */ protected void executeEdits(List edits) throws BadLocationException { for (Iterator it= edits.iterator(); it.hasNext();) { Edit edit= (Edit) it.next(); edit.perform(); } }
/** * Executes the edition on document. The offset is taken from the position. * * @throws BadLocationException if the execution of the document fails. */ public void perform() throws BadLocationException { getDocument().replace(getOffset(), getLength(), getText()); }
/** * Executes the edition on document. The offset is taken from the position. * * @throws BadLocationException if the execution of the document fails. */ public void perform() throws BadLocationException { getDocument().replace(getOffset(), getLength(), getText()); }
/** * Executes the edition on document. The offset is taken from the position. * * @throws BadLocationException if the execution of the document fails. */ public void perform() throws BadLocationException { getDocument().replace(getOffset(), getLength(), getText()); }