From odf-dev-return-1271-apmail-incubator-odf-dev-archive=incubator.apache.org@incubator.apache.org Tue Nov 6 05:36:14 2012 Return-Path: X-Original-To: apmail-incubator-odf-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-odf-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4E127DB26 for ; Tue, 6 Nov 2012 05:36:14 +0000 (UTC) Received: (qmail 95510 invoked by uid 500); 6 Nov 2012 05:36:14 -0000 Delivered-To: apmail-incubator-odf-dev-archive@incubator.apache.org Received: (qmail 95281 invoked by uid 500); 6 Nov 2012 05:36:13 -0000 Mailing-List: contact odf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: odf-dev@incubator.apache.org Delivered-To: mailing list odf-dev@incubator.apache.org Received: (qmail 94984 invoked by uid 99); 6 Nov 2012 05:36:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 05:36:12 +0000 Date: Tue, 6 Nov 2012 05:36:11 +0000 (UTC) From: "DaLi Liu (JIRA)" To: odf-dev@incubator.apache.org Message-ID: <465906208.72666.1352180172206.JavaMail.jiratomcat@arcas> In-Reply-To: <840441171.312.1344493939231.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Resolved] (ODFTOOLKIT-330) Improve the method TextSelection.replaceWith(String). new param types support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ODFTOOLKIT-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] DaLi Liu resolved ODFTOOLKIT-330. --------------------------------- Resolution: Fixed patch has been committed > 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 > 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