ListView.st
changeset 5031 06227d6d978d
parent 5030 297523e86a4e
child 5076 3172089d53a7
child 5086 6f3514837c99
equal deleted inserted replaced
5030:297523e86a4e 5031:06227d6d978d
  2870 
  2870 
  2871 getListFromModel
  2871 getListFromModel
  2872     "ask my model (if any) for the text via the listMsg.
  2872     "ask my model (if any) for the text via the listMsg.
  2873      If there is no listMessage, try aspect for backward compatibility."
  2873      If there is no listMessage, try aspect for backward compatibility."
  2874 
  2874 
  2875     |newText msg|
  2875     |newText msg doCompareIfUnchanged|
  2876 
  2876 
  2877     model notNil ifTrue:[
  2877     model notNil ifTrue:[
  2878         msg := listMsg ? aspectMsg.
  2878         msg := listMsg ? aspectMsg.
  2879 
  2879 
  2880         msg notNil ifTrue:[
  2880         msg notNil ifTrue:[
       
  2881             doCompareIfUnchanged := compareModelOnUpdate.
       
  2882 
  2881             newText := model perform:msg.
  2883             newText := model perform:msg.
  2882             "/ cg: this makes many optimizations (virtualArray) useless;
  2884             "/ cg: this makes many optimizations (virtualArray) useless;
  2883             "/ I do not think that this is a good idea:
  2885             "/ I do not think that this is a good idea:
  2884             "/     text notNil ifTrue:[
  2886             "/     text notNil ifTrue:[
  2885             "/ so I changed it to:
  2887             "/ so I changed it to:
  2886             (newText notNil and:[newText isString]) ifTrue:[
  2888             (newText notNil and:[newText isString]) ifTrue:[
  2887                 newText := newText asStringCollection.
  2889                 newText := newText asStringCollection.
  2888             ] ifFalse:[
  2890             ] ifFalse:[
  2889                 newText == model ifTrue:[
  2891                 newText == model ifTrue:[
  2890                     "/ I must operate on a copy
  2892                     "/ I must operate on a copy
  2891                     newText := model asNewOrderedCollection
  2893                     newText := model asNewOrderedCollection.
       
  2894                     "/ doCompareIfUnchanged := false.
  2892                 ].
  2895                 ].
  2893             ].
  2896             ].
  2894 
  2897 
  2895             compareModelOnUpdate ifTrue:[
  2898             doCompareIfUnchanged ifTrue:[
  2896                 "/ see if there is a change at all.
  2899                 "/ see if there is a change at all.
  2897                 "/ use to compare using =, but that's not enough in case of emphasis change.
  2900                 "/ use to compare using =, but that's not enough in case of emphasis change.
  2898                 newText size == list size ifTrue:[
  2901                 newText size == list size ifTrue:[
  2899                     |same|
  2902                     |same|
  2900 
  2903 
  5267 ! !
  5270 ! !
  5268 
  5271 
  5269 !ListView class methodsFor:'documentation'!
  5272 !ListView class methodsFor:'documentation'!
  5270 
  5273 
  5271 version
  5274 version
  5272     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.393 2014-05-17 15:23:36 cg Exp $'
  5275     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.394 2014-05-18 09:08:07 cg Exp $'
  5273 !
  5276 !
  5274 
  5277 
  5275 version_CVS
  5278 version_CVS
  5276     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.393 2014-05-17 15:23:36 cg Exp $'
  5279     ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.394 2014-05-18 09:08:07 cg Exp $'
  5277 ! !
  5280 ! !
  5278 
  5281