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 b868e4f commit 9b336c3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/GToolkit-Coder-UI/GtTextualCoderEditorElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Class {
GtTextualCoderEditorElement >> attachSpace [
super attachSpace.

GtTextualCoderEditorElementAttachedSpaceSignal emit
GtTextualCoderEditorElementAttachedSpaceSignal new
element: self;
emit
]

{ #category : #'api - textual coder view model' }
Expand Down Expand Up @@ -77,7 +79,9 @@ GtTextualCoderEditorElement >> defaultTextEditorMode [
GtTextualCoderEditorElement >> detachSpace [
super detachSpace.

GtTextualCoderEditorElementDetachedSpaceSignal emit
GtTextualCoderEditorElementDetachedSpaceSignal new
element: self;
emit
]

{ #category : #'private - updating' }
Expand Down Expand Up @@ -164,7 +168,9 @@ GtTextualCoderEditorElement >> initializeListeners [
GtTextualCoderEditorElement >> onAddedToSceneGraph [
super onAddedToSceneGraph.

GtTextualCoderEditorElementAddedToSceneGraphSignal emit
GtTextualCoderEditorElementAddedToSceneGraphSignal new
element: self;
emit
]

{ #category : #'private - event handling' }
Expand Down Expand Up @@ -247,7 +253,9 @@ GtTextualCoderEditorElement >> onPrintRequest: anEvaluationAnnouncement [
GtTextualCoderEditorElement >> onRemovedFromSceneGraph [
super onRemovedFromSceneGraph.

GtTextualCoderEditorElementRemovedFromSceneGraphSignal emit
GtTextualCoderEditorElementRemovedFromSceneGraphSignal new
element: self;
emit
]

{ #category : #'private - event handling' }
Expand Down Expand Up @@ -434,7 +442,9 @@ GtTextualCoderEditorElement >> privateUpdateCursors: anEditorElement announcemen
aCursorsChangedAnnouncement source == self textualCoderViewModel
ifFalse: [ ^ self ].

GtTextualCoderEditorElementUpdateCursorsSignal emit.
GtTextualCoderEditorElementUpdateCursorsSignal new
element: self;
emit.

self navigator
withoutResettingDesiredCoordinate;
Expand All @@ -445,7 +455,9 @@ GtTextualCoderEditorElement >> privateUpdateCursors: anEditorElement announcemen

{ #category : #'private - updating' }
GtTextualCoderEditorElement >> privateUpdateEditorState: anEditorState [
GtTextualCoderEditorElementUpdateStateSignal emit.
GtTextualCoderEditorElementUpdateStateSignal new
element: self;
emit.

self editor restoreState: anEditorState
]
Expand All @@ -459,7 +471,9 @@ GtTextualCoderEditorElement >> privateUpdateText: anEditorElement announcement:
aGtTextualCoderViewModelTextChanged textualCoderViewModel == self textualCoderViewModel
ifFalse: [ ^ self ].

GtTextualCoderEditorElementUpdateTextSignal emit.
GtTextualCoderEditorElementUpdateTextSignal new
element: self;
emit.

"Determine the text that we should use to update the editor."
textForUpdate := self computeTextForUpdateForTextChangedEvent: aGtTextualCoderViewModelTextChanged.
Expand Down
13 changes: 13 additions & 0 deletions src/GToolkit-Coder-UI/GtTextualCoderEditorElementSignal.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
Class {
#name : #GtTextualCoderEditorElementSignal,
#superclass : #ContextStackSignal,
#instVars : [
'element'
],
#category : #'GToolkit-Coder-UI-Coder - Textual'
}

{ #category : #accessing }
GtTextualCoderEditorElementSignal >> element [
^ element
]

{ #category : #accessing }
GtTextualCoderEditorElementSignal >> element: anObject [
element := anObject
]

0 comments on commit 9b336c3

Please sign in to comment.