How to set styler for RubEditingArea?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

How to set styler for RubEditingArea?

Uko2
Hi, I have my own styler which is a subclass of SHRBTextStyler. How do I set it as a styler for RubEditingArea?

Cheers.
Uko
Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Henrik Nergaard
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:[hidden email]] On Behalf Of Yuriy Tymchuk
Sent: Saturday, March 19, 2016 1:19 AM
To: Pharo Development List <[hidden email]>
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

Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Henrik Nergaard
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:[hidden email]] On Behalf Of Henrik Nergaard
Sent: Saturday, March 19, 2016 11:00 AM
To: Pharo Development List <[hidden email]>
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:[hidden email]] On Behalf Of Yuriy Tymchuk
Sent: Saturday, March 19, 2016 1:19 AM
To: Pharo Development List <[hidden email]>
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


Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Stephan Eggermont-3
In reply to this post by Henrik Nergaard
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


Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Nicolai Hess-3-2

Isn't there a xml.-Styler in Moose? How is that implemented?

Am 19.03.2016 11:28 vorm. schrieb "Stephan Eggermont" <[hidden email]>:
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


Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Peter Uhnak
There was also Pillar coloring http://www.humane-assessment.com/blog/writing-pillar-books-with-the-gtinspector/, 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 <[hidden email]> wrote:

Isn't there a xml.-Styler in Moose? How is that implemented?

Am 19.03.2016 11:28 vorm. schrieb "Stephan Eggermont" <[hidden email]>:
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



Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Henrik Nergaard
In reply to this post by Nicolai Hess-3-2

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:[hidden email]] On Behalf Of Nicolai Hess
Sent: Saturday, March 19, 2016 12:24 PM
To: Pharo Development List <[hidden email]>
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" <[hidden email]>:

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

Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Stephan Eggermont-3
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


Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Uko2
Nice, thank you!


> On 19 Mar 2016, at 15:58, Stephan Eggermont <[hidden email]> 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
>
>


Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

monty-3
In reply to this post by Nicolai Hess-3-2
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" <[hidden email]>
To: "Pharo Development List" <[hidden email]>
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" <[hidden email]>: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

 

Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Uko2
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 <[hidden email]> 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" <[hidden email]>
> To: "Pharo Development List" <[hidden email]>
> 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" <[hidden email]>: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
>
>  
>


Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Henrik Nergaard
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:[hidden email]] On Behalf Of Yuriy Tymchuk
Sent: Monday, March 21, 2016 8:36 PM
To: Pharo Development List <[hidden email]>
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 <[hidden email]> 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" <[hidden email]>
> To: "Pharo Development List" <[hidden email]>
> 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" <[hidden email]>: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
>
>  
>


Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Uko2
You made my day. Thank you. Now I have a minimal working example to experiment with.

Uko

On 21 Mar 2016, at 20:46, Henrik Nergaard <[hidden email]> wrote:

'| area | area := RubEditingArea new.

Reply | Threaded
Open this post in threaded view
|

Re: How to set styler for RubEditingArea?

Nicolai Hess-3-2


2016-03-21 21:45 GMT+01:00 Yuriy Tymchuk <[hidden email]>:
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 <[hidden email]> wrote:

'| area | area := RubEditingArea new.