[ https://issues.apache.org/jira/browse/ODFTOOLKIT-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] DaLi Liu reassigned ODFTOOLKIT-330: ----------------------------------- Assignee: DaLi Liu > Improve the method TextSelection.replaceWith(String). new param types support > ----------------------------------------------------------------------------- > > Key: ODFTOOLKIT-330 > URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-330 > Project: ODF Toolkit > Issue Type: Improvement > Components: simple api > Affects Versions: 0.8.6 > Reporter: DaLi Liu > Assignee: DaLi Liu > Fix For: 0.8.6, 0.8.7 > > Attachments: 330_all_finish.patch, 330_ImageSelection.patch, 330_ParagraphSelection.patch, 330_TableSelection.patch, 330_TextDocumentSelection.patch > > Original Estimate: 672h > Remaining Estimate: 672h > > With the clasees TextNavigation and TextSelection, user can generation a report base on some templates very easily. The method TextSelection.replaceWith(String) provides an easy way to replace > locate and replace placeholders in a document by a concrete text. However that replacement should not only be limited to simple text strings but also for more complex pieces of content. > So proposal to add new replaceWith method in TextSelection.java > 1. public void replaceWith(Table table) > The text represented by the TextSelection object should be replaced by the table > provided. If the TextSelection object does not contain a paragraph of its own, but rather is part of a paragraph, then this paragraph should be split. that mean the exist paragraph split to two new paragraphs,the table be insert between these two new paragraphs. > 2.public void replaceWith(Image image) > The text represented by the TextSelection object should be replaced by an image. The image needs to replace the TextSelection exactly in-place, that means: if positioned within the flow of a text paragraph, the replacement should be in that very position and not at the beginning, or end of the enclosing paragraph. > 3.public void replaceWith(Paragraph p) > The text represented by the TextSelection object should be replaced by a paragraph. If the replacement is within a paragraph, it may be required to split that paragraph. that mean the exist paragraph split to two new paragraphs,the Paragraph be insert between these two new paragraphs. > 4.public void replaceWith(TextDocument document) > Alike the replacement of a table, it should be possible to replace the TextSelection with the content of a complete documents. This may require that the paragraph where the replacement takes place needs to be split into two paragraphs first. > 5.public void replaceWith(Field field) > The text represented by the TextSelection object should be replaced by the field provided. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira