I appreciate the additional thought you've put into this topic Roger :) But one of the main attractions of my program is that you can annotate text with todo's and comments. Those annotations could overlap multiple chapters and thus would overlap the contents of rollups.
I've begun to experiment with rolling my own control. And it isn't very hard once you figure out the philosophy. I used HueControl and HueControlSkin as utterly simple examples that I could work from. I've decided to change the document structure from a node based structure to an annotation based structure that we've experimented with at work. So I will be able to put any sort of annotation on the text without worrying about the document structure whilst still being able to enforce that structure. Who knows, the end result might even be something worth pushing upstream. ;) I've noticed over the past few months that there's an absolute shortage of good extendable rich text editors in Java. Kind regards On Tue, Oct 29, 2013 at 6:15 PM, Roger L. Whitcomb < [email protected]> wrote: > Hi Wouter,**** > > I was thinking you could actually use a combination of > Rollup and TextPane components. The Rollups would be your outline section > headings, and the TextPane would contain each section’s text (and/or > images, or other components). The Rollup would do the show/hide > functionality, and you can annotate things (to some extent) in TextPane. > There might be some things missing that would help with indenting and such, > but perhaps one of us could be persuaded to make some of those additions > for you… ;)**** > > ** ** > > ~Roger**** > > ** ** > > *From:* Wouter Schaart [mailto:[email protected]] > *Sent:* Thursday, October 24, 2013 3:43 PM > *To:* [email protected] > *Subject:* Re: TextPane and Document, how do I work with them?**** > > ** ** > > Thanks Roger,**** > > ** ** > > The textpane control neatly delegates some of it's behavior to the > org.apache.pivot.wtk.text.Node subclasses. But TextPane hard links to those > subclasses. If I insert my own type there TextPane complains about an > "Unsupported node type" I'm not going to be able to do any of that without > subclassing textpane, but unfortunately the skin won't let me do that.**** > > ** ** > > I admit that by now I'm suffering that incurable common cold for the > programmer the "I'll roll my own." syndrome. ;) However documentation isnt' > common on that subject either. Do you know a good resource on how to roll > my own component? And if that fails, in your opinion, what's the absolute > simplest control for me to replicate and experiment with? I thought Label > would be simple, but it's got a lot of frills.**** > > ** ** > > Kind regards**** > > ** ** > > On Tue, Oct 22, 2013 at 5:24 PM, Roger Whitcomb < > [email protected]> wrote:**** > > 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 <[email protected]> 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 <[email protected]> > 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**** > > ** ** > > ** ** > > ** ** >
