incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DaLi Liu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ODFTOOLKIT-330) Improve the method TextSelection.replaceWith(String). new param types support
Date Mon, 03 Sep 2012 07:38:07 GMT

     [ https://issues.apache.org/jira/browse/ODFTOOLKIT-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

DaLi Liu updated ODFTOOLKIT-330:
--------------------------------

    Attachment: 330_ParagraphSelection.patch

The implement of replacewith paragraph, similar with FieldSelection.java
Javadoc and testcase included.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	/**
	 * Replace the content with a paragraph, the paragraph can be in the same document or in
a different document.
	 * 
	 * @param paragraph
	 *            the reference paragraph to replace.
	 */
	public void replaceWithParagraph(Paragraph paragraph)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Using: To use it please refer to ParagraphSelectionTest.java
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TextSelection item = (TextSelection) search.nextSelection();
ParagraphSelection nextParagraphSelection=new ParagraphSelection(item);
nextParagraphSelection.replaceWithParagraph(sourceparagraph);

                
> 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_ParagraphSelection.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

Mime
View raw message