Skip to content

Commit

Permalink
Methods for toggling
Browse files Browse the repository at this point in the history
  • Loading branch information
carolahp committed Sep 19, 2023
1 parent 4ecee48 commit d23bb63
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/NewTools-ScopesBrowser/Behavior.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Extension { #name : 'Behavior' }

{ #category : '*NewTools-ScopesBrowser' }
Behavior >> scopesIconName [
^ #class
]
6 changes: 6 additions & 0 deletions src/NewTools-ScopesBrowser/RPackage.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Extension { #name : 'RPackage' }

{ #category : '*NewTools-ScopesBrowser' }
RPackage >> scopesIconName [
^ #package
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Extension { #name : 'SpMorphicTreeTableAdapter' }

{ #category : '*NewTools-ScopesBrowser' }
SpMorphicTreeTableAdapter >> togglePath: aPath [
widget dataSource togglePath: aPath
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Extension { #name : 'SpMorphicTreeTableDataSource' }

{ #category : '*NewTools-ScopesBrowser' }
SpMorphicTreeTableDataSource >> togglePath: aPath [
(self itemAtPath: aPath) ifNotNil:[ :aNode |
aNode toggle.
self tableRefresh ]
]
22 changes: 22 additions & 0 deletions src/NewTools-ScopesBrowser/SpTreeTablePresenter.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Extension { #name : 'SpTreeTablePresenter' }

{ #category : '*NewTools-ScopesBrowser' }
SpTreeTablePresenter >> collapseSelectedItems [
self selection selectedPaths do: [ :path | self collapsePath: path ]
]

{ #category : '*NewTools-ScopesBrowser' }
SpTreeTablePresenter >> expandSelectedItems [
self selection selectedPaths do: [ :path | self expandPath: path ]
]

{ #category : '*NewTools-ScopesBrowser' }
SpTreeTablePresenter >> togglePath: aPath [
self withAdapterPerformOrDefer: [ :anAdapter |
anAdapter togglePath: aPath ]
]

{ #category : '*NewTools-ScopesBrowser' }
SpTreeTablePresenter >> toggleSelectedItems [
self selection selectedPaths do: [ :path | self togglePath: path ]
]

0 comments on commit d23bb63

Please sign in to comment.