GLMSTBrowserExample with SHTextStylerST80

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

GLMSTBrowserExample with SHTextStylerST80

Fernando olivero
Hi, i've just modified the this method for having the GLMSTBrowser render the source pane pretty printed.

Tudor, if your interested  you could integrate it into  glamour.

Saludos,
Fernando


GLMSTBrowserExample>>sourceOn: browser
browser showOn: #source; from: #category; from: #class; from: #selector; using: [
browser text
title: 'Source';
useExplicitNotNil;
forSmalltalk:[:package :class :selector| class ];
when: [ :category :class :selector | class notNil and: [ selector notNil ] ];
display: [ :category :class :selector | class sourceCodeAt: selector ifAbsent: [ String new ] ].
browser text
title: 'Source';
useExplicitNotNil;
forSmalltalk;
when: [ :category :class :selector | class notNil and: [ selector isNil ] ];
display: [ :category :class :selector | class definition ].
browser mondrian
title: 'Complexity';
useExplicitNotNil;
painting: [ :view :category :class :selector |
view nodeShape 
height: [ :model | model linesOfCode min: 50 max: 5 ];
width: [ :model | model instVarNames size + 5 ];
fillColor: [ :model | model = class ifTrue: [ Color red ] ifFalse: [ Color white ] ].
view nodes: (((Smalltalk organization listAtCategoryNamed: category)
collect: [ :each | Smalltalk classNamed: each ])
reject: [ :each | each isTrait ]).
view edgesFrom: [ :each | each superclass ].
view treeLayout ];
when: [ :category :class :selector | category notNil ] ]


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev