InspectorView.st
changeset 19116 17ad5497260c
parent 19115 c35226ab9760
child 19190 861e8a05d3e9
equal deleted inserted replaced
19115:c35226ab9760 19116:17ad5497260c
  3204 !
  3204 !
  3205 
  3205 
  3206 displayStringForValue:someValue
  3206 displayStringForValue:someValue
  3207     "return the value's displayString to be pasted into the workspace."
  3207     "return the value's displayString to be pasted into the workspace."
  3208 
  3208 
  3209     |idx sel extraAttributes valueString|
  3209     |idx sel extraAttributes valueString valueOrBlock|
  3210 
  3210 
  3211     someValue == NoLongerPresentDummyObject ifTrue:[
  3211     someValue == NoLongerPresentDummyObject ifTrue:[
  3212         "/ this is returned by collection-inspectors,
  3212         "/ this is returned by collection-inspectors,
  3213         "/ when a field-index for a no-longer-present-index is selected
  3213         "/ when a field-index for a no-longer-present-index is selected
  3214         "/ (eg. if an OrderedCollection growed to a smaller size in the meantime)
  3214         "/ (eg. if an OrderedCollection growed to a smaller size in the meantime)
  3219     idx notNil ifTrue:[
  3219     idx notNil ifTrue:[
  3220         sel := self listEntryAt:idx.
  3220         sel := self listEntryAt:idx.
  3221         sel isNil ifTrue:[^ someValue].
  3221         sel isNil ifTrue:[^ someValue].
  3222 
  3222 
  3223         extraAttributes := self myObjectsInspectorExtraAttributes.
  3223         extraAttributes := self myObjectsInspectorExtraAttributes.
  3224         Error handle:[:ex |
  3224         "/ don't use valueIfPresent: here - not all collections support it
  3225             ^ '<< error in displayString: %1 >>' bindWith:ex description.
  3225         (extraAttributes includesKey:sel) ifTrue:[
  3226         ] do:[
  3226             valueOrBlock := extraAttributes at:sel.
  3227             extraAttributes at:sel ifPresent:[:extraAttributeBlock|
  3227             Error handle:[:ex |
       
  3228                 ^ '<< error in displayString: %1 >>' bindWith:ex description.
       
  3229             ] do:[
  3228                 "evaluate the extraAttributeBlock"
  3230                 "evaluate the extraAttributeBlock"
  3229                 ^ extraAttributeBlock value displayString
  3231                 ^ valueOrBlock value displayString
  3230             ].
  3232             ].
  3231         ].
  3233         ].
  3232 
  3234 
  3233         (sel startsWith:$-) ifTrue:[
  3235         (sel startsWith:$-) ifTrue:[
  3234             (valueString := self displayStringForPseudoSlot:sel) notNil ifTrue:[
  3236             (valueString := self displayStringForPseudoSlot:sel) notNil ifTrue:[