Skip to content

Commit

Permalink
minor search improvement in show/hide
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Oct 25, 2024
1 parent 4654a35 commit 1744958
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
15 changes: 13 additions & 2 deletions repository/OpenPonk-Spec/OPShowHidePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ OPShowHidePresenter >> connectPresenters [
whenSelectedPageChangedDo: [ :selectedPage | self refreshPage: selectedPage ]
]

{ #category : 'api - focus' }
OPShowHidePresenter >> defaultKeyboardFocus [

^ notebook selectedPage
ifNil: [ self ]
ifNotNil: [ :page | page activePresenter ]
]

{ #category : 'initialization' }
OPShowHidePresenter >> initializePresenters [
notebook := self newNotebook.
Expand Down Expand Up @@ -59,8 +67,11 @@ OPShowHidePresenter >> refreshCurrentPage [

{ #category : 'initialization' }
OPShowHidePresenter >> refreshPage: aPage [
aPage activePresenter
ifNotNil: [ :presenter | presenter updateSelectedItems ]

aPage activePresenter ifNotNil: [ :presenter |
presenter
updateSelectedItems;
takeKeyboardFocus ]
]

{ #category : 'accessing model' }
Expand Down
19 changes: 11 additions & 8 deletions repository/OpenPonk-Spec/OPShowHideTabContentPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,33 @@ OPShowHideTabContentPresenter >> initializePresenters [
tree := self newTreeTable.
mainColumn := SpCompositeTableColumn new.
mainColumn addColumn:
((SpCheckBoxTableColumn evaluated: [ :modelObject |
((SpCheckBoxTableColumn evaluated: [ :modelObject |
self isSelected: modelObject ])
width: 20;
onActivation: [ :modelObject |
onActivation: [ :modelObject |
self processAndUpdateSelected: modelObject ];
onDeactivation: [ :modelObject |
onDeactivation: [ :modelObject |
self processAndUpdateUnselected: modelObject ];
yourself).
self hasIcon ifTrue: [
self hasIcon ifTrue: [
mainColumn addColumn:
((SpImageTableColumn evaluated: [ :modelObject |
((SpImageTableColumn evaluated: [ :modelObject |
self iconFor: modelObject ])
width: 20;
yourself) ].
mainColumn addColumn:
(SpStringTableColumn evaluated: [ :modelObject |
(SpStringTableColumn evaluated: [ :modelObject |
self nameFor: modelObject ]).
tree
addColumn: mainColumn;
roots: self initialRoots;
hideColumnHeaders;
children: [ :item | self childrenFor: item ];
whenBuiltDo: [ :buildWidget |
buildWidget widget dataSource rootItem expandAll ]
whenBuiltDo: [ :buildWidget |
buildWidget widget dataSource rootItem expandAll ];
searchMatching: [ :item :pattern |
(self nameFor: item) asString trimBoth asLowercase includesSubstring:
pattern asLowercase ]
]

{ #category : 'testing' }
Expand Down
7 changes: 7 additions & 0 deletions repository/OpenPonk-Spec/OPTypesShowHidePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ OPTypesShowHidePresenter >> possibleTypeLeafNames [
^ self getRootNode leafNames
]

{ #category : 'private' }
OPTypesShowHidePresenter >> searchValueOf: item [

self halt.
^ item name
]

{ #category : 'accessing' }
OPTypesShowHidePresenter >> selected: added [
| typesToShow elementsToShow executor |
Expand Down

0 comments on commit 1744958

Please sign in to comment.