From a7c3ad136c0b30ca72dfd9d44004a233fb4503f8 Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Fri, 1 Nov 2024 20:16:30 -0300 Subject: [PATCH] add `GtPhlowUpdateOnAnnouncement` [feenkcom/gtoolkit#2257] --- .../GtPhlowChangeAnnouncerListener.class.st | 105 +++++++++ .../GtPhlowChangeSystemListener.class.st | 209 ++++++++++++++++++ ...PhlowChangeTabGroupActionExecutor.class.st | 4 +- .../GtPhlowClassPragmaChangeListener.class.st | 205 +---------------- .../GtPhlowElementContext.class.st | 5 +- ...iewTabGroupOnDefiningMethodChange.class.st | 2 +- .../GtPhlowUpdateDefinitions.class.st | 5 + .../GtPhlowUpdateOnAnnouncement.class.st | 58 +++++ src/GToolkit-Phlow/GtPhlowUtility.class.st | 7 + 9 files changed, 393 insertions(+), 207 deletions(-) create mode 100644 src/GToolkit-Phlow/GtPhlowChangeAnnouncerListener.class.st create mode 100644 src/GToolkit-Phlow/GtPhlowChangeSystemListener.class.st create mode 100644 src/GToolkit-Phlow/GtPhlowUpdateOnAnnouncement.class.st diff --git a/src/GToolkit-Phlow/GtPhlowChangeAnnouncerListener.class.st b/src/GToolkit-Phlow/GtPhlowChangeAnnouncerListener.class.st new file mode 100644 index 00000000..83babf29 --- /dev/null +++ b/src/GToolkit-Phlow/GtPhlowChangeAnnouncerListener.class.st @@ -0,0 +1,105 @@ +Class { + #name : #GtPhlowChangeAnnouncerListener, + #superclass : #Object, + #instVars : [ + 'element', + 'elementFuture', + 'subscriptions' + ], + #category : #'GToolkit-Phlow-Updating New' +} + +{ #category : #factory } +GtPhlowChangeAnnouncerListener class >> installOn: anElement announcer: anAnnouncer announcement: anAnnouncement [ + | aListener | + aListener := anElement userData + at: GtPhlowChangeAnnouncerListener + ifAbsentPut: [ self new element: anElement ]. + + aListener installAnnouncer: anAnnouncer announcement: anAnnouncement. + ^ aListener +] + +{ #category : #accessing } +GtPhlowChangeAnnouncerListener >> configuration: aFutureExecutionConfiguration [ + elementFuture executionConfiguration: aFutureExecutionConfiguration +] + +{ #category : #initialization } +GtPhlowChangeAnnouncerListener >> defaultConfiguration [ + ^ GtPhlowUtility defaultFutureExecutionConfiguration +] + +{ #category : #accessing } +GtPhlowChangeAnnouncerListener >> element [ + ^ element +] + +{ #category : #accessing } +GtPhlowChangeAnnouncerListener >> element: anElement [ + self + assert: [ element isNil ] + description: [ 'Element is already initialized' ]. + + element := anElement. + elementFuture element: anElement +] + +{ #category : #'gt - extensions' } +GtPhlowChangeAnnouncerListener >> gtSubscriptionsFor: aView [ + + subscriptions ifNil: [ ^ aView empty ]. + ^ aView columnedList + title: 'Subscriptions'; + priority: 50; + items: [ subscriptions select: #isNotNil ]; + actionUpdateButtonTooltip: 'Update subscription list'; + column: 'Announcement' + text: [ :aSubscription | aSubscription announcementClass ]; + column: 'Kind' text: [ :aSubscription | aSubscription class ] +] + +{ #category : #initialization } +GtPhlowChangeAnnouncerListener >> initialize [ + super initialize. + subscriptions := WeakArray empty. + elementFuture := BrAsyncElementFuture new + cancelSoft; + executionConfiguration: self defaultConfiguration; + whenSuccess: [ :anElement :anObject | "do nothing" ] +] + +{ #category : #'api - subscriptions' } +GtPhlowChangeAnnouncerListener >> installAnnouncer: anAnnouncer announcement: anAnnouncement [ + | aSubscription | + self + assert: [ self element isNotNil ] + description: [ 'Element must be initialized' ]. + aSubscription := anAnnouncer weak + when: anAnnouncement + send: #onAnnouncement: + to: self. + + "We do not need to collect subscriptions. + We do it just for an explainability purpose." + subscriptions := WeakArray + new: subscriptions size + 1 + streamContents: [ :aStream | + aStream + nextPutAll: subscriptions; + nextPut: aSubscription ] +] + +{ #category : #'event handling' } +GtPhlowChangeAnnouncerListener >> onAnnouncement: anAnnouncement [ + element ifNil: [ ^ self ]. + elementFuture future: ([ self updateElement ] asAsyncFuture delayed: 200 milliSeconds) +] + +{ #category : #'private - updating' } +GtPhlowChangeAnnouncerListener >> updateElement [ + | aPhlowView | + aPhlowView := self element phlow entity. + aPhlowView ifNil: [ ^ self ]. + aPhlowView updateContent: self element. +] diff --git a/src/GToolkit-Phlow/GtPhlowChangeSystemListener.class.st b/src/GToolkit-Phlow/GtPhlowChangeSystemListener.class.st new file mode 100644 index 00000000..221896ab --- /dev/null +++ b/src/GToolkit-Phlow/GtPhlowChangeSystemListener.class.st @@ -0,0 +1,209 @@ +Class { + #name : #GtPhlowChangeSystemListener, + #superclass : #Object, + #instVars : [ + 'isSubscribedToSystem', + 'onMethodAddedAction', + 'onMethodRemovedAction', + 'onMethodModifiedAction', + 'interestCondition', + 'actionExecutor' + ], + #category : #'GToolkit-Phlow-Updating New' +} + +{ #category : #factory } +GtPhlowChangeSystemListener class >> installOn: aTabGroup [ +] + +{ #category : #factory } +GtPhlowChangeSystemListener class >> installOnCompositeElement: aTabGroup [ + | aListener aCompositeView aBuildContext | + aCompositeView := aTabGroup phlow entity ifNil: [ ^ nil ]. + aBuildContext := aCompositeView buildContext. + aBuildContext isBuildContext ifFalse: [ ^ nil ]. + + aListener := self new + interestingPragmas: GtPhlowViewsCollector defaultViewPragmaNames + andObject: aBuildContext object; + actionExecutor: (GtPhlowChangeTabGroupActionExecutor new + tabGroup: aTabGroup); + onMethodAddedAction: (GtPhlowChangeTabGroupAddTabAction new + tabGroup: aTabGroup; + buildContext: aBuildContext); + onMethodRemovedAction: (GtPhlowChangeTabGroupRemoveTabAction new + tabGroup: aTabGroup); + onMethodModifiedAction: (GtPhlowChangeTabGroupModifyTabAction new + tabGroup: aTabGroup; + buildContext: aBuildContext); + subscribeToSystem. + + aTabGroup userData at: GtPhlowChangeSystemListener put: aListener. + ^ aListener +] + +{ #category : #accessing } +GtPhlowChangeSystemListener >> actionExecutor [ + ^ actionExecutor +] + +{ #category : #accessing } +GtPhlowChangeSystemListener >> actionExecutor: anActionExecutor [ + actionExecutor := anActionExecutor +] + +{ #category : #initialization } +GtPhlowChangeSystemListener >> initialize [ + super initialize. + interestCondition := GtPhlowChangeLackOfInterestCondition default. + isSubscribedToSystem := false. + actionExecutor := GtPhlowChangeBasicActionExecutor default. + onMethodAddedAction := GtPhlowChangeNoAction default. + onMethodRemovedAction := GtPhlowChangeNoAction default. + onMethodModifiedAction := GtPhlowChangeNoAction default. +] + +{ #category : #accessing } +GtPhlowChangeSystemListener >> interestingClass: aClass [ + self interestingClasses: { aClass } +] + +{ #category : #accessing } +GtPhlowChangeSystemListener >> interestingClasses: aCollection [ + interestCondition := GtPhlowChangeClassesAndSuperclassesInterestCondition new + classes: aCollection +] + +{ #category : #'api - initialization' } +GtPhlowChangeSystemListener >> interestingPragma: aSymbol [ + self interestingPragmas: { aSymbol } +] + +{ #category : #'api - initialization' } +GtPhlowChangeSystemListener >> interestingPragmas: aCollectionOfSymbols [ + interestCondition := GtPhlowChangePragmasInterestCondition new + pragmas: aCollectionOfSymbols +] + +{ #category : #'api - initialization' } +GtPhlowChangeSystemListener >> interestingPragmas: aCollectionOfPragmas andObject: anObject [ + interestCondition := GtPhlowChangeAndInterestCondition new + left: (GtPhlowChangePragmasInterestCondition new + pragmas: aCollectionOfPragmas); + right: (GtPhlowChangeObjectInterestCondition new + object: anObject) +] + +{ #category : #'api - initialization' } +GtPhlowChangeSystemListener >> interestingPragmas: aCollectionOfPragmas andSuperclass: aClass [ + interestCondition := GtPhlowChangeAndInterestCondition new + left: (GtPhlowChangePragmasInterestCondition new + pragmas: aCollectionOfPragmas); + right: (GtPhlowChangeClassesAndSubclassesInterestCondition new + superclass: aClass) +] + +{ #category : #testing } +GtPhlowChangeSystemListener >> isInterestingClass: anAffectedClass andMethod: anAffectedMethod [ + ^ interestCondition isInterestingClass: anAffectedClass andMethod: anAffectedMethod +] + +{ #category : #accessing } +GtPhlowChangeSystemListener >> onMethodAddedAction [ + ^ onMethodAddedAction +] + +{ #category : #accessing } +GtPhlowChangeSystemListener >> onMethodAddedAction: anObject [ + onMethodAddedAction := anObject +] + +{ #category : #'event handling' } +GtPhlowChangeSystemListener >> onMethodAddedAnnouncement: aMethodAdded [ + (self + isInterestingClass: aMethodAdded classAffected + andMethod: aMethodAdded methodAdded) ifFalse: [ ^ self ]. + + actionExecutor + submit: onMethodAddedAction + context: (GtPhlowChangeActionAffectedMethodContext + forAffectedClass: aMethodAdded classAffected + affectedMethod: aMethodAdded methodAdded) +] + +{ #category : #accessing } +GtPhlowChangeSystemListener >> onMethodModifiedAction [ + ^ onMethodModifiedAction +] + +{ #category : #accessing } +GtPhlowChangeSystemListener >> onMethodModifiedAction: anObject [ + onMethodModifiedAction := anObject +] + +{ #category : #'event handling' } +GtPhlowChangeSystemListener >> onMethodModifiedAnnouncement: aMethodModified [ + (self + isInterestingClass: aMethodModified classAffected + andMethod: aMethodModified methodAffected) + ifTrue: [ + actionExecutor + submit: onMethodModifiedAction + context: (GtPhlowChangeActionAffectedMethodContext + forAffectedClass: aMethodModified classAffected + affectedMethod: aMethodModified methodAffected). + ^ self ]. + + (self + isInterestingClass: aMethodModified classAffected + andMethod: aMethodModified oldMethod) ifFalse: [ ^ self ]. + "The old method has an interesting pragma, while the new method does not have it. + We therefore remove the method." + actionExecutor + submit: onMethodRemovedAction + context: (GtPhlowChangeActionAffectedMethodContext + forAffectedClass: aMethodModified classAffected + affectedMethod: aMethodModified methodAffected) +] + +{ #category : #accessing } +GtPhlowChangeSystemListener >> onMethodRemovedAction [ + ^ onMethodRemovedAction +] + +{ #category : #accessing } +GtPhlowChangeSystemListener >> onMethodRemovedAction: anObject [ + onMethodRemovedAction := anObject +] + +{ #category : #'event handling' } +GtPhlowChangeSystemListener >> onMethodRemovedAnnouncement: aMethodRemoved [ + (self + isInterestingClass: aMethodRemoved classAffected + andMethod: aMethodRemoved methodRemoved) ifFalse: [ ^ self ]. + + actionExecutor + submit: onMethodRemovedAction + context: (GtPhlowChangeActionAffectedMethodContext + forAffectedClass: aMethodRemoved classAffected + affectedMethod: aMethodRemoved methodRemoved) +] + +{ #category : #subscriptions } +GtPhlowChangeSystemListener >> subscribeToSystem [ + SystemAnnouncer uniqueInstance weak + when: MethodAdded + send: #onMethodAddedAnnouncement: + to: self; + when: MethodRemoved + send: #onMethodRemovedAnnouncement: + to: self; + when: MethodModified + send: #onMethodModifiedAnnouncement: + to: self +] + +{ #category : #subscriptions } +GtPhlowChangeSystemListener >> unsubscribeFromSystem [ + SystemAnnouncer uniqueInstance unsubscribe: self +] diff --git a/src/GToolkit-Phlow/GtPhlowChangeTabGroupActionExecutor.class.st b/src/GToolkit-Phlow/GtPhlowChangeTabGroupActionExecutor.class.st index bf5af049..33156929 100644 --- a/src/GToolkit-Phlow/GtPhlowChangeTabGroupActionExecutor.class.st +++ b/src/GToolkit-Phlow/GtPhlowChangeTabGroupActionExecutor.class.st @@ -29,9 +29,7 @@ GtPhlowChangeTabGroupActionExecutor >> configuration: aFutureExecutionConfigurat { #category : #initialization } GtPhlowChangeTabGroupActionExecutor >> defaultConfiguration [ - ^ AsyncFutureExecutionConfiguration new - customGroup: #Phlow; - highPriority + ^ GtPhlowUtility defaultFutureExecutionConfiguration ] { #category : #'gt - extensions' } diff --git a/src/GToolkit-Phlow/GtPhlowClassPragmaChangeListener.class.st b/src/GToolkit-Phlow/GtPhlowClassPragmaChangeListener.class.st index 8d089b50..6b39fb46 100644 --- a/src/GToolkit-Phlow/GtPhlowClassPragmaChangeListener.class.st +++ b/src/GToolkit-Phlow/GtPhlowClassPragmaChangeListener.class.st @@ -1,209 +1,12 @@ Class { #name : #GtPhlowClassPragmaChangeListener, - #superclass : #Object, - #instVars : [ - 'isSubscribedToSystem', - 'onMethodAddedAction', - 'onMethodRemovedAction', - 'onMethodModifiedAction', - 'interestCondition', - 'actionExecutor' - ], + #superclass : #GtPhlowChangeSystemListener, #category : #'GToolkit-Phlow-Updating New' } -{ #category : #factory } -GtPhlowClassPragmaChangeListener class >> installOn: aTabGroup [ -] - -{ #category : #factory } -GtPhlowClassPragmaChangeListener class >> installOnCompositeElement: aTabGroup [ - | aListener aCompositeView aBuildContext | - aCompositeView := aTabGroup phlow entity ifNil: [ ^ nil ]. - aBuildContext := aCompositeView buildContext. - aBuildContext isBuildContext ifFalse: [ ^ nil ]. - - aListener := self new - interestingPragmas: GtPhlowViewsCollector defaultViewPragmaNames - andObject: aBuildContext object; - actionExecutor: (GtPhlowChangeTabGroupActionExecutor new - tabGroup: aTabGroup); - onMethodAddedAction: (GtPhlowChangeTabGroupAddTabAction new - tabGroup: aTabGroup; - buildContext: aBuildContext); - onMethodRemovedAction: (GtPhlowChangeTabGroupRemoveTabAction new - tabGroup: aTabGroup); - onMethodModifiedAction: (GtPhlowChangeTabGroupModifyTabAction new - tabGroup: aTabGroup; - buildContext: aBuildContext); - subscribeToSystem. - - aTabGroup userData at: GtPhlowClassPragmaChangeListener put: aListener. - ^ aListener -] - -{ #category : #accessing } -GtPhlowClassPragmaChangeListener >> actionExecutor [ - ^ actionExecutor -] - -{ #category : #accessing } -GtPhlowClassPragmaChangeListener >> actionExecutor: anActionExecutor [ - actionExecutor := anActionExecutor -] - -{ #category : #initialization } -GtPhlowClassPragmaChangeListener >> initialize [ - super initialize. - interestCondition := GtPhlowChangeLackOfInterestCondition default. - isSubscribedToSystem := false. - actionExecutor := GtPhlowChangeBasicActionExecutor default. - onMethodAddedAction := GtPhlowChangeNoAction default. - onMethodRemovedAction := GtPhlowChangeNoAction default. - onMethodModifiedAction := GtPhlowChangeNoAction default. -] - -{ #category : #accessing } -GtPhlowClassPragmaChangeListener >> interestingClass: aClass [ - self interestingClasses: { aClass } -] - -{ #category : #accessing } -GtPhlowClassPragmaChangeListener >> interestingClasses: aCollection [ - interestCondition := GtPhlowChangeClassesAndSuperclassesInterestCondition new - classes: aCollection -] - -{ #category : #'api - initialization' } -GtPhlowClassPragmaChangeListener >> interestingPragma: aSymbol [ - self interestingPragmas: { aSymbol } -] - -{ #category : #'api - initialization' } -GtPhlowClassPragmaChangeListener >> interestingPragmas: aCollectionOfSymbols [ - interestCondition := GtPhlowChangePragmasInterestCondition new - pragmas: aCollectionOfSymbols -] - -{ #category : #'api - initialization' } -GtPhlowClassPragmaChangeListener >> interestingPragmas: aCollectionOfPragmas andObject: anObject [ - interestCondition := GtPhlowChangeAndInterestCondition new - left: (GtPhlowChangePragmasInterestCondition new - pragmas: aCollectionOfPragmas); - right: (GtPhlowChangeObjectInterestCondition new - object: anObject) -] - -{ #category : #'api - initialization' } -GtPhlowClassPragmaChangeListener >> interestingPragmas: aCollectionOfPragmas andSuperclass: aClass [ - interestCondition := GtPhlowChangeAndInterestCondition new - left: (GtPhlowChangePragmasInterestCondition new - pragmas: aCollectionOfPragmas); - right: (GtPhlowChangeClassesAndSubclassesInterestCondition new - superclass: aClass) -] - { #category : #testing } -GtPhlowClassPragmaChangeListener >> isInterestingClass: anAffectedClass andMethod: anAffectedMethod [ - ^ interestCondition isInterestingClass: anAffectedClass andMethod: anAffectedMethod -] - -{ #category : #accessing } -GtPhlowClassPragmaChangeListener >> onMethodAddedAction [ - ^ onMethodAddedAction -] - -{ #category : #accessing } -GtPhlowClassPragmaChangeListener >> onMethodAddedAction: anObject [ - onMethodAddedAction := anObject -] - -{ #category : #'event handling' } -GtPhlowClassPragmaChangeListener >> onMethodAddedAnnouncement: aMethodAdded [ - (self - isInterestingClass: aMethodAdded classAffected - andMethod: aMethodAdded methodAdded) ifFalse: [ ^ self ]. - - actionExecutor - submit: onMethodAddedAction - context: (GtPhlowChangeActionAffectedMethodContext - forAffectedClass: aMethodAdded classAffected - affectedMethod: aMethodAdded methodAdded) -] - -{ #category : #accessing } -GtPhlowClassPragmaChangeListener >> onMethodModifiedAction [ - ^ onMethodModifiedAction -] - -{ #category : #accessing } -GtPhlowClassPragmaChangeListener >> onMethodModifiedAction: anObject [ - onMethodModifiedAction := anObject -] - -{ #category : #'event handling' } -GtPhlowClassPragmaChangeListener >> onMethodModifiedAnnouncement: aMethodModified [ - (self - isInterestingClass: aMethodModified classAffected - andMethod: aMethodModified methodAffected) - ifTrue: [ - actionExecutor - submit: onMethodModifiedAction - context: (GtPhlowChangeActionAffectedMethodContext - forAffectedClass: aMethodModified classAffected - affectedMethod: aMethodModified methodAffected). - ^ self ]. - - (self - isInterestingClass: aMethodModified classAffected - andMethod: aMethodModified oldMethod) ifFalse: [ ^ self ]. - "The old method has an interesting pragma, while the new method does not have it. - We therefore remove the method." - actionExecutor - submit: onMethodRemovedAction - context: (GtPhlowChangeActionAffectedMethodContext - forAffectedClass: aMethodModified classAffected - affectedMethod: aMethodModified methodAffected) -] - -{ #category : #accessing } -GtPhlowClassPragmaChangeListener >> onMethodRemovedAction [ - ^ onMethodRemovedAction -] - -{ #category : #accessing } -GtPhlowClassPragmaChangeListener >> onMethodRemovedAction: anObject [ - onMethodRemovedAction := anObject -] - -{ #category : #'event handling' } -GtPhlowClassPragmaChangeListener >> onMethodRemovedAnnouncement: aMethodRemoved [ - (self - isInterestingClass: aMethodRemoved classAffected - andMethod: aMethodRemoved methodRemoved) ifFalse: [ ^ self ]. - - actionExecutor - submit: onMethodRemovedAction - context: (GtPhlowChangeActionAffectedMethodContext - forAffectedClass: aMethodRemoved classAffected - affectedMethod: aMethodRemoved methodRemoved) -] - -{ #category : #subscriptions } -GtPhlowClassPragmaChangeListener >> subscribeToSystem [ - SystemAnnouncer uniqueInstance weak - when: MethodAdded - send: #onMethodAddedAnnouncement: - to: self; - when: MethodRemoved - send: #onMethodRemovedAnnouncement: - to: self; - when: MethodModified - send: #onMethodModifiedAnnouncement: - to: self -] +GtPhlowClassPragmaChangeListener class >> isDeprecated [ + "Use the superclass" -{ #category : #subscriptions } -GtPhlowClassPragmaChangeListener >> unsubscribeFromSystem [ - SystemAnnouncer uniqueInstance unsubscribe: self + ^ true ] diff --git a/src/GToolkit-Phlow/GtPhlowElementContext.class.st b/src/GToolkit-Phlow/GtPhlowElementContext.class.st index 79f6e35e..d8eb8ae1 100644 --- a/src/GToolkit-Phlow/GtPhlowElementContext.class.st +++ b/src/GToolkit-Phlow/GtPhlowElementContext.class.st @@ -329,8 +329,9 @@ GtPhlowElementContext >> methodSelector [ { #category : #updating } GtPhlowElementContext >> postponeUpdate [ - - ([ self syncUpdate ] asAsyncFuture delayed: 300 milliSeconds) await + ([ self syncUpdate ] asAsyncFuture + delayed: 300 milliSeconds) + await: GtPhlowUtility defaultFutureExecutionConfiguration ] { #category : #accessing } diff --git a/src/GToolkit-Phlow/GtPhlowUpdateCompositeViewTabGroupOnDefiningMethodChange.class.st b/src/GToolkit-Phlow/GtPhlowUpdateCompositeViewTabGroupOnDefiningMethodChange.class.st index 5aa347a1..8b4779bd 100644 --- a/src/GToolkit-Phlow/GtPhlowUpdateCompositeViewTabGroupOnDefiningMethodChange.class.st +++ b/src/GToolkit-Phlow/GtPhlowUpdateCompositeViewTabGroupOnDefiningMethodChange.class.st @@ -7,5 +7,5 @@ Class { { #category : #subscriptions } GtPhlowUpdateCompositeViewTabGroupOnDefiningMethodChange >> installOn: aTabGroup [ super installOn: aTabGroup. - GtPhlowClassPragmaChangeListener installOnCompositeElement: aTabGroup + GtPhlowChangeSystemListener installOnCompositeElement: aTabGroup ] diff --git a/src/GToolkit-Phlow/GtPhlowUpdateDefinitions.class.st b/src/GToolkit-Phlow/GtPhlowUpdateDefinitions.class.st index 442e22fc..f68b1304 100644 --- a/src/GToolkit-Phlow/GtPhlowUpdateDefinitions.class.st +++ b/src/GToolkit-Phlow/GtPhlowUpdateDefinitions.class.st @@ -22,6 +22,11 @@ GtPhlowUpdateDefinitions >> asyncWhen: anAnnouncement if: anIfCondition in: anAn { #category : #'api - adding' } GtPhlowUpdateDefinitions >> asyncWhen: anAnnouncement in: anAnnouncer [ + self add: (GtPhlowUpdateOnAnnouncement new + announcement: anAnnouncement; + announcer: anAnnouncer). + true ifTrue: [ ^ self ]. + self add: (GtPhlowAsyncUpdateDefinition new announcement: anAnnouncement; announcer: anAnnouncer) diff --git a/src/GToolkit-Phlow/GtPhlowUpdateOnAnnouncement.class.st b/src/GToolkit-Phlow/GtPhlowUpdateOnAnnouncement.class.st new file mode 100644 index 00000000..ee4ec0b4 --- /dev/null +++ b/src/GToolkit-Phlow/GtPhlowUpdateOnAnnouncement.class.st @@ -0,0 +1,58 @@ +Class { + #name : #GtPhlowUpdateOnAnnouncement, + #superclass : #GtPhlowUpdateDefinition, + #instVars : [ + 'announcerValuable', + 'announcementValuable' + ], + #category : #'GToolkit-Phlow-Updating' +} + +{ #category : #accessing } +GtPhlowUpdateOnAnnouncement >> announcement [ + ^ announcementValuable value +] + +{ #category : #accessing } +GtPhlowUpdateOnAnnouncement >> announcement: aValuable [ + announcementValuable := aValuable +] + +{ #category : #accessing } +GtPhlowUpdateOnAnnouncement >> announcementDo: aBlock [ + self announcement ifNotNil: aBlock +] + +{ #category : #accessing } +GtPhlowUpdateOnAnnouncement >> announcer [ + ^ announcerValuable value +] + +{ #category : #accessing } +GtPhlowUpdateOnAnnouncement >> announcer: anAnnouncer [ + announcerValuable := anAnnouncer +] + +{ #category : #accessing } +GtPhlowUpdateOnAnnouncement >> announcerDo: aBlock [ + self announcer ifNotNil: aBlock +] + +{ #category : #accessing } +GtPhlowUpdateOnAnnouncement >> inputDo: aBlock [ + self announcer ifNotNil: [ :anAnnouncer | + self announcementDo: [ :anAnnouncement | + aBlock cull: anAnnouncer cull: anAnnouncement ] ] +] + +{ #category : #subscriptions } +GtPhlowUpdateOnAnnouncement >> installOn: anElement [ + "This method is called once for every created Phlow element." + + super installOn: anElement. + self inputDo: [ :anAnnouncer :anAnnouncement | + GtPhlowChangeAnnouncerListener + installOn: anElement + announcer: anAnnouncer + announcement: anAnnouncement ] +] diff --git a/src/GToolkit-Phlow/GtPhlowUtility.class.st b/src/GToolkit-Phlow/GtPhlowUtility.class.st index c10f7a87..5bb1eea4 100644 --- a/src/GToolkit-Phlow/GtPhlowUtility.class.st +++ b/src/GToolkit-Phlow/GtPhlowUtility.class.st @@ -86,6 +86,13 @@ GtPhlowUtility class >> createTabErrorElementFor: aPhlowView withError: anExcept aBlock value: aTab. ] +{ #category : #'accessing - defaults' } +GtPhlowUtility class >> defaultFutureExecutionConfiguration [ + ^ AsyncFutureExecutionConfiguration new + customGroup: #Phlow; + highPriority +] + { #category : #testing } GtPhlowUtility class >> defaultPriority [ ^ 75