jgfoster / Jade

Jade is an Alternative Development Environment (IDE) for GemStone/S that runs on Microsoft Windows
MIT License
5 stars 2 forks source link

JadeTreeMethodListPresenter does not remove items from TreeModel when "Remove from List" is clicked #54

Open brunobuzzi opened 3 years ago

brunobuzzi commented 3 years ago

Reproduce: 1) View sender of some method in JadeTreeMethodListPresenter 2) Remove some method from method list presenter 3) Select other node in the Tree presenter 4) Select back the original selection (step 1) in the Tree presenter

The removed items are listed again because they were not removed from the TreeModel in step 2)

I have already a patch, I will submit the PR as soon as I can

brunobuzzi commented 3 years ago

Just in case:

MethodListPresenter>>methodListPresenterModel
methodListPresenterModel
    ^methodListPresenter model

JadeTreeMethodListPresenter>>createSchematicWiring (add)
    methodListPresenter methodListPresenterModel
        when: #item:removedAtIndex: 
        send: #onListMethod:removeAtIndex: 
        to: self
JadeTreeMethodListPresenter>>onListMethod:removeAtIndex: 
onListMethod: anItem removeAtIndex: index
    (treeMethodsMap at: treeMethodsPresenter selection ifAbsent: [^self]) remove: anItem ifAbsent: []