Skip to content

Refactorings: code factorization and separation of preoccupations

Compare
Choose a tag to compare
@adri09070 adri09070 released this 30 Jan 13:37
8e41eb2

Changes:

  • enabling the deletion of the default Chest when naming a new chest or renaming an existing chest with a name identical to the default chest's name
  • renaming ChestLoadObjectIntoCode into ChestLoadObjectIntoCodeCommand

Fixes:

  • Fixing a bug because of which the load command could be used in code presenters even if its interaction model couldn't add bindings. Now, this is only possible to add bindings in a playground, in the debugger and in the Chest playground.

Implementation Notes:

  • adding helpers in StDebugger to access its code interactionModel and its bindings more easily
  • cleaning unused methods and inst vars
  • factorizing of the handling block from on:do: when another chest has already the name that the user chooses in ChestPresenter>>#presenterToNameNewChest: and ChestPresenter>>#presenterToRenameChest:
  • factorizing code of popovers opening in ChestPresenter>>#requestRenameChest:fromContextMenuItem and requestNameNewChestFromToolbar: and ChestPresenter>>#requestRenameObjectFromChest:fromContextMenu:Item:
  • ChestPresenter>>#warningNamingObjectInChest: now delegates to the method of same name in ChestTableWithContentPresenter
  • factorizing transmitDo: blocks in ChestTableWithContentPresenter so that it can be reused in ChestPresenter when overriding the transmitDo: block
  • refactoring#isVisibleForContext: by adding a #canLoadBindings method in SpCodeInteractionModel + taking this into account in ChestCommandTreeBuilder so that the load command is only visible if the code presenter's interaction model can add bindings.
  • Storing cancel and accept buttons in ChestTableWithContentPresenter instead of assuming that they are the last and first button in the ChestTableWithContentPresenter's toolbar
  • making Variable>>#comesFromChest access the chest tag via an accessor on Chest class so that this tag can be accessed by any class that needs to know it
  • classifying methods + removing unused temps + renaming ChestTests into ChestTest + making ChestTest>>#setUp and ChestTest>>#tearDown call super setUp and `super tearDown, necessary for green CI (~~ 30min)