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:willow...@gmail.com] 
Sent: Thursday, October 24, 2013 3:43 PM
To: user@pivot.apache.org
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
<rogerandb...@rbwhitcomb.com> 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 <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

 

 

 

Reply via email to