setHTMLDescription with line breaks
I am programmatically creating work items, and in my HTMLSummary, I want to have multiple lines/paragraphs. I am loading the information from a file into an ArrayList with 1 row in the array per line of text. Then I want to put all of the rows together with "line breaks" to preserve the formatting of the original Summary.
I have tried to string them together: String allText = ""; for (int i=0;i<myArray.size();i++) { allText = allText + "\\n" + myArray.get(i); } Trying to put a \n new line into the plain text, and then use XMLString description = XMLSTring.createFrom PlainText(allText); but that, as you can imagine, just uses \n in the text itself. Is there a way to do this using createFromPlainText? Or does createfromXMLText(String xmlText) understand HTML-type items like <p>? Thanks, Susan |
3 answers
Investigating the code we see:
A little deeper, we can see this:
So, I guess if you change your code, replacing "\\n" with just "\n", it might works. String allText = ""; for (int i=0;i<myArray.size();i++) { allText = allText + "\n" + myArray.get(i); } |
A little deeper, we can see this: Thanks P.S. Where could we find the source code of those classes? |
Davide,
you can find them on SDK. In version 3.x they are provided by zip files but in version 2.x was provided by jar (search for those with .source.). You only have to unzip them. Michele. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.