How to set styler for RubEditingArea?
Hi, I have my own styler which is a subclass of SHRBTextStyler. How do I set it as a styler for RubEditingArea? Cheers. Uko
There is no way of doing that, RubParagraphDecorator lacks a method to set its style variable. If you add that, then you can do something like: Self is a RubEditingArea (self decoratorNamed: #shoutStyler) style: yourStyleclass new. Best regards, Henrik -----Original Message----- From: Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] On Behalf Of Yuriy Tymchuk Sent: Saturday, March 19, 2016 1:19 AM To: Pharo Development List <pharo-dev@lists.pharo.org> Subject: [Pharo-dev] How to set styler for RubEditingArea? Hi, I have my own styler which is a subclass of SHRBTextStyler. How do I set it as a styler for RubEditingArea? Cheers. Uko
Correction, I forgot some r's.... There is no way of doing that, RubParagraphDecorator lacks a method to set its styler variable. If you add that, then you can do something like: Self is a RubEditingArea (self decoratorNamed: #shoutStyler) styler: yourStyleclass new. styler: aTextStyler styler := aTextStyler. styler view: self. Best regards, Henrik -----Original Message----- From: Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] On Behalf Of Henrik Nergaard Sent: Saturday, March 19, 2016 11:00 AM To: Pharo Development List <pharo-dev@lists.pharo.org> Subject: Re: [Pharo-dev] How to set styler for RubEditingArea? There is no way of doing that, RubParagraphDecorator lacks a method to set its style variable. If you add that, then you can do something like: Self is a RubEditingArea (self decoratorNamed: #shoutStyler) style: yourStyleclass new. Best regards, Henrik -----Original Message----- From: Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] On Behalf Of Yuriy Tymchuk Sent: Saturday, March 19, 2016 1:19 AM To: Pharo Development List <pharo-dev@lists.pharo.org> Subject: [Pharo-dev] How to set styler for RubEditingArea? Hi, I have my own styler which is a subclass of SHRBTextStyler. How do I set it as a styler for RubEditingArea? Cheers. Uko
On 19-03-16 10:59, Henrik Nergaard wrote:
There is no way of doing that, RubParagraphDecorator lacks a method to set its style variable.
If you add that, then you can do something like: Self is a RubEditingArea
(self decoratorNamed: #shoutStyler) style: yourStyleclass new.
I'm strongly in favor of adding this. There are other languages I want to style than smalltalk. Stephan
Isn't there a xml.-Styler in Moose? How is that implemented? Am 19.03.2016 11:28 vorm. schrieb "Stephan Eggermont" <stephan@stack.nl>:
On 19-03-16 10:59, Henrik Nergaard wrote:
There is no way of doing that, RubParagraphDecorator lacks a method to set its style variable.
If you add that, then you can do something like: Self is a RubEditingArea
(self decoratorNamed: #shoutStyler) style: yourStyleclass new.
I'm strongly in favor of adding this. There are other languages I want to style than smalltalk.
Stephan
There was also Pillar coloring http://www.humane-assessment.com/blog/writing-pillar-books-with-the-gtinspec..., and of course And as Nicolai mentioned, there's coloring for XML for both the source and tree view â ask monty how he did this rainbow magic. :) Peter On Sat, Mar 19, 2016 at 12:24 PM, Nicolai Hess <nicolaihess@gmail.com> wrote:
Isn't there a xml.-Styler in Moose? How is that implemented? Am 19.03.2016 11:28 vorm. schrieb "Stephan Eggermont" <stephan@stack.nl>:
On 19-03-16 10:59, Henrik Nergaard wrote:
There is no way of doing that, RubParagraphDecorator lacks a method to set its style variable.
If you add that, then you can do something like: Self is a RubEditingArea
(self decoratorNamed: #shoutStyler) style: yourStyleclass new.
I'm strongly in favor of adding this. There are other languages I want to style than smalltalk.
Stephan
That is probably done by using GLMHighlighterTextStylerDecorator which includes #styler: , but I guess you have to also use GLMRubircSMalltalkTextModel and perhaps also some other things then. Anyways I added a new configuration of rubric (2.12) which adds #styler: to RubShoutStylerDecorator and some other stuff. Best regards, Henrik From: Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] On Behalf Of Nicolai Hess Sent: Saturday, March 19, 2016 12:24 PM To: Pharo Development List <pharo-dev@lists.pharo.org> Subject: Re: [Pharo-dev] How to set styler for RubEditingArea? Isn't there a xml.-Styler in Moose? How is that implemented? Am 19.03.2016 11:28 vorm. schrieb "Stephan Eggermont" <stephan@stack.nl<mailto:stephan@stack.nl>>: On 19-03-16 10:59, Henrik Nergaard wrote: There is no way of doing that, RubParagraphDecorator lacks a method to set its style variable. If you add that, then you can do something like: Self is a RubEditingArea (self decoratorNamed: #shoutStyler) style: yourStyleclass new. I'm strongly in favor of adding this. There are other languages I want to style than smalltalk. Stephan
On 19-03-16 14:35, Henrik Nergaard wrote:
That is probably done by using GLMHighlighterTextStylerDecorator which includes #styler: , but I guess you have to also use GLMRubircSMalltalkTextModel and perhaps also some other things then.
Anyways I added a new configuration of rubric (2.12) which adds #styler: to RubShoutStylerDecorator and some other stuff.
Thanks Stephan
Nice, thank you!
On 19 Mar 2016, at 15:58, Stephan Eggermont <stephan@stack.nl> wrote:
On 19-03-16 14:35, Henrik Nergaard wrote:
That is probably done by using GLMHighlighterTextStylerDecorator which includes #styler: , but I guess you have to also use GLMRubircSMalltalkTextModel and perhaps also some other things then.
Anyways I added a new configuration of rubric (2.12) which adds #styler: to RubShoutStylerDecorator and some other stuff.
Thanks
Stephan
There are actually two, a highlighting parser used when you inspect files from spotter, and a highlighting writer used to implement the "Tree" and "Source" tabs when inspecting an already-parsed DOM tree. Â Sent:Â Saturday, March 19, 2016 at 7:24 AM From:Â "Nicolai Hess" <nicolaihess@gmail.com> To:Â "Pharo Development List" <pharo-dev@lists.pharo.org> Subject:Â Re: [Pharo-dev] How to set styler for RubEditingArea? Isn't there a xml.-Styler in Moose? How is that implemented? Am 19.03.2016 11:28 vorm. schrieb "Stephan Eggermont" <stephan@stack.nl>:On 19-03-16 10:59, Henrik Nergaard wrote:There is no way of doing that, RubParagraphDecorator lacks a method to set its style variable. If you add that, then you can do something like: Self is a RubEditingArea (self decoratorNamed:Â #shoutStyler) style: yourStyleclass new. Â I'm strongly in favor of adding this. There are other languages I want to style than smalltalk. Stephan Â
Ok, Iâm continuing my journey of styling code. And at the beginning I want to at least recreate the original coding area. Iâve did this and everything is red⦠area := RubEditingArea new. area backgroundColor: Color lightGray; updateTextWith: 'method: sth ^ 1'; textColor: Color white; beNotWrapped; beForSmalltalkCode; width: 400; withDecoratorNamed: #shoutStyler. area shoutStyler styler: RubSHTextStylerST80 new. area openInWorld any idea what could possibly go wrong? Uko
On 20 Mar 2016, at 02:56, monty <monty2@programmer.net> wrote:
There are actually two, a highlighting parser used when you inspect files from spotter, and a highlighting writer used to implement the "Tree" and "Source" tabs when inspecting an already-parsed DOM tree.
Sent: Saturday, March 19, 2016 at 7:24 AM From: "Nicolai Hess" <nicolaihess@gmail.com> To: "Pharo Development List" <pharo-dev@lists.pharo.org> Subject: Re: [Pharo-dev] How to set styler for RubEditingArea? Isn't there a xml.-Styler in Moose? How is that implemented?
Am 19.03.2016 11:28 vorm. schrieb "Stephan Eggermont" <stephan@stack.nl>:On 19-03-16 10:59, Henrik Nergaard wrote:There is no way of doing that, RubParagraphDecorator lacks a method to set its style variable.
If you add that, then you can do something like: Self is a RubEditingArea
(self decoratorNamed: #shoutStyler) style: yourStyleclass new.
I'm strongly in favor of adding this. There are other languages I want to style than smalltalk.
Stephan
The TextModel? is not set to a specific class, so it does not understand that it is a method you are declaring. The same code is red in the Playground as well. Switch 'method: sth ^ 1' to for example: '| area | area := RubEditingArea new.' Best regards, Henrik -----Original Message----- From: Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] On Behalf Of Yuriy Tymchuk Sent: Monday, March 21, 2016 8:36 PM To: Pharo Development List <pharo-dev@lists.pharo.org> Subject: Re: [Pharo-dev] How to set styler for RubEditingArea? Ok, Iâm continuing my journey of styling code. And at the beginning I want to at least recreate the original coding area. Iâve did this and everything is red⦠area := RubEditingArea new. area backgroundColor: Color lightGray; updateTextWith: 'method: sth ^ 1'; textColor: Color white; beNotWrapped; beForSmalltalkCode; width: 400; withDecoratorNamed: #shoutStyler. area shoutStyler styler: RubSHTextStylerST80 new. area openInWorld any idea what could possibly go wrong? Uko
On 20 Mar 2016, at 02:56, monty <monty2@programmer.net> wrote:
There are actually two, a highlighting parser used when you inspect files from spotter, and a highlighting writer used to implement the "Tree" and "Source" tabs when inspecting an already-parsed DOM tree.
Sent: Saturday, March 19, 2016 at 7:24 AM From: "Nicolai Hess" <nicolaihess@gmail.com> To: "Pharo Development List" <pharo-dev@lists.pharo.org> Subject: Re: [Pharo-dev] How to set styler for RubEditingArea? Isn't there a xml.-Styler in Moose? How is that implemented?
Am 19.03.2016 11:28 vorm. schrieb "Stephan Eggermont" <stephan@stack.nl>:On 19-03-16 10:59, Henrik Nergaard wrote:There is no way of doing that, RubParagraphDecorator lacks a method to set its style variable.
If you add that, then you can do something like: Self is a RubEditingArea
(self decoratorNamed: #shoutStyler) style: yourStyleclass new.
I'm strongly in favor of adding this. There are other languages I want to style than smalltalk.
Stephan
2016-03-21 21:45 GMT+01:00 Yuriy Tymchuk <yuriy.tymchuk@me.com>:
You made my day. Thank you. Now I have a minimal working example to experiment with.
Uko
And if you want to have an editor with styling for method definitions, you need to set the behavior (classOrMetaclass) area := RubEditingArea new. area backgroundColor: Color lightGray; textColor: Color white; beNotWrapped; beForSmalltalkCode; width: 400; withDecoratorNamed: #shoutStyler. area shoutStyler styler: RubSHTextStylerST80 new. area shoutStyler classOrMetaClass: UndefinedObject. area updateTextWith: 'method: sth ^ 1'. area openInWorld
On 21 Mar 2016, at 20:46, Henrik Nergaard <henrik.nergaard@uia.no> wrote:
'| area | area := RubEditingArea new.
participants (6)
-
Henrik Nergaard -
monty -
Nicolai Hess -
Peter Uhnák -
Stephan Eggermont -
Yuriy Tymchuk