Skip to content

Commit

Permalink
Add Beacon signal views and print methods [feenkcom/gtoolkit#3908]
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajKubelka committed Jul 26, 2024
1 parent 620a911 commit bb55b75
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,23 @@ BlInfiniteRecyclerAboutToRecycleInPoolSignal >> holder: anObject [
holder := anObject
]

{ #category : #accessing }
BlInfiniteRecyclerAboutToRecycleInPoolSignal >> itemElement [
^ self holder itemElement
]

{ #category : #initialization }
BlInfiniteRecyclerAboutToRecycleInPoolSignal >> prepareForDelivery [
super prepareForDelivery.

holderItemId := holder itemId.
holderItemType := holder itemType
]

{ #category : #printing }
BlInfiniteRecyclerAboutToRecycleInPoolSignal >> printOneLineContentsOn: stream [
holder ifNotNil: [
stream print: self itemElement.
stream space ].
super printOneLineContentsOn: stream
]
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ BlInfiniteRecyclerAddedToAttachedScrapSignal >> prepareForDelivery [

flags := elementHolder flags copy
]

{ #category : #accessing }
BlInfiniteRecyclerAddedToAttachedScrapSignal >> printOneLineContentsOn: stream [
self elementHolder ifNotNil: [
stream print: self elementHolder itemElement.
stream space ].
super printOneLineContentsOn: stream
]
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ BlInfiniteRecyclerFetchHolderSignal >> fetcherResult: anObject [
fetcherResult := anObject
]

{ #category : #accessing }
BlInfiniteRecyclerFetchHolderSignal >> itemElement [
^ fetcherResult ifNotNil: [ :aResult | aResult holder ifNotNil: #itemElement ]
]

{ #category : #accessing }
BlInfiniteRecyclerFetchHolderSignal >> position [

Expand All @@ -59,6 +64,9 @@ BlInfiniteRecyclerFetchHolderSignal >> printOneLineContentsOn: aStream [
ifTrue: [
self fetcherResult isFromScrap
ifTrue: [ aStream nextPutAll: 'Recycled holder from scrap' ]
ifFalse: [ aStream nextPutAll: 'Created new holder or acquired it from the pool' ] ]
ifFalse: [ aStream nextPutAll: 'Created new holder or acquired it from the pool' ].

aStream space; nextPutAll: 'at position: '; print: self position.
aStream space; print: self itemElement. ]
ifFalse: [ aStream nextPutAll: 'Holder not found' ]
]

0 comments on commit bb55b75

Please sign in to comment.