tim Rowledge uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-tpr.780.mcz==================== Summary ====================
Name: Tools-tpr.780
Author: tpr
Time: 20 December 2017, 11:47:36.353661 am
UUID: ff0363cd-738f-4147-bd36-ea2a42f23ffc
Ancestors: Tools-mt.779
Small improvement to the spawnToClass: related browser buiding - gets the initial slection cleaner etc
=============== Diff against Tools-mt.779 ===============
Item was changed:
----- Method: Browser class>>newOnClass:messageCategory:selector:editString:label: (in category 'instance creation') -----
newOnClass: aClass messageCategory: aCategory selector: aSelector editString: aString label: aLabel
"Open a new message protocol browser on this class & protocol with aString pre-selected in the code pane.
We have to be a bit sneaky to do the string insertion since it cannot be handled until after the actual browser is built and opened"
"Browser newOnClass: Browser messageCategory: 'controls' selector: #decorateButtons editString: 'test string edit setup' label: 'Testing class browser with set edit string'"
| newBrowser|
newBrowser := self new.
"setting up a new browser for a specific class, category and selector requires this order of messages
since the #selectMessageCategoryNamed: carefully nils the chosen selector; thus we can't use
the more obvious seeming #setClass:selector: method"
newBrowser
setClass: aClass;
selectMessageCategoryNamed: aCategory;
+ selectMessageNamed: aSelector;
+ editSelection: #editMessage.
- selectMessageNamed: aSelector.
newBrowser buildAndOpenMessageCategoryBrowserLabel: 'Message Category Browser (' , aClass name, ')'.
aString ifNotNil:[newBrowser changed: #editString with: aString].
^newBrowser!
Item was changed:
----- Method: CodeHolder>>buildMessageCategoryBrowserForCategory:class:selector:editString: (in category 'construction') -----
buildMessageCategoryBrowserForCategory: aCategory class: aClass selector: aSelectorOrNil editString: methodSourceCode
"Create and schedule a new class browser for the current selection,
with initial textual contents set to aString. This is used specifically in
spawning where a class is established but a method-category is not."
self flag: #uglyHack. "mt: We should not abuse Browser like this. We should not even know about #Browser in this superclass."
^ (Browser
newOnClass: aClass
messageCategory: aCategory
selector: aSelectorOrNil
editString: methodSourceCode
+ label: 'Message category Browser: ' , aClass name , aCategory)!
- label: 'Message category Browser: ' , aClass name , aCategory)
- editSelection: #editMessage; "...because we know it is method code."
- changed: #editString with: methodSourceCode; "...trigger re-styling."
- yourself!