|
|
Re: Standalone StyledTextArea [message #1470905 is a reply to message #1470265] |
Wed, 12 November 2014 18:27 |
Guillermo Cifuentes Messages: 3 Registered: November 2014 |
Junior Member |
|
|
Hi Tom,
First of all thanks a lot for your prompt and extensive response, I appreciate it.
I've been digging into the eclipse text project and I've finally discarded it because it is quite complex, and it could take some time to grok everything and get up to speed.
Since we already have the parsing and tokenizing done with Antlr4, and although it's possible to glue everything together, it required much effort.
What I'm finally doing at the moment is stripping out to the bare bones your editor, since I only need one line, and implementing on top of it the other features.
It's served as a great source of inspiration, the only pity is that I won't be able to contribute back the code since it differs a lot.
Again, thanks you very much and keep up rocking eclipse with JavaFX goodies
Regards,
Guillermo
|
|
|
Re: Standalone StyledTextArea [message #1471069 is a reply to message #1470905] |
Wed, 12 November 2014 21:31 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Hi,
On 12.11.14 19:27, Guillermo Cifuentes wrote:
> Hi Tom,
>
> First of all thanks a lot for your prompt and extensive response, I
> appreciate it.
>
> I've been digging into the eclipse text project and I've finally
> discarded it because it is quite complex, and it could take some time to
> grok everything and get up to speed.
>
> Since we already have the parsing and tokenizing done with Antlr4, and
> although it's possible to glue everything together, it required much
> effort.
Sounds like an cool piece of source.
>
> What I'm finally doing at the moment is stripping out to the bare bones
> your editor, since I only need one line, and implementing on top of it
> the other features.
Maybe you can use the DefaultDocumentAdapter and the IDocument API so
that only the StyleRange stuff is left. Anyways I'm glad the code helps you!
>
> It's served as a great source of inspiration, the only pity is that I
> won't be able to contribute back the code since it differs a lot.
>
No worries - maybe you can contribute to the editor control itself -
e.g. selection is not 100% working.
If there are any interfaces we could add so that you can plug in your
stuff into compensator just file bugs!
Like I said the compensator is more of a cool research project I work on
when I need a break from real world projects ;-)
Tom
|
|
|
|
|
Re: Standalone StyledTextArea [message #1494462 is a reply to message #1494434] |
Mon, 01 December 2014 13:48 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Hi,
I think your display problem is a problem of the StyledTextControl
itself who currently expects the full size of the text to be covered by
StyleRanges.
This works for me:
> BorderPane p = new BorderPane();
> StyledTextArea t = new StyledTextArea();
> t.getStylesheets().add(getClass().getResource("test.css").toExternalForm());
> t.getContent().setText("This is a styled text!");
> t.setStyleRanges(
> new StyleRange[] {
> new StyleRange("text-normal",0,10,null,null),
> new StyleRange("text-highlight",10,12,null,null)
> });
> p.setCenter(t);
>
> Scene scene = new Scene(p,800,600);
>
> primaryStage.setScene(scene);
> primaryStage.show();
test.css:
---------
> .text-normal {
>
> }
>
> .text-highlight {
> -styled-text-color: #ff0000;
> }
Tom
On 01.12.14 14:18, Tom Schindl wrote:
> Hi,
>
> Yes the DefaultContent is broken.
>
> Tom
>
> On 01.12.14 13:30, Rodolfo M. Raya wrote:
>> Hi,
>>
>> I'm also trying to use StyledTextArea in one of my projects and am fighting with the code.
>>
>> The implementation of DefaultContent nested in StyledTextArea is too complex and doesn't seem to work.
>>
>> The attached file is the simplest implementation of StyledTextContent interface that I could make.
>>
>> I have a very simple javaFX test application that displays a StyledTextArea on a StackedPane. The StyledTextArea component is not displaying the text at this moment but using the debugger I can see that my custom content provider is working.
>>
>> Any help in making StyledTextArea work would be appreciated.
>>
>> Regards,
>> Rodolfo M. Raya
>>
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03157 seconds