Cannot browse class side methods :)

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

Cannot browse class side methods :)

stepharo
Hi guys

I think that one recent fix breaks the fact that we may want to see
class method
I suspect

     15708 Deleting a class with nautilus raises an error
         https://pharo.fogbugz.com/f/cases/15708

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Cannot browse class side methods :)

stepharo
reverting ... reintroduces the old behavior and bug but we can browse
class methods.

selectedClassWithoutChangingSelection: aClass

     self resetCategoriesList.
     self okToChangeSourceAndComment
         ifFalse: [ ^ self ].
     aClass
         ifNil: [ self unselectClass ]
         ifNotNil: [
             acceptor := ClassOrMethodDefinitionAcceptor model: self.
             self classWidget selectClass: aClass.
             ((self selectedPackageIncludes: aClass theNonMetaClass) or:
[ model showHierarchy ])
                 ifTrue: [
                     self model
                         package: self selectedPackage
                         class: aClass theNonMetaClass
                         category: nil
                         method: nil ]
                 ifFalse: [ self selectedClass: aClass withSelection:
(self parentOfClass: aClass theNonMetaClass) ].
             self updateOnClassSelection ].

=>

selectedClassWithoutChangingSelection: aClass

     self resetCategoriesList.
     self okToChangeSourceAndComment
         ifFalse: [ ^ self ].
     aClass
         ifNil: [ self unselectClass ]
         ifNotNil: [
             acceptor := ClassOrMethodDefinitionAcceptor model: self.
             self classWidget selectClass: aClass.
             ((self selectedPackageIncludes: aClass theNonMetaClass) or:
[ model showHierarchy ])
                 ifTrue: [
                     self model
                         package: self selectedPackage
                         class: aClass
                         category: nil
                         method: nil ]
                 ifFalse: [ self selectedClass: aClass withSelection:
(self parentOfClass: aClass) ].
             self updateOnClassSelection ].

Reply | Threaded
Open this post in threaded view
|

Re: Cannot browse class side methods :)

Nicolai Hess


2015-06-09 20:23 GMT+02:00 stepharo <[hidden email]>:
reverting ... reintroduces the old behavior and bug but we can browse class methods.

If you revert this change, you can add the following change

replace
self selectedClass  = class
                    ifTrue: [ self selectedClass: nil ].
with
self selectedClass theNonMetaClass = class
                    ifTrue: [ self selectedClass: nil ].

in AbstractNautilusUI>>#classRemoved:

this should solve the bug "15708 Deleting a class with nautilus raises an error"

 

selectedClassWithoutChangingSelection: aClass

    self resetCategoriesList.
    self okToChangeSourceAndComment
        ifFalse: [ ^ self ].
    aClass
        ifNil: [ self unselectClass ]
        ifNotNil: [
            acceptor := ClassOrMethodDefinitionAcceptor model: self.
            self classWidget selectClass: aClass.
            ((self selectedPackageIncludes: aClass theNonMetaClass) or: [ model showHierarchy ])
                ifTrue: [
                    self model
                        package: self selectedPackage
                        class: aClass theNonMetaClass
                        category: nil
                        method: nil ]
                ifFalse: [ self selectedClass: aClass withSelection: (self parentOfClass: aClass theNonMetaClass) ].
            self updateOnClassSelection ].

=>

selectedClassWithoutChangingSelection: aClass

    self resetCategoriesList.
    self okToChangeSourceAndComment
        ifFalse: [ ^ self ].
    aClass
        ifNil: [ self unselectClass ]
        ifNotNil: [
            acceptor := ClassOrMethodDefinitionAcceptor model: self.
            self classWidget selectClass: aClass.
            ((self selectedPackageIncludes: aClass theNonMetaClass) or: [ model showHierarchy ])
                ifTrue: [
                    self model
                        package: self selectedPackage
                        class: aClass
                        category: nil
                        method: nil ]
                ifFalse: [ self selectedClass: aClass withSelection: (self parentOfClass: aClass) ].
            self updateOnClassSelection ].