[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] ui Forms / FormText Problem/Question

Hullo all,

I'm hoping I can get some guidance and help using the FormText widget in
org.eclipse.ui.forms.widgets. I'm after a wrapped read-only text field with
simple html tags (<p>) embedded in the content.

When setting the content of the field I'm wrapping that content with a
<form></form> tags as the FormText doc suggests:

  final FormText recipeInstruction =
toolkit.createFormText(instructionTextComposite, false);
  StringBuffer formattedText = new StringBuffer();
  formattedText.append("<form>");
  formattedText.append(recipeBean.getInstructionText());
  formattedText.append("</form>");
  String s = new String(formattedText.toString()); //debugging only

  recipeInstruction.setText(formattedText.toString(), true, false);

Obviously I'm missing something. When the setText method executes I get

org.xml.sax.SAXParseException: Illegal character or entity reference syntax.

from this eclipse code:
FormTextModel.parseInputStream(InputStream, boolean){
....
Document doc = parser.parse(source);
.....
}
I've tried almost everything I can think of in terms of the xml being passed
to setText but no magic yet.

<form>hullo</form>
<?xml version="1.0" encoding="UTF-8"?><form>hullo</form>
 <?xml version="1.0" encoding="UTF-8"?><form><p>hullo</p></form>

A working example of text for a TextForm would be very helpful -any takers?

thanks, Pete