[squeak-dev] The Trunk: Tools-mt.779.mcz

Eliot Miranda eliot.miranda at gmail.com
Wed Dec 20 16:57:41 UTC 2017


Thanks man!!  Happy Holidays to all!!

_,,,^..^,,,_ (phone)

> On Dec 18, 2017, at 11:39 PM, commits at source.squeak.org wrote:
> 
> Marcel Taeumel uploaded a new version of Tools to project The Trunk:
> http://source.squeak.org/trunk/Tools-mt.779.mcz
> 
> ==================== Summary ====================
> 
> Name: Tools-mt.779
> Author: mt
> Time: 19 December 2017, 8:39:28.282281 am
> UUID: 5e2d8ff5-fe52-c743-931e-637a058fcbd8
> Ancestors: Tools-eem.778
> 
> Fixes the behavior of "browser spawning" (via CMD+O), which affects "copy up or down..." of methods in the class tree.
> 
> Note that the rather new interface for building browsers via #newOnClass... introduced a serious deception in terms of which kind of browser (full, class, protocol) is being build. We have to make this more clear!
> 
> =============== Diff against Tools-eem.778 ===============
> 
> 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;
> -    newBrowser setClass: aClass;
> -         selectMessageCategoryNamed: aCategory;
>          selectMessageNamed: aSelector.
> 
>      newBrowser buildAndOpenMessageCategoryBrowserLabel: 'Message Category Browser (' , aClass name, ')'.
>      aString ifNotNil:[newBrowser changed: #editString with: aString].
>      ^newBrowser!
> 
> Item was changed:
>  ----- Method: CodeHolder>>buildClassBrowserEditString: (in category 'construction') -----
> + buildClassBrowserEditString: classDefinition 
> - buildClassBrowserEditString: aString 
>      "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: self selectedClassOrMetaClass
> +        editString: classDefinition
> +        label: 'Class Browser: ', self selectedClassOrMetaClass name)
> +            editSelection: #editClass; "...because we know it is class def code."
> +            changed: #editString with: classDefinition; "...trigger re-styling."
> +            yourself
> -    ^Browser newOnClass: self selectedClassOrMetaClass editString: aString label: 'Class Browser: ', self selectedClassOrMetaClass name
>  !
> 
> Item was added:
> + ----- 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)
> +            editSelection: #editMessage; "...because we know it is method code."
> +            changed: #editString with: methodSourceCode; "...trigger re-styling."
> +            yourself!
> 
> Item was removed:
> - ----- Method: CodeHolder>>buildMessageCategoryBrowserForClass:selector:editString: (in category 'construction') -----
> - buildMessageCategoryBrowserForClass: aClass selector: aSelectorOrNil editString: aString 
> -    "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."
> -    ^ Browser
> -        newOnClass: aClass
> -        messageCategory: self categoryOfCurrentMethod
> -        selector: aSelectorOrNil
> -        editString: aString
> -        label: 'Message category Browser: ' , self selectedClassOrMetaClass name , self categoryOfCurrentMethod!
> 
> Item was changed:
>  ----- Method: CodeHolder>>spawn: (in category 'commands') -----
>  spawn: aString 
>      "Create and schedule a spawned message category browser for the currently selected message category.  The initial text view contains the characters in aString.  In the spawned browser, preselect the current selector (if any) as the going-in assumption, though upon acceptance this will often change"
> 
> +    self selectedClassOrMetaClass
> +        ifNil: [
> +            ^ aString isEmptyOrNil ifFalse: [(Workspace new contents: aString) openLabel: 'spawned workspace']]
> +        ifNotNil: [:cls |
> +            self categoryOfCurrentMethod
> +                ifNil: [
> +                    self buildClassBrowserEditString: aString]
> +                ifNotNil: [:category |
> +                    self
> +                        buildMessageCategoryBrowserForCategory: category
> +                        class: cls
> +                        selector: self selectedMessageName
> +                        editString: aString]]!
> -    | aCategory aClass |
> -    (aClass := self selectedClassOrMetaClass) isNil ifTrue:
> -        [^ aString isEmptyOrNil ifFalse: [(Workspace new contents: aString) openLabel: 'spawned workspace']].
> - 
> -    (aCategory := self categoryOfCurrentMethod)
> -        ifNil:
> -            [self buildClassBrowserEditString: aString]
> -        ifNotNil:
> -            [self buildMessageCategoryBrowserForClass: aClass selector: self selectedMessageName editString: aString ]!
> 
> Item was changed:
>  ----- Method: CodeHolder>>spawnToClass: (in category 'commands') -----
>  spawnToClass: aClass
>      "Used to copy down code from a superclass to a subclass in one easy step, if you know what you're doing.  Spawns a new message-category browser for the indicated class, populating it with the source code seen in the current tool."
> 
>      self categoryOfCurrentMethod
> +        ifNil: [
> +            self buildClassBrowserEditString: self contents]
> +        ifNotNil: [:category |
> +            self
> +                buildMessageCategoryBrowserForCategory: category
> +                class: aClass
> +                selector: nil
> +                editString: self contents]!
> -        ifNil:
> -            [self buildClassBrowserEditString: self contents]
> -        ifNotNil:
> -            [self buildMessageCategoryBrowserForClass: aClass selector: nil editString: self contents]!
> 
> 


More information about the Squeak-dev mailing list