pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wouter Schaart <willow...@gmail.com>
Subject TextPane and Document, how do I work with them?
Date Fri, 18 Oct 2013 19:58:56 GMT
Hello,

I'm in the process of writing book authoring software, I'd like to use a
rich text editor for this, and it seems that TextPane and Document could
fit my requirements. I've tried to find information about the two but they
seem to be two very scarsely documented systems.

Ideally I'd be able to force my documents into very strict structures. Much
like XML documents can be forced into very strict structure.
<Book>
  <Title>
  <Author>
  <Summary>
  <Section>
    <Summary>
    <Chapter>
       <Title>
       <Summary>
       <Body>

I'd like to be able to show and hide parts of the text, for example show
only summaries when the user desires it. Or show only chapters 3 to 5.
Preferably without removing the rest of the document.

Further I'd like to be able to add todo information and annotations to
random spans of text. Preferably overlapping each other and spanning the
elements above, but not being able to do so is something I'd be able to
live with. Of course those spans should remain anchored to the relevant
text, additions and removals should not cause problems.

I looked into the pivot code and it seems to me that while document with
some subclassed nodes would be very able to represent the information I
want to put into it, Textpane has some very clear assumptions on how to
work with them. And clearly did not have my unusal document structure in
mind.

I'm hoping someone could give me some advice on how to proceed. Can I use
TextPane and somehow inject my rules on how to work with a document there?
Or should I build my own TextPaneish control? I've tried to do this but got
stuck on the skin the function of which isn't apparent to me just now. Is
there some tutorial on how to build your own widget available?

Kind regards

Mime
View raw message