SelectionInListModelView.st
changeset 5796 10442dd55669
parent 5794 1de9ace50ec4
child 5807 0781fe0f6da9
equal deleted inserted replaced
5795:26cb086b7d66 5796:10442dd55669
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1999 by eXept Software AG
     4  COPYRIGHT (c) 1999 by eXept Software AG
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  2012     lineNr isNil ifTrue:[ ^ nil ].
  2014     lineNr isNil ifTrue:[ ^ nil ].
  2013 
  2015 
  2014     item := self at:lineNr ifAbsent:nil.
  2016     item := self at:lineNr ifAbsent:nil.
  2015     item notNil ifTrue:[
  2017     item notNil ifTrue:[
  2016         line := item perform:#label ifNotUnderstood:[item displayString].
  2018         line := item perform:#label ifNotUnderstood:[item displayString].
  2017         line isString ifTrue:[
  2019         (line isString or:[line isLabelAndIcon]) ifTrue:[
  2018             line := line string.
  2020             line := line string.
  2019             line := line withoutSeparators.
  2021             line := line withoutSeparators.
  2020         ].
  2022         ].
  2021     ].
  2023     ].
  2022     line notNil ifTrue:[
  2024     line notNil ifTrue:[
  2023         len := self widthOfWidestLineBetween:lineNr and:lineNr.
  2025         len := self widthOfWidestLineBetween:lineNr and:lineNr.
  2024         len > width ifTrue:[
  2026         len > width ifTrue:[
  2025             text := line collect:[:ch | ch isSeparator ifTrue:[Character space] ifFalse:[ch]].
  2027             (line isString or:[line isLabelAndIcon]) ifTrue:[
       
  2028                 text := line string collect:[:ch | ch isSeparator ifTrue:[Character space] ifFalse:[ch]].
       
  2029             ].
  2026         ].
  2030         ].
  2027     
  2031     
  2028         "/ a hack; maybe we'll find a better solution...
  2032         "/ a hack; maybe we'll find a better solution...
  2029         (line respondsTo:#helpText) ifTrue:[
  2033         (line respondsTo:#helpText) ifTrue:[
  2030             (text2 := line helpText) notEmptyOrNil ifTrue:[
  2034             (text2 := line helpText) notEmptyOrNil ifTrue:[
  2039     ].
  2043     ].
  2040     
  2044     
  2041     ^ text
  2045     ^ text
  2042 
  2046 
  2043     "Modified: / 20-02-2017 / 10:11:58 / cg"
  2047     "Modified: / 20-02-2017 / 10:11:58 / cg"
  2044     "Modified: / 08-06-2018 / 15:21:58 / Claus Gittinger"
  2048     "Modified: / 10-06-2018 / 18:35:41 / Claus Gittinger"
  2045 ! !
  2049 ! !
  2046 
  2050 
  2047 !SelectionInListModelView methodsFor:'initialization & release'!
  2051 !SelectionInListModelView methodsFor:'initialization & release'!
  2048 
  2052 
  2049 fetchResources
  2053 fetchResources