[squeak-dev] The Inbox: Morphic-ct.1590.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Nov 18 08:28:23 UTC 2019


Hi, Christoph.

-1 for the refactoring of all "debug action". 

The use of ToolSet here feels less object-oriented than working with an actual process object, which is easy to create.

Also, #debugWithTitle: ends up nicely in ToolSet already. No benefit in expanding the interface of ToolSet any further for this scenario.

Best,
Marcel
Am 15.11.2019 19:55:36 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1590.mcz

==================== Summary ====================

Name: Morphic-ct.1590
Author: ct
Time: 15 November 2019, 7:55:13.975005 pm
UUID: 1f877d26-b019-fb45-9020-7c902b002b46
Ancestors: Morphic-mt.1588

Add "debug accept action" into debug menu of PluggableTextMorph. Furthermore, refactor all "debug action" code in this package by using ToolSet>>#debugBlock:runUntilMethod:withTitle:.

Complements System-ct.1121.

=============== Diff against Morphic-mt.1588 ===============

Item was added:
+ ----- Method: MenuItemMorph>>actionMethod (in category 'browse') -----
+ actionMethod
+
+ ^ (target class lookupSelector: selector) methodReference!

Item was changed:
----- Method: MenuItemMorph>>browseImplementationOfActionSelector (in category 'browse') -----
browseImplementationOfActionSelector

+ ^ self actionMethod browse!
- | method |
- method := target class lookupSelector: selector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: MenuItemMorph>>debugAction (in category 'browse') -----
debugAction

+ ^ ToolSet
+ debugBlock: [self doButtonAction]
+ runUntilMethod: self actionMethod
+ withTitle: ('Debug menu action "{1}" in model "{2}"' format: {self contents. self target printString})!
- (Process
- forBlock: [self doButtonAction]
- runUntil: [:context | context selector = self selector])
- debugWithTitle: ('Debug menu action "{1}" in model "{2}"' format: {self contents. self target printString}).!

Item was added:
+ ----- Method: PluggableButtonMorph>>actionMethod (in category 'debug menu') -----
+ actionMethod
+
+ ^ (model class lookupSelector: actionSelector) methodReference!

Item was changed:
----- Method: PluggableButtonMorph>>browseImplementationOfActionSelector (in category 'debug menu') -----
browseImplementationOfActionSelector

+ ^ self actionMethod browse!
- | method |
- method := model class lookupSelector: actionSelector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: PluggableButtonMorph>>debugAction (in category 'debug menu') -----
debugAction

+ ^ ToolSet
+ debugBlock: [self performAction]
+ runUntilMethod: self actionMethod
+ withTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString})!
- (Process
- forBlock: [self performAction]
- runUntil: [:context | context selector = self actionSelector])
- debugWithTitle: ('Debug button action "{1}" in model "{2}"' format: {self label. self target printString}).!

Item was changed:
----- Method: PluggableListMorph>>browseImplementationOfGetListSelector (in category 'debug and other') -----
browseImplementationOfGetListSelector

+ ^ self getListMethod browse!
- | method |
- method := model class lookupSelector: getListSelector.
- ToolSet browse: method methodClass selector: method selector.!

Item was changed:
----- Method: PluggableListMorph>>debugGetList (in category 'debug and other') -----
debugGetList

+ ^ ToolSet
+ debugBlock: [model perform: getListSelector]
+ runUntilMethod: self getListMethod
+ withTitle: ('Debug get-list invocation in model "{1}"' format: {model printString})!
- (Process
- forBlock: [model perform: getListSelector]
- runUntil: [:context | context selector = getListSelector])
- debugWithTitle: ('Debug get-list invocation in model "{1}"' format: {model printString}).!

Item was added:
+ ----- Method: PluggableListMorph>>getListMethod (in category 'debug and other') -----
+ getListMethod
+
+ ^ (self model class lookupSelector: self getListSelector) methodReference!

Item was added:
+ ----- Method: PluggableTextMorph>>acceptMethod (in category 'debug and other') -----
+ acceptMethod
+
+ ^ (self model class lookupSelector: self setTextSelector) methodReference!

Item was added:
+ ----- Method: PluggableTextMorph>>browseImplementationOfAcceptSelector (in category 'debug and other') -----
+ browseImplementationOfAcceptSelector
+
+ ^ self acceptMethod browse!

Item was added:
+ ----- Method: PluggableTextMorph>>buildDebugMenu: (in category 'debug and other') -----
+ buildDebugMenu: aHandMorph
+
+ | aMenu |
+ aMenu := super buildDebugMenu: aHandMorph.
+ aMenu addLine.
+ aMenu add: 'browse accept action' translated target: self action: #browseImplementationOfAcceptSelector.
+ aMenu add: 'debug accept action' translated target: self action: #debugAccept.
+ ^ aMenu!

Item was added:
+ ----- Method: PluggableTextMorph>>debugAccept (in category 'debug and other') -----
+ debugAccept
+
+ ^ ToolSet
+ debugBlock: [self acceptTextInModel]
+ runUntilMethod: self acceptMethod
+ withTitle: ('Debug accept action in model "{1}"' format: {self model})!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191118/f2364635/attachment.html>


More information about the Squeak-dev mailing list