The Trunk: ToolBuilder-Morphic-cmm.113.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ToolBuilder-Morphic-cmm.113.mcz

commits-2
Chris Muller uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-cmm.113.mcz

==================== Summary ====================

Name: ToolBuilder-Morphic-cmm.113
Author: cmm
Time: 1 April 2015, 2:39:58.323 pm
UUID: 85dfc77a-e0ca-47b4-b633-ac05b10332a8
Ancestors: ToolBuilder-Morphic-cmm.112

- Filter-navigation DNU when there is no selection.  Filtering still needs to be figured out for the roots of a tree...
- Restore Marcel's latest selectPath:in: from today.
- Don't rely on #selection: from setSelectedMorph: to fix selection-rendering in UI's, instead we should be sending proper changed notifications from each model.

=============== Diff against ToolBuilder-Morphic-cmm.112 ===============

Item was changed:
  ----- Method: PluggableTreeMorph>>filterTree (in category 'filtering') -----
  filterTree
  self hasFilter ifFalse:
  [ self removeFilter.
  ^ self ].
  self indicateFiltered.
  "Clean up the tree."
  (self selectedMorph
  ifNil: [ self roots ]
  ifNotNil:
  [ : m | {m} ]) do:
  [ : item | | filteredItems |
  item applyFilter: lastKeystrokes.
  item visible ifFalse:
  [ "Do not hide the item where the filter is based on."
  item show.
  item isExpanded ifFalse: [ item toggleExpandedState ] ].
  filteredItems := self filteredItems.
  "If configured as a navigation tool, advance the selection."
  (PluggableTreeMorph maximumSearchDepth = 1 and: [ PluggableTreeMorph filterByLabelsOnly not ]) ifTrue:
+ [ |toBeExpanded|
+ (filteredItems notEmpty and: [ selectedMorph ~= filteredItems last ]) ifTrue:
+ [ self setSelectedMorph:
+ (toBeExpanded := selectedMorph
+ ifNil: [ filteredItems first ]
+ ifNotNil: [ filteredItems after: selectedMorph ]).
+ toBeExpanded isExpanded ifFalse: [ toBeExpanded toggleExpandedState ] ] ] ].
- [ (filteredItems notEmpty and: [ selectedMorph ~= filteredItems last ]) ifTrue:
- [ self setSelectedMorph: (filteredItems after: selectedMorph).
- selectedMorph isExpanded ifFalse: [ selectedMorph toggleExpandedState ] ] ] ].
  self adjustSubmorphPositions!

Item was changed:
  ----- Method: PluggableTreeMorph>>selectPath:in: (in category 'selection') -----
  selectPath: path in: listItem
+ path isEmpty ifTrue: [^self selection: nil].
+
- path isEmpty ifTrue: [^self setSelectedMorph: nil].
  listItem withSiblingsDo: [:each |
  (each complexContents item = path first) ifTrue: [
  each isExpanded ifFalse: [
  each toggleExpandedState.
  self adjustSubmorphPositions.
  ].
  each changed.
  path size = 1 ifTrue: [
+ ^self selection: each complexContents
- ^self setSelectedMorph: each
  ].
+ each firstChild ifNil: [^self selection: nil].
- each firstChild ifNil: [^self setSelectedMorph: nil].
  ^self selectPath: path allButFirst in: each firstChild
  ].
  ].
+ ^self selection: nil
- ^self setSelectedMorph: nil
 
  !

Item was changed:
  ----- Method: PluggableTreeMorph>>setSelectedMorph: (in category 'selection') -----
  setSelectedMorph: aMorph
  selectedWrapper := aMorph complexContents.
- self selection: selectedWrapper.
  "Let the model now about the selected object, not wrapper."
  setSelectionSelector ifNotNil: [:symbol |
  model
  perform: symbol
  with: (selectedWrapper ifNotNil: [ selectedWrapper item ])].
-
  "The model may not have access to the parent object in terms of this tree structure."
  setSelectedParentSelector ifNotNil: [:symbol |
  model
  perform: symbol
  with: (selectedWrapper ifNotNil: [selectedWrapper parent ifNotNil: [: parentWrapper | parentWrapper item]])].!