Spec
Spec copied to clipboard
Adding entry completion setter to SpRequestDialog
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