Hi All,
David R. and I are playing with Glamour, a cool framework to define
browsers. Currently, the Moose browser @ Pharo uses OB. Although it
works fine, it sticks to the Smalltalk way of browsing code, which we
find a bit limited.
I apology in advance for cutting & pasting code here. We defined the
following method:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
mooseFinder
| browser |
browser := GLMFinder new .
browser list
display: [:each | each entities];
when: [:each | "(each isKindOf: MooseAbstractGroup)" each ==
MooseModel root ].
browser list
title: 'Classes';
display: [:each | each allClasses ];
when: [:each | (each isKindOf: MooseAbstractGroup) and: [each
allClasses notEmpty] ].
browser list
title: 'Methods';
display: [:each | each allMethods ];
when: [:each | (each isKindOf: MooseAbstractGroup) and: [each
allMethods notEmpty] ].
browser list
title: 'Superclasses';
display: [:each | each superclassHierarchyGroup ];
when: [:each | (each isKindOf: FAMIXClass) and: [each
superclassHierarchyGroup notEmpty]].
browser list
title: 'Subclasses';
display: [:each | each subclassHierarchy ];
when: [:each | (each isKindOf: FAMIXClass) and: [each
subclassHierarchy notEmpty]].
^ browser
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
It shows up a small MacOSX-like finder that shows classes,
superclasses and subclasses. Very cool!
Few questions now:
- Lists (Classes, Methods, Superclasses, Subclasses) are statically
defined. In Moose however, these are defined with pragmas. How can we
describe the automatic generations of lists?
- If we want to embed this browser into a bigger one, how do we pass
the right-most selected element ? Using a GLMTableLayoutBrowser, one
would do a "browser sendTo: #outer -> #selectedElement from:
#element" (modulo names). Here, we need something like "browser
sendTo: #outer -> #lastSelection".
Cheers,
David & Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.