Skip to content

Instantly share code, notes, and snippets.

@iriyak
Last active July 13, 2025 01:54
Show Gist options
  • Save iriyak/12b1e09c4639d3ad967172eeeca72e0c to your computer and use it in GitHub Desktop.
Save iriyak/12b1e09c4639d3ad967172eeeca72e0c to your computer and use it in GitHub Desktop.
aTrait := TAsyncStream. "Paint a tree of classes which use a specified trait. Click to list all the methods. Click with Modifier (command on mac, and ctrl on windows and linux) only to filter out the methods overriden by that class."
notInterestedForNow := 'Async'.
classesFilter := GtSearchImageClassesFilter new
select: [ :class | class usesTrait: aTrait ].
classes := classesFilter result toArray wait asSet.
superClasses := classes flatCollect: [ :class | class allSuperclasses ].
stencilForNodes := [ :class |
| element |
element := BrLabel new
text: class name;
background: Color paleOrange;
aptitude: BrGlamorousLabelAptitude new;
border: (BlBorder paint: Color veryLightGray);
when: BlClickEvent
do: [ :anEvent |
| methodsFilter |
anEvent consumed: true.
((superClasses includes: class) and: [ (classes includes: class) not ])
ifFalse: [ methodsFilter := GtSearchMethodsInInstanceAndClassSideFilter forClass: class.
anEvent modifiers isPrimaryModifier
ifTrue: [ methodsFilter := methodsFilter & GtSearchNonTraitMethodsFilter new ].
anEvent currentTarget phlow spawnObject: methodsFilter ] ].
(class name beginsWith: notInterestedForNow) not
ifTrue: [ element background: Color lightOrange ].
((superClasses includes: class) and: [ (classes includes: class) not ])
ifTrue: [ element background: Color lightYellow ].
element ].
mondrian := GtMondrian new.
mondrian nodes
stencil: stencilForNodes;
with: classes , superClasses.
mondrian edges connectToAll: #subclasses.
mondrian layout horizontalTree.
mondrian
@iriyak
Copy link
Author

iriyak commented Jul 12, 2025

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment