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

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Nov 18 11:01:02 UTC 2019


Hi Marcel,


Thank you for the explanation, I see my mistake. Would you still consider some method such as Process>>#runUntilMethod: or #runUntilClass:selector:? I think that only checking the selector is not really the desired behavior here, is it?


And even though this is a very minor point, I do not really like the "triangle layout" of these debug methods. Wouldn't the following variant provide a better rectangular layout? Just curious how patterns are applied here the best way :-)


[cid:be4bfc68-d213-4744-8768-c2fd5bca6280]


Aside from this, would you like me to upload the "debug accept action" again in a separate commit or is this easier to do for the merger? :-)


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Montag, 18. November 2019 09:28:23
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1590.mcz

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/6eb74aa6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 72890 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191118/6eb74aa6/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 74430 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191118/6eb74aa6/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 72727 bytes
Desc: pastedImage.png
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191118/6eb74aa6/attachment-0005.png>


More information about the Squeak-dev mailing list