From 9da377b6238e856d0d54d2123e3b907a4fb58c9a Mon Sep 17 00:00:00 2001 From: Esteban Lorenzano Date: Tue, 15 Oct 2024 22:15:14 +0200 Subject: [PATCH] restore lost methods --- .../SpMorphicListAdapterTest.class.st | 3 +++ src/Spec2-Core/SpListPresenter.class.st | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/Spec2-Adapters-Morphic-Tests/SpMorphicListAdapterTest.class.st b/src/Spec2-Adapters-Morphic-Tests/SpMorphicListAdapterTest.class.st index fa9f7575..75eac385 100644 --- a/src/Spec2-Adapters-Morphic-Tests/SpMorphicListAdapterTest.class.st +++ b/src/Spec2-Adapters-Morphic-Tests/SpMorphicListAdapterTest.class.st @@ -1,6 +1,9 @@ Class { #name : 'SpMorphicListAdapterTest', #superclass : 'TestCase', + #instVars : [ + 'presenter' + ], #category : 'Spec2-Adapters-Morphic-Tests', #package : 'Spec2-Adapters-Morphic-Tests' } diff --git a/src/Spec2-Core/SpListPresenter.class.st b/src/Spec2-Core/SpListPresenter.class.st index d1e8137f..50f5cfa9 100644 --- a/src/Spec2-Core/SpListPresenter.class.st +++ b/src/Spec2-Core/SpListPresenter.class.st @@ -181,6 +181,20 @@ SpListPresenter >> resetListSelection [ self selectIndex: 0 ] +{ #category : 'api' } +SpListPresenter >> scrollIndex [ + "Answer a representing the receiver's element scroll index" + + ^ self adapter widget showIndex. +] + +{ #category : 'api' } +SpListPresenter >> scrollToIndex: anIndex [ + "Scroll the receiver to the element whose index is anIndex." + + self adapter widget scrollToIndex: anIndex +] + { #category : 'api' } SpListPresenter >> updateList [ "Update the list re taking the list defined in `SpAbstractListPresenter>>#model` and filling the list with