You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by lello <rb...@gmail.com> on 2010/12/27 10:09:37 UTC

TextPane Span problem

Hi all,
I was trying the new TextPane component, but there seems to be a problem
when applying bold or italic to the selected span: the last character is not
included in the selection.
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/TextPane-Span-problem-tp2150948p2150948.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: TextPane Span problem

Posted by Greg Brown <gk...@verizon.net>.
You had said this in your original email:

"I really need a text editor, or, muche better, a rich text editor."

The new TextArea can certainly serve as a text editor, though as you noted it does not support rich text editing.

On Dec 28, 2010, at 2:09 AM, lello wrote:

> 
> By new TextArea you mean the TextPane? By rich text I mean something like the
> rtf format.
> Is the TextArea able to open an rtf file? I thought it was not.
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/TextPane-Span-problem-tp2150948p2155640.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: TextPane Span problem

Posted by lello <rb...@gmail.com>.
By new TextArea you mean the TextPane? By rich text I mean something like the
rtf format.
Is the TextArea able to open an rtf file? I thought it was not.
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/TextPane-Span-problem-tp2150948p2155640.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: TextPane Span problem

Posted by Greg Brown <gk...@verizon.net>.
> I really need a text editor

Is there some reason you cannot use the new TextArea component?

> Is it possible to integrate a Swing rich text editor in a pivot application?

Not easily. We have tried a few times to support embedding Swing components, but it is not straightforward.


Re: TextPane Span problem

Posted by lello <rb...@gmail.com>.
I knew it was the "old" textarea, good to know that it is experimental. I
really need a text editor, or, muche better, a rich text editor.
Is it possible to integrate a Swing rich text editor in a pivot application?
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/TextPane-Span-problem-tp2150948p2152313.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: TextPane Span problem

Posted by Greg Brown <gk...@verizon.net>.
FYI, TextPane is not a new component. It is a renamed version of the TextArea component from earlier versions with some rich text editing functionality added. It is currently considered experimental.

On Dec 27, 2010, at 4:09 AM, lello wrote:

> 
> Hi all,
> I was trying the new TextPane component, but there seems to be a problem
> when applying bold or italic to the selected span: the last character is not
> included in the selection.
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/TextPane-Span-problem-tp2150948p2150948.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: TextPane Span problem

Posted by Chris Bartlett <cb...@gmail.com>.
Yes, I see that too.

Although I think it is just a problem with the demo rather than the TextPane
component or skin.

See this method on LIne 463
TextPaneDemo#applyStyleToTextNode(org.apache.pivot.wtk.Span,
StyleApplicator, org.apache.pivot.wtk.text.TextNode, int,
org.apache.pivot.wtk.Span)
If I select the first bold 'abcd' and press the Italic button, the
'intersectionLength' variable gets set to 3 rather than 4, meaning that the
'd' is not included when the styling is applied.

JIRA does include 'demos' in the 'components' list, so feel free to create a
new issue.
https://issues.apache.org/jira/browse/PIVOT

Chris

On 27 December 2010 18:40, lello <rb...@gmail.com> wrote:

>
> I am just running the text_pane_demo in the pivot 2.0. I select some text
> and
> then I press the button to
> change the font to bold.
> --
> View this message in context:
> http://apache-pivot-users.399431.n3.nabble.com/TextPane-Span-problem-tp2150948p2151336.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>

Re: TextPane Span problem

Posted by lello <rb...@gmail.com>.
I am just running the text_pane_demo in the pivot 2.0. I select some text and
then I press the button to
change the font to bold.
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/TextPane-Span-problem-tp2150948p2151336.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: TextPane Span problem

Posted by Chris Bartlett <cb...@gmail.com>.
Can you please provide a short example demonstrating the issue?

Chris

On 27 December 2010 16:09, lello <rb...@gmail.com> wrote:

>
> Hi all,
> I was trying the new TextPane component, but there seems to be a problem
> when applying bold or italic to the selected span: the last character is
> not
> included in the selection.
> --
> View this message in context:
> http://apache-pivot-users.399431.n3.nabble.com/TextPane-Span-problem-tp2150948p2150948.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>