Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk: http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.344.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-mt.344 Author: mt Time: 9 June 2023, 1:53:39.558748 pm UUID: 3ee84953-f0e8-db43-85c1-b0c8203d2a1b Ancestors: ToolBuilder-Morphic-ct.343
Complement Morphic-mt.2112
=============== Diff against ToolBuilder-Morphic-ct.343 ===============
Item was changed: ----- Method: PluggableTreeMorph>>filterTreeNow (in category 'filtering') ----- filterTreeNow
self hasFilter ifFalse: [^ self removeFilter]. "Show all current items again before filtering them out." self items do: [:item | item removeFilter]. (self filterMode caseOf: { [#siblings] -> [self filterTreeNowSiblings "default"]. [#visible] -> [self filterTreeNowVisible]. [#all] -> [self filterTreeNowAll] }) ifFalse: [ "Remove the last character and try filtering again." lastKeystrokes := lastKeystrokes allButLast: 1. ^ self filterTreeNow]. + + self itemsChanged.! - - self adjustSubmorphPositions.!
Item was changed: ----- Method: PluggableTreeMorph>>fixateSelectionDuring: (in category 'selection') ----- fixateSelectionDuring: aBlock
| vDelta | selectedMorph ifNil: [aBlock value. ^ self]. vDelta := ((selectedMorph localPointToGlobal: selectedMorph topLeft) - (scroller localPointToGlobal: scroller topLeft)) y. aBlock value. (selectedMorph notNil and: [selectedMorph visible]) ifTrue: [ + self fullBounds. "Compute layout for correct scrolling." self scrollToBottom. self scrollToShow: (selectedMorph bounds outsetBy: (0@vDelta corner: 0@0))].!
Item was changed: ----- Method: PluggableTreeMorph>>removeFilter (in category 'filtering') ----- removeFilter "Remove the current filter. Keep the current selection stable unless it is expanded and needs more space for its children. Note that we must not check for #hasFilter here but in the sender if needed; see #filterTreeNow."
lastKeystrokes := String empty.
self filterMode = #all ifTrue: [ self items do: [:item | item removeFilter]. self collapseAllButSelection] ifFalse: [ self fixateSelectionDuring: [ self items do: [:item | item removeFilter]. + self itemsChanged]]. - self adjustSubmorphPositions]].
"Try to show all children again for the current selection." self scrollSelectionAndChildrenIntoView. self scrollSelectionAndExtraIntoView.!
Item was changed: ----- Method: PluggableTreeMorph>>selectPath: (in category 'selection') ----- selectPath: path "Select the given path. Do not tell the model. Just update the view."
| newSelection | path ifNil: [^ self]. path ifEmpty: [^ self selectedMorph: nil]. self items ifEmpty: [^ self].
newSelection := self selectPath: path in: self items first. + self itemsChanged. - self adjustSubmorphPositions. "First adjust, then select to keep selection visible." self selectedMorph: newSelection.!
Item was changed: ----- Method: PluggableTreeMorph>>selectPath:in: (in category 'selection') ----- selectPath: path in: listItem + "Private. Use #selectPath: because this here does not invalidate the item's layout for performance reasons." - "Private. Use #selectPath:."
listItem withSiblingsDo: [:each | each complexContents item = path first ifTrue: [ each extension visible: true. "Ensure visibility in case of a filter." path size = 1 ifTrue: [ "Complete match. Finished." ^ each]. each isExpanded ifFalse: [ each toggleExpandedState]. ^ each firstChild ifNotNil: [:firstChild | "Partial match. Go on..." self selectPath: path allButFirst in: firstChild]]]. ^ nil!
Item was changed: ----- Method: PluggableTreeMorph>>toggleExpandedState: (in category 'keyboard navigation') ----- toggleExpandedState: aMorph
aMorph toggleExpandedState. - self adjustSubmorphPositions. aMorph isExpanded ifTrue: [self scrollSelectionAndChildrenIntoView] ifFalse: [self scrollSelectionAndExtraIntoView].!
Item was changed: ----- Method: PluggableTreeMorph>>update:with: (in category 'updating') ----- update: what with: anObject
super update: what with: anObject. what == #objectChanged ifTrue: [ ^ self updateFromChangedObject: anObject]. what == #expandAllNodesRequested ifTrue: [ "EX: model changed: #expandAllNodesRequested with: #classChildren:." "EX: model changed: #expandAllNodesRequested with: {#classChildren:. Morph}." | scope item | scope := anObject isArray ifTrue: [anObject first] ifFalse: [anObject]. item := anObject isArray ifTrue: [anObject second]. getChildrenSelector == scope ifTrue: [ item ifNil: [self roots do: [:ea | self expandAll: ea]] ifNotNil: [self expandAll: (self items detect: [:ea | ea complexContents item == item])]. - self adjustSubmorphPositions. ^ self]]. what == #expandNodeRequested ifTrue: [ "EX: model changed: #expandNodeRequested with: {#classChildren:. Morph}." | scope item | scope := anObject first. item := anObject second. getChildrenSelector == scope ifTrue: [ self items detect: [:ea | ea complexContents item == item] ifFound: [:morph | (morph canExpand and: [morph isExpanded not]) ifTrue: [self toggleExpandedState: morph]]. ^ self]].!
Item was changed: ----- Method: PluggableTreeMorph>>updateMorph: (in category 'updating') ----- updateMorph: morph
morph complexContents refresh. morph refresh. morph isExpanded ifFalse: [self changed] ifTrue: [ morph toggleExpandedState; + toggleExpandedState]. - toggleExpandedState. - self adjustSubmorphPositions]. !
packages@lists.squeakfoundation.org