usman 

what is the expected behavior?
Because I replace 

the last line with 
        ^ container emptySelection

but I do not know if the result is what is expected.

Stef


On Jan 31, 2013, at 12:48 PM, Usman Bhatti wrote:

> 
> 
> 
> On Thu, Jan 31, 2013 at 1:20 PM, Stéphane Ducasse <stephane.duca...@inria.fr> 
> wrote:
> Usman did you check with 1.3 to know if the method was there?
> 
> I looked in 1.3. The method is defined on MorphTreeMorph (see sceenshot) but 
> absent from this class in 1.4. Copying and pasting the method from 1.3 to 1.4 
> in the class does not work, there are some missing instance variables in the 
> code. 
> The number of implementing classes for setSelectedMorph: does not change 
> between 1.3 and 1.4. To me it seems that the method was moved to 
> MorphTreeListManager in 1.4. It tried to change the receiver to invoke the 
> method on MorphTreeListManager but there are some other problems then.
> 
> <image.png>
>  
> 
> Stef
> 
> On Jan 31, 2013, at 7:03 AM, Usman Bhatti wrote:
> 
> >
> >
> >
> > On Thu, Jan 31, 2013 at 2:30 AM, Stéphane Ducasse 
> > <stephane.duca...@inria.fr> wrote:
> > Morbid fascination
> > It is late so I may completely off but
> > how many isKindOf: are executed in this method?
> >
> > > ((aSymbol isKindOf: Array)
> > >               and: [aSymbol size > 1 and: [aSymbol first == self 
> > > nodeListSelector and: [
> > >                                       aSymbol second == #openPath]]])
> >
> > when  [aSymbol second == #openPath] is not openPath
> > then we go to the next (not mentioning duplicated code inside the method 
> > ---- I will vomit)
> > and we restart to execute isKindOf:
> >
> > ((aSymbol isKindOf: Array)
> >                 and: [aSymbol size > 1 and: [aSymbol first == self 
> > nodeListSelector and: [
> >                                         aSymbol second == 
> > #expandAllFromNode:]]])
> >
> > Am'I right?
> > It looks so terrible.
> >
> > Yes. And more so for someone not frequently working with Morphs.
> > So, can someone at least see if the problem can be fixed without a large 
> > refactoring that should surely happen, but the glamour bug needs a quick 
> > fix. Or at least point to why the missing method on the receiver is 
> > abundantly found in the code?
> >
> > usman
> >
> >
> > Stef
> >
> >
> >
> > > update: aSymbol
> > >       aSymbol == #selection ifTrue: [^ self listManager 
> > > updateSelectionFromModel].
> > >       ((aSymbol  isKindOf: Array)     and: [aSymbol size > 1 and: 
> > > [aSymbol first == #selectItems and: [aSymbol second isCollection]]])
> > >               ifTrue: [^ self selectedItems: aSymbol second].
> > >       aSymbol == self nodeListSelector ifTrue: [^ self updateList].
> > >       aSymbol == #selectAll ifTrue: [^ self listManager selectAll].
> > >       aSymbol == #deselectAll ifTrue: [^ self listManager deselectAll].
> > >       ((aSymbol isKindOf: Array)
> > >               and: [aSymbol size > 1 and: [aSymbol first == self 
> > > nodeListSelector and: [
> > >                                       aSymbol second == #openPath]]]) 
> > > "allow directed path opening where multiple trees exist"
> > >                       ifTrue:
> > >                               [^(self allNodeMorphs at: 1 ifAbsent: 
> > > [^self])
> > >                                       openPath: (aSymbol allButFirst: 2)].
> > >       ((aSymbol isKindOf: Array)
> > >               and: [aSymbol size > 1 and: [aSymbol first == self 
> > > nodeListSelector and: [
> > >                                       aSymbol second == #openItemPath]]]) 
> > > "allow directed path opening where multiple trees exist"
> > >                       ifTrue:
> > >                               [^ (self allNodeMorphs at: 1 ifAbsent: 
> > > [^self])
> > >                                       openItemPath: (aSymbol allButFirst: 
> > > 2)].
> > >       ((aSymbol isKindOf: Array)
> > >               and: [aSymbol size > 1 and: [aSymbol first == self 
> > > nodeListSelector and: [
> > >                                       aSymbol second == 
> > > #expandAllFromNode:]]])
> > >                       ifTrue:
> > >                               [^ self expandAllFromNode: aSymbol third].
> > >       ((aSymbol isKindOf: Array)
> > >               and: [aSymbol size > 1 and: [aSymbol first == self 
> > > nodeListSelector and: [
> > >                                       aSymbol second == 
> > > #closeItemPath]]]) "allow directed path closing where multiple trees 
> > > exist"
> > >                       ifTrue:
> > >                               [^ (self allNodeMorphs at: 1 ifAbsent: 
> > > [^self])
> > >                                       closeItemPath: (aSymbol 
> > > allButFirst: 2)].
> > >       ((aSymbol isKindOf: Array)
> > >               and: [aSymbol notEmpty and: [aSymbol first == #openPath]])
> > >                       ifTrue:
> > >                               [^(self allNodeMorphs at: 1 ifAbsent: 
> > > [^self])
> > >                                       openPath: aSymbol allButFirst].
> > >       ((aSymbol isKindOf: Array)
> > >               and: [aSymbol size  = 2 and: [aSymbol first = self 
> > > nodeListSelector and: [
> > >                                       aSymbol second == #expandRoots]]])
> > >                       ifTrue:
> > >                               [^self expandRoots].
> > >       ((aSymbol isKindOf: Array)
> > >               and: [aSymbol size = 2 and: [aSymbol first = self 
> > > nodeListSelector]])
> > >               ifTrue: [aSymbol second = #expandAll ifTrue: [^ self 
> > > expandAll].
> > >                       aSymbol second = #collapseAll ifTrue: [^ self 
> > > collapseAll]]
> >
> >
> >
> 
> 
> 


Reply via email to