EditFieldWithCompletion.st
branchjv
changeset 16766 974c719caa4f
parent 16729 087537207973
child 17136 cb908d2ba02e
equal deleted inserted replaced
16765:589cf9d699fe 16766:974c719caa4f
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 2006 by eXept Software AG
     2  COPYRIGHT (c) 2006 by eXept Software AG
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
   340         ^ self
   338         ^ self
   341     ].
   339     ].
   342     
   340     
   343     best := completionInfo first.
   341     best := completionInfo first.
   344     options := completionInfo second.
   342     options := completionInfo second.
   345     best isNil ifTrue:[self halt ].
   343 "/    best isNil ifTrue:[self halt ].
   346 "/    (options includes:best) ifFalse:[
   344     (options includes:best) ifFalse:[
   347 "/        best := options 
   345         best := options 
   348 "/                    detect:[:e | e asString startsWith:best asString ]
   346                     detect:[:e | e asString startsWith:best asString ]
   349 "/                    ifNone:[ best ]
   347                     ifNone:[ best ]
   350 "/    ].
   348     ].
   351 "/    options isSortedCollection ifFalse:[
   349     options isSortedCollection ifFalse:[
   352 "/        options := options asSortedCollection:[:a :b | a displayString < b displayString ]
   350         options := options asSortedCollection:[:a :b | a displayString < b displayString ]
   353 "/    ].
   351     ].
   354     self sensor 
   352     self sensor 
   355         pushUserEvent:selector
   353         pushUserEvent:selector
   356         for:self
   354         for:self
   357         withArguments:(Array with:best with:options).
   355         withArguments:(Array with:best with:options).
   358 
   356 
   359     "Created: / 26-07-2009 / 17:45:09 / Jan Vrany <vranyj1@fel.cvut.cz>"
   357     "Created: / 26-07-2009 / 17:45:09 / Jan Vrany <vranyj1@fel.cvut.cz>"
   360     "Modified: / 09-08-2009 / 02:51:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
   358     "Modified: / 09-08-2009 / 02:51:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
   361     "Modified: / 18-11-2011 / 14:33:56 / cg"
   359     "Modified: / 18-11-2011 / 14:33:56 / cg"
   362     "Modified (format): / 20-11-2011 / 09:42:25 / cg"
   360     "Modified (format): / 20-11-2011 / 09:42:25 / cg"
   363     "Modified: / 20-04-2012 / 18:20:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   361     "Modified: / 25-07-2016 / 07:55:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   364 !
   362 !
   365 
   363 
   366 doTabCompletion
   364 doTabCompletion
   367     self doCompletionThenSend:#tabCompletion:options:
   365     self doCompletionThenSend:#tabCompletion:options:
   368 !
   366 !
   450 
   448 
   451 version_CVS
   449 version_CVS
   452     ^ '$Header$'
   450     ^ '$Header$'
   453 !
   451 !
   454 
   452 
       
   453 version_HG
       
   454 
       
   455     ^ '$Changeset: <not expanded> $'
       
   456 !
       
   457 
   455 version_SVN
   458 version_SVN
   456     ^ '$Id$'
   459     ^ '$Id$'
   457 ! !
   460 ! !
   458 
   461