The Trunk: Collections-ct.1117.mcz

[email protected] Mon, 27 Jul 2026 06:51:26 0000
Newsgroups gmane.comp.lang.smalltalk.squeak.general
Message-ID <[email protected]>
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ct.1117.mcz

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

Name: Collections-ct.1117
Author: ct
Time: 29 June 2026, 1:31:27.198636 am
UUID: e3fde637-09f3-4bd2-ab79-5fcc627cdd9c
Ancestors: Collections-ct.1115

Adds menu items for editing and debugging TextURLs.
Depends on Morphic-ct.2215. If we can merge those two versions prior to the release, this will greatly improve the explorability of the currently >100 interactive examples in the new release notes. :-)

=============== Diff against Collections-ct.1115 ===============

Item was added:
+ ----- Method: TextURL>>debugActionFor:in:at: (in category 'menu') -----
+ debugActionFor: model in: aParagraph at: clickPoint
+ 
+ 	| index range text |
+ 	index := (aParagraph characterBlockAtPoint: clickPoint) stringIndex.
+ 	range := aParagraph text rangeOf: self startingAt: index.
+ 	text := aParagraph text copyFrom: range start to: range stop.
+ 	(Process
+ 		forBlock:
+ 			((self url beginsWith: 'code://')
+ 				ifTrue: [[self open: (Compiler evaluate: (url allButFirst: 7))]]
+ 				ifFalse: [[self actOnClickFor: model]])
+ 		runUntil: [:context | context closure isNil and:
+ 			[(context receiver isNil and: [context selector isDoIt]) or:
+ 				[context receiver == self and: [context selector == #actOnClickFor:]]]])
+ 			debugWithTitle: ('Debug URL action of "{1}"' translated format: {(text truncateWithEllipsisTo: 40) escapeQuote: $"}).!

Item was added:
+ ----- Method: TextURL>>editUrl (in category 'menu') -----
+ editUrl
+ 
+ 	^ self editUrlOrCancel: nil!

Item was added:
+ ----- Method: TextURL>>editUrlOrCancel: (in category 'menu') -----
+ editUrlOrCancel: cancelBlock
+ 
+ 	| answer |
+ 	answer := Project uiManager
+ 		multiLineRequest: 'URL to open' translated
+ 		initialAnswer: self url.
+ 	answer isEmptyOrNil ifTrue: [^ cancelBlock value].
+ 	self url: answer.!

Item was added:
+ ----- Method: TextURL>>menu:for:in:at:editor: (in category 'menu') -----
+ menu: menu for: model in: aParagraph at: clickPoint editor: anEditor
+ 
+ 	^ menu
+ 		add: 'debug action' translated target: self selector: #debugActionFor:in:at: argumentList: {model. aParagraph. clickPoint};
+ 		add: 'edit url...' translated target: self selector: #editUrl argumentList: #();
+ 		yourself!

Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]