Skip to content

Commit

Permalink
Merge pull request #1808 from Rinzwind/icetiptreenode-formset
Browse files Browse the repository at this point in the history
Refactor IceTipTreeNode to support use of a FormSet
  • Loading branch information
Ducasse authored Mar 20, 2024
2 parents 39618b7 + 8c58afb commit cb4e166
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Iceberg-TipUI/IceTipRepositoryModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,15 @@ IceTipRepositoryModel >> repositoryModelsByGroup [
^ {
((IceTipTreeRepositoryGroup on: self)
name: 'Branches';
icon: (self iconNamed: #branch);
iconFormSet: (self iconFormSetNamed: #branch);
children: (branches
select: [ :each | each entity isLocal ]
thenCollect: [ :each | IceTipTreeBranch on: each ]);
yourself).
"Remotes group"
((IceTipTreeRepositoryGroup on: self)
name: 'Remotes';
icon: (self iconNamed: #remote);
iconFormSet: (self iconFormSetNamed: #remote);
children: (self entity remotes collect: [ :eachRemote |
| remoteModel |
remoteModel := IceTipRemoteModel
Expand All @@ -418,7 +418,7 @@ IceTipRepositoryModel >> repositoryModelsByGroup [
"Tags group"
((IceTipTreeRepositoryGroup on: self)
name: 'Tags';
icon: (self iconNamed: #glamorousBookmark);
iconFormSet: (self iconFormSetNamed: #glamorousBookmark);
children: (tags collect: [ :each | IceTipTreeTag on: each ]);
yourself) }
"Branches group"
Expand Down
13 changes: 9 additions & 4 deletions Iceberg-TipUI/IceTipTreeNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Class {
#instVars : [
'model',
'parent',
'icon'
'iconFormSet'
],
#category : 'Iceberg-TipUI-View-Repository',
#package : 'Iceberg-TipUI',
Expand Down Expand Up @@ -48,12 +48,17 @@ IceTipTreeNode >> doesNotUnderstand: aMessage [

{ #category : 'accessing' }
IceTipTreeNode >> icon [
^ icon
^ self iconFormSet ifNotNil: [ :formSet | formSet asForm ]
]

{ #category : 'accessing' }
IceTipTreeNode >> icon: anIcon [
icon := anIcon
IceTipTreeNode >> iconFormSet [
^ iconFormSet
]

{ #category : 'accessing' }
IceTipTreeNode >> iconFormSet: aFormSet [
iconFormSet := aFormSet
]

{ #category : 'testing' }
Expand Down

0 comments on commit cb4e166

Please sign in to comment.