Skip to content

Commit

Permalink
while new *View list/table/tree family does not has search enabled by…
Browse files Browse the repository at this point in the history
… default (it does not relies on FT implementation), old implementations do.
  • Loading branch information
estebanlm committed Nov 18, 2024
1 parent 982dda7 commit 7f72d39
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Class {
{ #category : 'factory' }
SpMorphicColumnViewAdapter >> addModelTo: tableMorph [

tableMorph disableSearch.
"no search on column view (it has to be provided elsewhere)"
tableMorph disableFunction.

self model columns do: [ :each |
tableMorph addColumn: (self newColumnFrom: each) ].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ SpMorphicListViewAdapter >> buildWidget [
datasource model: self model.

widget := self newTableWith: datasource.
widget disableSearch.
"no search on list view (it has to be provided elsewhere)"
widget disableFunction.

self presenter whenModelChangedDo: [ widget refresh ].
self presenter whenSelectionChangedDo: [ self refreshWidgetSelection ].
Expand Down
5 changes: 3 additions & 2 deletions src/Spec2-Adapters-Morphic/SpFTTableMorph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ SpFTTableMorph >> acceptDroppingMorph: aTransferMorph event: anEvent [
]

{ #category : 'api' }
SpFTTableMorph >> disableSearch [
SpFTTableMorph >> disableFunction [

super disableFunction

function := FTNilFunction table: self
]

{ #category : 'drawing' }
Expand Down
5 changes: 3 additions & 2 deletions src/Spec2-Core/SpListPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ A list presenter does not offer the possibility to add one item in isolation ins
Class {
#name : 'SpListPresenter',
#superclass : 'SpAbstractListPresenter',
#traits : 'SpTSearchable + SpTDecoratedText',
#classTraits : 'SpTSearchable classTrait + SpTDecoratedText classTrait',
#traits : 'SpTDecoratedText',
#classTraits : 'SpTDecoratedText classTrait',
#instVars : [
'#allowToSelect => ObservableSlot',
'#autoDeselect => ObservableSlot',
Expand Down Expand Up @@ -150,6 +150,7 @@ SpListPresenter >> iconFor: anItem [
SpListPresenter >> initialize [

super initialize.
self enableSearch.
autoDeselect := true.
allowToSelect := true.
display := [ :object | object asStringOrText ]
Expand Down
1 change: 1 addition & 0 deletions src/Spec2-Core/SpTablePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ SpTablePresenter >> hideColumnHeaders [
SpTablePresenter >> initialize [

super initialize.
self enableSearch.
showColumnHeaders := true.
columns := #().
isResizable := false
Expand Down
3 changes: 3 additions & 0 deletions src/Spec2-Core/SpTreePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ SpTreePresenter >> hideColumnHeaders [

{ #category : 'initialization' }
SpTreePresenter >> initialize [

super initialize.

self enableSearch.

self withScrollBars.

Expand Down
3 changes: 3 additions & 0 deletions src/Spec2-Core/SpTreeTablePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ SpTreeTablePresenter >> hideColumnHeaders [

{ #category : 'initialization' }
SpTreeTablePresenter >> initialize [

super initialize.

self enableSearch.

self withScrollBars.

activationBlock := [ ].
Expand Down

0 comments on commit 7f72d39

Please sign in to comment.