Spec icon indicating copy to clipboard operation
Spec copied to clipboard

Adding entry completion setter to SpRequestDialog

Open adri09070 opened this issue 9 months ago • 1 comments

This would allow to remove a dependency to UIManager in the StDebugger:

requestProtocolIn: aClass

	| entryCompletion applicants choice |
	self class fastTDD ifTrue: [ ^ Protocol unclassified ].
	applicants := self protocolSuggestionsFor: aClass.
	entryCompletion := EntryCompletion new
		                   dataSourceBlock: [ :currText | applicants ];
		                   filterBlock: [ :currApplicant :currText | 
			                   currText size > 3 and: [ 
					                   currApplicant asLowercase includesSubstring:
							                   currText asString asLowercase ] ].

	choice := (UIManager default
		           request:
		           'Start typing for suggestions (3 characters minimum)'
		           initialAnswer: Protocol unclassified
		           title: 'Choose a protocol'
		           entryCompletion: entryCompletion) ifNil: [ Abort signal ].

	^ choice ifEmpty: [ Protocol unclassified ]

Plus, overall, I think this is a good addition to add entry completion in a dialog that asks the user to write text

adri09070 avatar May 02 '24 12:05 adri09070