# HG changeset patch # User Claus Gittinger # Date 1132325720 -3600 # Node ID 7fc7cad1a67c0c7e1e0eacdd4e5bb13f516e237f # Parent 3d722618d37ce262fe8cabb009f59e9137f1e666 *** empty log message *** diff -r 3d722618d37c -r 7fc7cad1a67c Tools_MethodCategoryList.st --- a/Tools_MethodCategoryList.st Tue Nov 08 17:49:17 2005 +0100 +++ b/Tools_MethodCategoryList.st Fri Nov 18 15:55:20 2005 +0100 @@ -373,203 +373,204 @@ rawProtocolListHolder := self rawProtocolList. changedObject == Smalltalk ifTrue:[ - classes notNil ifTrue:[ - something == #methodCategory ifTrue:[ - cls := aParameter at:1. - (cls notNil and:[classes includesIdentical:cls]) ifTrue:[ - mthd := aParameter at:2. - newProtocol := mthd category. - oldProtocol := aParameter at:3. + classes notNil ifTrue:[ + something == #methodCategory ifTrue:[ + cls := aParameter at:1. + (cls notNil and:[classes includesIdentical:cls]) ifTrue:[ + mthd := aParameter at:2. + newProtocol := mthd category. + oldProtocol := aParameter at:3. - self invalidateList. + self invalidateList. - selectedCategories := selectedProtocolsHolder value. - selectedCategories size > 0 ifTrue:[ - selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. - selectedCategories := selectedCategories collect:[:each | each string]. + selectedCategories := selectedProtocolsHolder value. + selectedCategories size > 0 ifTrue:[ + selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. + selectedCategories := selectedCategories collect:[:each | each string]. - ((selectedCategories includes:oldProtocol) - or:[ (selectedCategories includes:newProtocol) - or:[ selectedCategories includes:(self class nameListEntryForALL) ]]) - ifTrue:[ - self updateOutputGenerator. - ]. - ]. + ((selectedCategories includes:oldProtocol) + or:[ (selectedCategories includes:newProtocol) + or:[ selectedCategories includes:(self class nameListEntryForALL) ]]) + ifTrue:[ + self updateOutputGenerator. + ]. + ]. - ]. - ^ self - ]. + ]. + ^ self + ]. - something == #methodInClass ifTrue:[ - "/ a method has been added/removed/changed - cls := aParameter at:1. - (classes includesIdentical:cls) ifTrue:[ - sel := aParameter at:2. - oldMethod := aParameter at:3. - newMethod := cls compiledMethodAt:sel. - oldMethod notNil ifTrue:[ - variableFilter value size > 0 ifTrue:[ - "/ sigh - must invalidate - self invalidateList. - ]. - ^ self. - ]. - "/ method was added - update the methodList - "/ Q: is this needed (methodCategoryList should send me a new inGenerator) - self invalidateList. + something == #methodInClass ifTrue:[ + "/ a method has been added/removed/changed + cls := aParameter at:1. + (classes includesIdentical:cls) ifTrue:[ + sel := aParameter at:2. + oldMethod := aParameter at:3. + newMethod := cls compiledMethodAt:sel. + oldMethod notNil ifTrue:[ + variableFilter value size > 0 ifTrue:[ + "/ sigh - must invalidate + self invalidateList. + ]. + ^ self. + ]. + "/ method was added - update the methodList + "/ Q: is this needed (methodCategoryList should send me a new inGenerator) + self invalidateList. - "/ if its category is selected, updateOutputGenerator - selectedCategories := selectedProtocolsHolder value. - selectedCategories size > 0 ifTrue:[ - selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. - selectedCategories := selectedCategories collect:[:each | each string]. + "/ if its category is selected, updateOutputGenerator + selectedCategories := selectedProtocolsHolder value. + selectedCategories size > 0 ifTrue:[ + selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. + selectedCategories := selectedCategories collect:[:each | each string]. - ((oldMethod notNil and:[selectedCategories includes:(oldMethod category)]) - or:[ (newMethod notNil and:[selectedCategories includes:(newMethod category)])]) - ifTrue:[ - self updateOutputGenerator. - ]. - ]. - ]. - ^ self. - ]. + ((oldMethod notNil and:[selectedCategories includes:(oldMethod category)]) + or:[ (newMethod notNil and:[selectedCategories includes:(newMethod category)])]) + ifTrue:[ + self updateOutputGenerator. + ]. + ]. + ]. + ^ self. + ]. - something == #methodInClassRemoved ifTrue:[ - cls := aParameter at:1. - (classes includesIdentical:cls) ifTrue:[ - sel := aParameter at:2. - "/ method was removed - update the list and output generator - self invalidateList. - "/ self updateOutputGenerator. - self slaveMode value == true ifFalse:[ - self enqueueDelayedUpdateOutputGenerator. - ] - ]. - ^ self. - ]. + something == #methodInClassRemoved ifTrue:[ + cls := aParameter at:1. + (classes includesIdentical:cls) ifTrue:[ + sel := aParameter at:2. + "/ method was removed - update the list and output generator + self invalidateList. + "/ self updateOutputGenerator. + self slaveMode value == true ifFalse:[ + self enqueueDelayedUpdateOutputGenerator. + ] + ]. + ^ self. + ]. - something == #classOrganization ifTrue:[ - cls := aParameter. - (classes includesIdentical:cls) ifTrue:[ - self invalidateList. - ] ifFalse:[ - (classes contains:[:aClass | aClass name = cls name]) ifTrue:[ - self error:'obsolete class: should not happen'. - ] - ]. - ^ self. - ]. + something == #classOrganization ifTrue:[ + cls := aParameter. + (classes includesIdentical:cls) ifTrue:[ + self invalidateList. + ] ifFalse:[ + (classes contains:[:aClass | aClass name = cls name]) ifTrue:[ + self invalidateList. + "/ self error:'obsolete class: should not happen'. + ] + ]. + ^ self. + ]. - something == #projectOrganization ifTrue:[ - aParameter notNil ifTrue:[ - cls := aParameter at:1. - cls notNil ifTrue:[ - ((classes includes:cls theMetaclass) - or:[(classes includes:cls theNonMetaclass)]) ifTrue:[ - self invalidateList. - self slaveMode value == true ifFalse:[ - self enqueueDelayedUpdateOutputGenerator. - ] - ]. - ]. - ] ifFalse:[ - self invalidateList. - ]. - ^ self - ]. + something == #projectOrganization ifTrue:[ + aParameter notNil ifTrue:[ + cls := aParameter at:1. + cls notNil ifTrue:[ + ((classes includes:cls theMetaclass) + or:[(classes includes:cls theNonMetaclass)]) ifTrue:[ + self invalidateList. + self slaveMode value == true ifFalse:[ + self enqueueDelayedUpdateOutputGenerator. + ] + ]. + ]. + ] ifFalse:[ + self invalidateList. + ]. + ^ self + ]. - (something == #classDefinition or:[something == #classVariables]) - ifTrue:[ - self classDefinitionChanged:aParameter. - ^ self - ]. + (something == #classDefinition or:[something == #classVariables]) + ifTrue:[ + self classDefinitionChanged:aParameter. + ^ self + ]. - "/ everything else is ignored - "/ self halt. - ]. - ^ self + "/ everything else is ignored + "/ self halt. + ]. + ^ self ]. changedObject == self selectedProtocolIndices ifTrue:[ - oldSelectedProtocols := selectedProtocolsHolder value ? #(). - oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. - oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. - newSelectedProtocols := self getSelectedProtocolsFromIndices. - oldSelectedProtocols ~= newSelectedProtocols ifTrue:[ - selectedProtocolsHolder value:newSelectedProtocols. - ]. - newSelectedProtocols size > 1 ifTrue:[ - (newSelectedProtocols includes:(self class nameListEntryForALL)) ifTrue:[ - rawProtocolList := rawProtocolListHolder value. - idx := rawProtocolList indexOf: (newSelectedProtocols copy remove:(self class nameListEntryForALL); yourself) first. - idx ~~ 0 ifTrue:[ - (listView := self builder componentAt:#List) notNil ifTrue:[ - listView makeLineVisible:idx. - ] - ] - ] - ]. + oldSelectedProtocols := selectedProtocolsHolder value ? #(). + oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. + oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. + newSelectedProtocols := self getSelectedProtocolsFromIndices. + oldSelectedProtocols ~= newSelectedProtocols ifTrue:[ + selectedProtocolsHolder value:newSelectedProtocols. + ]. + newSelectedProtocols size > 1 ifTrue:[ + (newSelectedProtocols includes:(self class nameListEntryForALL)) ifTrue:[ + rawProtocolList := rawProtocolListHolder value. + idx := rawProtocolList indexOf: (newSelectedProtocols copy remove:(self class nameListEntryForALL); yourself) first. + idx ~~ 0 ifTrue:[ + (listView := self builder componentAt:#List) notNil ifTrue:[ + listView makeLineVisible:idx. + ] + ] + ] + ]. - ^ self + ^ self ]. changedObject == selectedProtocolsHolder ifTrue:[ - rawProtocolList := rawProtocolListHolder value. - rawProtocolList size == 0 ifTrue:[ - self updateList. - rawProtocolList := rawProtocolListHolder value. - ]. - rawProtocolList notNil ifTrue:[ - selectedCategories := selectedProtocolsHolder value ? #(). - selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. - newIndices := selectedCategories - collect:[:each | rawProtocolList findFirst:[:p | p string = each string]]. - newIndices := newIndices select:[:each | each ~~ 0]. - newIndices ~= self selectedProtocolIndices value ifTrue:[ - self selectedProtocolIndices setValue:nil. "/ to force update - self selectedProtocolIndices value:newIndices - ]. - (lastGeneratedProtocols notNil - and:[(lastGeneratedProtocols includes:self class nameListEntryForALL) - and:[(selectedProtocolsHolder value ? #()) includes:self class nameListEntryForALL]]) - ifTrue:[ - "/ no need to update generator - ] ifFalse:[ - self updateOutputGenerator. - ] - ]. - ^ self + rawProtocolList := rawProtocolListHolder value. + rawProtocolList size == 0 ifTrue:[ + self updateList. + rawProtocolList := rawProtocolListHolder value. + ]. + rawProtocolList notNil ifTrue:[ + selectedCategories := selectedProtocolsHolder value ? #(). + selectedCategories := selectedCategories collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. + newIndices := selectedCategories + collect:[:each | rawProtocolList findFirst:[:p | p string = each string]]. + newIndices := newIndices select:[:each | each ~~ 0]. + newIndices ~= self selectedProtocolIndices value ifTrue:[ + self selectedProtocolIndices setValue:nil. "/ to force update + self selectedProtocolIndices value:newIndices + ]. + (lastGeneratedProtocols notNil + and:[(lastGeneratedProtocols includes:self class nameListEntryForALL) + and:[(selectedProtocolsHolder value ? #()) includes:self class nameListEntryForALL]]) + ifTrue:[ + "/ no need to update generator + ] ifFalse:[ + self updateOutputGenerator. + ] + ]. + ^ self ]. (changedObject == variableFilter or:[changedObject == filterClassVars or:[changedObject == packageFilterOnInput]]) ifTrue:[ - self invalidateList. - ^ self + self invalidateList. + ^ self ]. changedObject == methodVisibilityHolder ifTrue:[ - self invalidateList. - self updateOutputGenerator. - ^ self + self invalidateList. + self updateOutputGenerator. + ^ self ]. lastGeneratedProtocols := nil. changedObject == inGeneratorHolder ifTrue:[ - selectedCategories := selectedProtocolsHolder value. + selectedCategories := selectedProtocolsHolder value. - selectedCategories size > 0 ifTrue:[ - oldSelectedProtocols := selectedCategories ? #(). - oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. - oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. - self updateList. - rawProtocolList := rawProtocolListHolder value. - newSelectedProtocols := oldSelectedProtocols select:[:each | rawProtocolList includes:each]. + selectedCategories size > 0 ifTrue:[ + oldSelectedProtocols := selectedCategories ? #(). + oldSelectedProtocols := oldSelectedProtocols collect:[:each | each ifNil:[self class nameListEntryForNILCategory]]. + oldSelectedProtocols := oldSelectedProtocols collect:[:each | each string]. + self updateList. + rawProtocolList := rawProtocolListHolder value. + newSelectedProtocols := oldSelectedProtocols select:[:each | rawProtocolList includes:each]. "/ selectedProtocolsHolder setValue:nil. "/ to force update - selectedProtocolsHolder value:newSelectedProtocols. - ^ self - ]. + selectedProtocolsHolder value:newSelectedProtocols. + ^ self + ]. ]. super delayedUpdate:something with:aParameter from:changedObject @@ -1258,5 +1259,5 @@ !MethodCategoryList class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.5 2005-07-06 11:31:06 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.6 2005-11-18 14:55:20 cg Exp $' ! !