Hi Wouter, I've been thinking about your idea/request, and I confess that I'm somewhat at a loss. So, basically you would *probably* need to create subclasses of some of the org.apache.pivot.wtk.text.Node classes, and the skins that go along with them. Although these *kind of* look like actual components (like Rollup) that can be inserted into TextPane directly (without creating any custom subclasses). And/or you could put actual TextPane components underneath Rollup components.
HTH, ~Roger On Oct 21, 2013, at 3:07 PM, Wouter Schaart <willow...@gmail.com> wrote: > Hello again. > > I hate to be a bother :) But I'm still not having a lot of luck in this area. > Does anyone have any suggestion that might help me on my way? > > Kind regards > > > On Fri, Oct 18, 2013 at 9:58 PM, Wouter Schaart <willow...@gmail.com> wrote: > 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 >