From ec419a40c253e542056a3de8100b697a2506e7f6 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Mon, 12 Jul 2021 10:43:13 -0300 Subject: [PATCH] Several renames to improve naming consistency --- .../EventInterpreterDispatcherTest.class.st | 22 ++-- .../RadioGroupWebViewTest.class.st | 2 +- ...electionWebViewAsDropDownListTest.class.st | 2 +- ...ngleSelectionWebViewAsListBoxTest.class.st | 2 +- ...st => SingleSelectionWebViewTest.class.st} | 28 ++--- .../WebInteractionInterpreterTest.class.st | 2 +- ...> AbstractSingleSelectionWebView.class.st} | 40 ++++--- .../AbstractTableFooterWebView.class.st | 20 ++++ ...bstractWebInteractionInterpreter.class.st} | 78 ++++++------ ...> AbstractWebTableColumnRenderer.class.st} | 8 +- .../AsynchronicButtonWebView.class.st | 2 +- ....class.st => BinaryChoiceWebView.class.st} | 26 ++-- source/Willow-Core/CheckboxWebView.class.st | 4 +- ...ombinedEventInterpreterDispatcher.class.st | 2 +- ...CombinedWebInteractionInterpreter.class.st | 2 +- source/Willow-Core/ContainerWebView.class.st | 2 +- ... => DocumentLoadTriggeringPolicy.class.st} | 4 +- .../EventInterpreterDispatcher.class.st | 86 ++----------- ...ventInterpreterDispatcherBehavior.class.st | 41 ------- source/Willow-Core/FieldWebView.class.st | 2 +- ...nctionEvaluationTriggeringPolicy.class.st} | 8 +- source/Willow-Core/ImageWebView.class.st | 2 +- ...nteractionScriptTriggeringPolicy.class.st} | 8 +- source/Willow-Core/LinkWebView.class.st | 2 +- .../MultipleSelectionListBoxWebView.class.st | 2 +- .../NullTableFooterWebView.class.st | 2 +- source/Willow-Core/RadioGroupWebView.class.st | 4 +- .../SingleEventInterpreterDispatcher.class.st | 113 ++++++++++++++++++ .../SingleSelectionWebView.class.st | 4 +- .../SynchronicSubmitButtonWebView.class.st | 2 +- .../Willow-Core/TableFooterWebView.class.st | 2 +- .../TableFooterWebViewBehavior.class.st | 14 --- source/Willow-Core/TableWebView.class.st | 2 +- .../Willow-Core/UnorderedListWebView.class.st | 2 +- .../WebComponentInteraction.class.st | 4 +- .../WebInteractionInterpreter.class.st | 4 +- .../WebTableColumnRenderer.class.st | 2 +- source/Willow-Core/WillowApplication.class.st | 6 + 38 files changed, 294 insertions(+), 264 deletions(-) rename source/Willow-Core-Tests/{SingleSelectionWebViewBehaviorTest.class.st => SingleSelectionWebViewTest.class.st} (82%) rename source/Willow-Core/{SingleSelectionWebViewBehavior.class.st => AbstractSingleSelectionWebView.class.st} (68%) create mode 100644 source/Willow-Core/AbstractTableFooterWebView.class.st rename source/Willow-Core/{WebInteractionInterpreterBehavior.class.st => AbstractWebInteractionInterpreter.class.st} (59%) rename source/Willow-Core/{WebTableColumnRendererBehavior.class.st => AbstractWebTableColumnRenderer.class.st} (62%) rename source/Willow-Core/{BinaryChoiceWebViewBehavior.class.st => BinaryChoiceWebView.class.st} (60%) rename source/Willow-Core/{DocumentLoadTrigger.class.st => DocumentLoadTriggeringPolicy.class.st} (57%) delete mode 100644 source/Willow-Core/EventInterpreterDispatcherBehavior.class.st rename source/Willow-Core/{FunctionEvaluationTrigger.class.st => FunctionEvaluationTriggeringPolicy.class.st} (58%) rename source/Willow-Core/{InteractionScriptTrigger.class.st => InteractionScriptTriggeringPolicy.class.st} (61%) create mode 100644 source/Willow-Core/SingleEventInterpreterDispatcher.class.st delete mode 100644 source/Willow-Core/TableFooterWebViewBehavior.class.st diff --git a/source/Willow-Core-Tests/EventInterpreterDispatcherTest.class.st b/source/Willow-Core-Tests/EventInterpreterDispatcherTest.class.st index eeed1ca0..98ca6eb5 100644 --- a/source/Willow-Core-Tests/EventInterpreterDispatcherTest.class.st +++ b/source/Willow-Core-Tests/EventInterpreterDispatcherTest.class.st @@ -15,7 +15,7 @@ EventInterpreterDispatcherTest >> testApplyToOn [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToClick. + dispatcher := SingleEventInterpreterDispatcher defaultingToClick. dispatcher trigger inform: 'A message'. html := self apply: dispatcher toComponentDefinedBy: [ :canvas | canvas button ]. self @@ -30,7 +30,7 @@ EventInterpreterDispatcherTest >> testChange [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToClick. + dispatcher := SingleEventInterpreterDispatcher defaultingToClick. dispatcher change inform: 'A message'. html := self configureTextInputWith: dispatcher. self @@ -44,7 +44,7 @@ EventInterpreterDispatcherTest >> testClick [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToChange. + dispatcher := SingleEventInterpreterDispatcher defaultingToChange. dispatcher click inform: 'A message'. html := self configureTextInputWith: dispatcher. self @@ -58,7 +58,7 @@ EventInterpreterDispatcherTest >> testDefaultingToChange [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToChange. + dispatcher := SingleEventInterpreterDispatcher defaultingToChange. dispatcher trigger inform: 'A message'. html := self configureTextInputWith: dispatcher. self @@ -72,7 +72,7 @@ EventInterpreterDispatcherTest >> testDefaultingToChangeHidden [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToChangeHidden. + dispatcher := SingleEventInterpreterDispatcher defaultingToChangeHidden. dispatcher trigger inform: 'A message'. html := self configureTextInputWith: dispatcher. self @@ -86,7 +86,7 @@ EventInterpreterDispatcherTest >> testDefaultingToClick [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToClick. + dispatcher := SingleEventInterpreterDispatcher defaultingToClick. dispatcher trigger inform: 'A message'. html := self configureTextInputWith: dispatcher. self @@ -100,7 +100,7 @@ EventInterpreterDispatcherTest >> testDefaultingToClickHidden [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToClickHidden. + dispatcher := SingleEventInterpreterDispatcher defaultingToClickHidden. dispatcher trigger inform: 'A message'. html := self configureTextInputWith: dispatcher. self @@ -114,7 +114,7 @@ EventInterpreterDispatcherTest >> testEventNamed [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToChange. + dispatcher := SingleEventInterpreterDispatcher defaultingToChange. ( dispatcher eventNamed: #dblclick ) inform: 'A message'. html := self configureTextInputWith: dispatcher. self @@ -128,7 +128,7 @@ EventInterpreterDispatcherTest >> testKeyUp [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToChange. + dispatcher := SingleEventInterpreterDispatcher defaultingToChange. dispatcher keyUp inform: 'A message'. html := self configureTextInputWith: dispatcher. self @@ -142,7 +142,7 @@ EventInterpreterDispatcherTest >> testMouseOver [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToChange. + dispatcher := SingleEventInterpreterDispatcher defaultingToChange. dispatcher mouseOver inform: 'A message'. html := self configureTextInputWith: dispatcher. self @@ -156,7 +156,7 @@ EventInterpreterDispatcherTest >> testTrigger [ | dispatcher html | - dispatcher := EventInterpreterDispatcher defaultingToChange. + dispatcher := SingleEventInterpreterDispatcher defaultingToChange. dispatcher trigger inform: 'A message'. html := self configureTextInputWith: dispatcher. self diff --git a/source/Willow-Core-Tests/RadioGroupWebViewTest.class.st b/source/Willow-Core-Tests/RadioGroupWebViewTest.class.st index 945c51f6..debd36b9 100644 --- a/source/Willow-Core-Tests/RadioGroupWebViewTest.class.st +++ b/source/Willow-Core-Tests/RadioGroupWebViewTest.class.st @@ -3,7 +3,7 @@ A RadioGroupWebViewTest is a test class for testing the behavior of RadioGroupWe " Class { #name : #RadioGroupWebViewTest, - #superclass : #SingleSelectionWebViewBehaviorTest, + #superclass : #SingleSelectionWebViewTest, #category : #'Willow-Core-Tests-WebViews' } diff --git a/source/Willow-Core-Tests/SingleSelectionWebViewAsDropDownListTest.class.st b/source/Willow-Core-Tests/SingleSelectionWebViewAsDropDownListTest.class.st index c0b49bea..555ab67c 100644 --- a/source/Willow-Core-Tests/SingleSelectionWebViewAsDropDownListTest.class.st +++ b/source/Willow-Core-Tests/SingleSelectionWebViewAsDropDownListTest.class.st @@ -3,7 +3,7 @@ A DropDownListWebViewTest is a test class for testing the behavior of DropDownLi " Class { #name : #SingleSelectionWebViewAsDropDownListTest, - #superclass : #SingleSelectionWebViewBehaviorTest, + #superclass : #SingleSelectionWebViewTest, #category : #'Willow-Core-Tests-WebViews' } diff --git a/source/Willow-Core-Tests/SingleSelectionWebViewAsListBoxTest.class.st b/source/Willow-Core-Tests/SingleSelectionWebViewAsListBoxTest.class.st index 1ed8d829..0e74c2cf 100644 --- a/source/Willow-Core-Tests/SingleSelectionWebViewAsListBoxTest.class.st +++ b/source/Willow-Core-Tests/SingleSelectionWebViewAsListBoxTest.class.st @@ -3,7 +3,7 @@ A SingleSelectionListBoxWebViewTest is a test class for testing the behavior of " Class { #name : #SingleSelectionWebViewAsListBoxTest, - #superclass : #SingleSelectionWebViewBehaviorTest, + #superclass : #SingleSelectionWebViewTest, #category : #'Willow-Core-Tests-WebViews' } diff --git a/source/Willow-Core-Tests/SingleSelectionWebViewBehaviorTest.class.st b/source/Willow-Core-Tests/SingleSelectionWebViewTest.class.st similarity index 82% rename from source/Willow-Core-Tests/SingleSelectionWebViewBehaviorTest.class.st rename to source/Willow-Core-Tests/SingleSelectionWebViewTest.class.st index 008c2746..4f38fb68 100644 --- a/source/Willow-Core-Tests/SingleSelectionWebViewBehaviorTest.class.st +++ b/source/Willow-Core-Tests/SingleSelectionWebViewTest.class.st @@ -2,7 +2,7 @@ I'm an abstract test case for views implementing the single selection API " Class { - #name : #SingleSelectionWebViewBehaviorTest, + #name : #SingleSelectionWebViewTest, #superclass : #BWRenderingTest, #instVars : [ 'notificationWasReceived' @@ -11,25 +11,25 @@ Class { } { #category : #testing } -SingleSelectionWebViewBehaviorTest class >> isAbstract [ +SingleSelectionWebViewTest class >> isAbstract [ - ^self name = #SingleSelectionWebViewBehaviorTest + ^self name = #SingleSelectionWebViewTest ] { #category : #support } -SingleSelectionWebViewBehaviorTest >> changeNotifiedBy: aDropDownListWebView [ +SingleSelectionWebViewTest >> changeNotifiedBy: aDropDownListWebView [ notificationWasReceived := true ] { #category : #support } -SingleSelectionWebViewBehaviorTest >> newSingleSelectionView [ +SingleSelectionWebViewTest >> newSingleSelectionView [ ^self subclassResponsibility ] { #category : #'tests-Single Selection-API' } -SingleSelectionWebViewBehaviorTest >> testAllowsAnySatisfying [ +SingleSelectionWebViewTest >> testAllowsAnySatisfying [ | singleSelectionView | @@ -45,7 +45,7 @@ SingleSelectionWebViewBehaviorTest >> testAllowsAnySatisfying [ ] { #category : #'tests-Single Selection-API' } -SingleSelectionWebViewBehaviorTest >> testChooseAny [ +SingleSelectionWebViewTest >> testChooseAny [ | singleSelectionView allowedElements | @@ -65,7 +65,7 @@ SingleSelectionWebViewBehaviorTest >> testChooseAny [ ] { #category : #'tests-Single Selection-API' } -SingleSelectionWebViewBehaviorTest >> testChooseEqualTo [ +SingleSelectionWebViewTest >> testChooseEqualTo [ | singleSelectionView allowedElements | @@ -89,7 +89,7 @@ SingleSelectionWebViewBehaviorTest >> testChooseEqualTo [ ] { #category : #'tests-Single Selection-API' } -SingleSelectionWebViewBehaviorTest >> testNotifyChangesTo [ +SingleSelectionWebViewTest >> testNotifyChangesTo [ | singleSelectionView | @@ -103,7 +103,7 @@ SingleSelectionWebViewBehaviorTest >> testNotifyChangesTo [ ] { #category : #'tests-Single Selection-API' } -SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenAvailableElementsChangeButContainsTheSelectedOne [ +SingleSelectionWebViewTest >> testNotifyChangesWhenAvailableElementsChangeButContainsTheSelectedOne [ | singleSelectionView | @@ -124,7 +124,7 @@ SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenAvailableElementsChan ] { #category : #'tests-Single Selection-API' } -SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenAvailableElementsChangeButDoesNotContainTheSelectedOne [ +SingleSelectionWebViewTest >> testNotifyChangesWhenAvailableElementsChangeButDoesNotContainTheSelectedOne [ | singleSelectionView | @@ -146,7 +146,7 @@ SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenAvailableElementsChan ] { #category : #'tests-Single Selection-API' } -SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenSelectionChanged [ +SingleSelectionWebViewTest >> testNotifyChangesWhenSelectionChanged [ | singleSelectionView | @@ -163,7 +163,7 @@ SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenSelectionChanged [ ] { #category : #'tests-Single Selection-API' } -SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenSelectionDoesNotChange [ +SingleSelectionWebViewTest >> testNotifyChangesWhenSelectionDoesNotChange [ | singleSelectionView | @@ -181,7 +181,7 @@ SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenSelectionDoesNotChang ] { #category : #'tests-Single Selection-API' } -SingleSelectionWebViewBehaviorTest >> testWithCurrentSelectionDo [ +SingleSelectionWebViewTest >> testWithCurrentSelectionDo [ | singleSelectionView allowedElements | diff --git a/source/Willow-Core-Tests/WebInteractionInterpreterTest.class.st b/source/Willow-Core-Tests/WebInteractionInterpreterTest.class.st index f5df4e5d..42133f5b 100644 --- a/source/Willow-Core-Tests/WebInteractionInterpreterTest.class.st +++ b/source/Willow-Core-Tests/WebInteractionInterpreterTest.class.st @@ -1054,7 +1054,7 @@ WebInteractionInterpreterTest >> testWorkingWith [ interpreter := WebInteractionInterpreter workingWith: ( WebComponentInteraction - triggeredAccordingTo: ( InteractionScriptTrigger interactCalling: #dblclick ) + triggeredAccordingTo: ( InteractionScriptTriggeringPolicy interactCalling: #dblclick ) serializingWith: NullWebInteractionCommand new ). interpreter inform: 'A message'. html := self configureTextInputWith: interpreter. diff --git a/source/Willow-Core/SingleSelectionWebViewBehavior.class.st b/source/Willow-Core/AbstractSingleSelectionWebView.class.st similarity index 68% rename from source/Willow-Core/SingleSelectionWebViewBehavior.class.st rename to source/Willow-Core/AbstractSingleSelectionWebView.class.st index 1c628c34..065b896a 100644 --- a/source/Willow-Core/SingleSelectionWebViewBehavior.class.st +++ b/source/Willow-Core/AbstractSingleSelectionWebView.class.st @@ -2,7 +2,7 @@ I'm an abstract class representing single selection web views " Class { - #name : #SingleSelectionWebViewBehavior, + #name : #AbstractSingleSelectionWebView, #superclass : #WAPainter, #instVars : [ 'availableElements', @@ -12,14 +12,20 @@ Class { #category : #'Willow-Core-WebViews' } +{ #category : #testing } +AbstractSingleSelectionWebView class >> isAbstract [ + + ^ self = AbstractSingleSelectionWebView +] + { #category : #'instance creation' } -SingleSelectionWebViewBehavior class >> new [ +AbstractSingleSelectionWebView class >> new [ ^ super new initialize ] { #category : #'Single Selection-API' } -SingleSelectionWebViewBehavior >> allowAnyOf: anElementCollection [ +AbstractSingleSelectionWebView >> allowAnyOf: anElementCollection [ availableElements := anElementCollection. "Try to keep the current selection, if the new elements includes some object equal to the previous selection make it the chosen one." @@ -27,32 +33,32 @@ SingleSelectionWebViewBehavior >> allowAnyOf: anElementCollection [ ] { #category : #'Single Selection-API' } -SingleSelectionWebViewBehavior >> allowsAnySatisfying: aMatchBlock [ +AbstractSingleSelectionWebView >> allowsAnySatisfying: aMatchBlock [ ^availableElements anySatisfy: aMatchBlock ] { #category : #private } -SingleSelectionWebViewBehavior >> choose: anElement [ +AbstractSingleSelectionWebView >> choose: anElement [ chosenElementOptional := Optional containing: anElement. self notifyInterested ] { #category : #'Single Selection-API' } -SingleSelectionWebViewBehavior >> chooseAny [ +AbstractSingleSelectionWebView >> chooseAny [ self chooseAnySatisfying: [ :element | true ] ifNone: [ ] ] { #category : #'Single Selection-API' } -SingleSelectionWebViewBehavior >> chooseAnySatisfying: aMatchBlock ifNone: aBlock [ +AbstractSingleSelectionWebView >> chooseAnySatisfying: aMatchBlock ifNone: aBlock [ availableElements detect: aMatchBlock ifFound: [ :found | self choose: found ] ifNone: aBlock ] { #category : #'Single Selection-API' } -SingleSelectionWebViewBehavior >> chooseEqualTo: anElement [ +AbstractSingleSelectionWebView >> chooseEqualTo: anElement [ self chooseAnySatisfying: [ :element | element = anElement ] @@ -60,26 +66,26 @@ SingleSelectionWebViewBehavior >> chooseEqualTo: anElement [ ] { #category : #'Single Selection-API' } -SingleSelectionWebViewBehavior >> currentSelection [ +AbstractSingleSelectionWebView >> currentSelection [ ^ self currentSelectionIfNone: [ SelectionIsInvalid signal: 'Nothing is selected' ] ] { #category : #'Single Selection-API' } -SingleSelectionWebViewBehavior >> currentSelectionIfNone: aBlock [ +AbstractSingleSelectionWebView >> currentSelectionIfNone: aBlock [ ^ chosenElementOptional withContentDo: [ :element | element ] ifUnused: aBlock ] { #category : #'Single Selection-API' } -SingleSelectionWebViewBehavior >> disallowAll [ +AbstractSingleSelectionWebView >> disallowAll [ availableElements := #(). self invalidateSelection ] { #category : #initialization } -SingleSelectionWebViewBehavior >> initialize [ +AbstractSingleSelectionWebView >> initialize [ super initialize. interested := Set new. @@ -87,32 +93,32 @@ SingleSelectionWebViewBehavior >> initialize [ ] { #category : #private } -SingleSelectionWebViewBehavior >> invalidateSelection [ +AbstractSingleSelectionWebView >> invalidateSelection [ chosenElementOptional := Optional unusedBecause: 'There''s no element selected'. self notifyInterested ] { #category : #'Single Selection-API' } -SingleSelectionWebViewBehavior >> notifyChangesTo: aSupervisor [ +AbstractSingleSelectionWebView >> notifyChangesTo: aSupervisor [ interested add: aSupervisor ] { #category : #private } -SingleSelectionWebViewBehavior >> notifyInterested [ +AbstractSingleSelectionWebView >> notifyInterested [ interested do: [ :anInterested | anInterested changeNotifiedBy: self ] ] { #category : #configuring } -SingleSelectionWebViewBehavior >> on [ +AbstractSingleSelectionWebView >> on [ ^ self subclassResponsibility ] { #category : #'Single Selection-API' } -SingleSelectionWebViewBehavior >> withCurrentSelectionDo: aBlock [ +AbstractSingleSelectionWebView >> withCurrentSelectionDo: aBlock [ ^ chosenElementOptional withContentDo: aBlock ifUnused: [ ] ] diff --git a/source/Willow-Core/AbstractTableFooterWebView.class.st b/source/Willow-Core/AbstractTableFooterWebView.class.st new file mode 100644 index 00000000..875e802f --- /dev/null +++ b/source/Willow-Core/AbstractTableFooterWebView.class.st @@ -0,0 +1,20 @@ +" +I'm an abstract class representing table footers +" +Class { + #name : #AbstractTableFooterWebView, + #superclass : #WAPainter, + #category : #'Willow-Core-WebViews' +} + +{ #category : #testing } +AbstractTableFooterWebView class >> isAbstract [ + + ^ self = AbstractTableFooterWebView +] + +{ #category : #support } +AbstractTableFooterWebView >> changeNotifiedBy: aTableWebView [ + + ^ self subclassResponsibility +] diff --git a/source/Willow-Core/WebInteractionInterpreterBehavior.class.st b/source/Willow-Core/AbstractWebInteractionInterpreter.class.st similarity index 59% rename from source/Willow-Core/WebInteractionInterpreterBehavior.class.st rename to source/Willow-Core/AbstractWebInteractionInterpreter.class.st index ae074bbd..ad03d333 100644 --- a/source/Willow-Core/WebInteractionInterpreterBehavior.class.st +++ b/source/Willow-Core/AbstractWebInteractionInterpreter.class.st @@ -1,149 +1,155 @@ Class { - #name : #WebInteractionInterpreterBehavior, + #name : #AbstractWebInteractionInterpreter, #superclass : #WAObject, #category : #'Willow-Core-WebInteraction' } +{ #category : #testing } +AbstractWebInteractionInterpreter class >> isAbstract [ + + ^ self = AbstractWebInteractionInterpreter +] + { #category : #'Configuring - Dialogs' } -WebInteractionInterpreterBehavior >> closeAllDialogs [ +AbstractWebInteractionInterpreter >> closeAllDialogs [ self subclassResponsibility ] { #category : #'Configuring - Dialogs' } -WebInteractionInterpreterBehavior >> closeLastDialog [ +AbstractWebInteractionInterpreter >> closeLastDialog [ self subclassResponsibility ] { #category : #Configuring } -WebInteractionInterpreterBehavior >> confirmAsking: aQuestion [ +AbstractWebInteractionInterpreter >> confirmAsking: aQuestion [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> disable [ +AbstractWebInteractionInterpreter >> disable [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> disable: aComponent [ +AbstractWebInteractionInterpreter >> disable: aComponent [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> enable: aComponent [ +AbstractWebInteractionInterpreter >> enable: aComponent [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> focus: anIdentifiedWebView [ +AbstractWebInteractionInterpreter >> focus: anIdentifiedWebView [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> focusUsing: aComponentProvider [ +AbstractWebInteractionInterpreter >> focusUsing: aComponentProvider [ self subclassResponsibility ] { #category : #Configuring } -WebInteractionInterpreterBehavior >> inform: aMessage [ +AbstractWebInteractionInterpreter >> inform: aMessage [ self subclassResponsibility ] { #category : #Configuring } -WebInteractionInterpreterBehavior >> informSelection [ +AbstractWebInteractionInterpreter >> informSelection [ self subclassResponsibility ] { #category : #'Configuring - Dialogs' } -WebInteractionInterpreterBehavior >> open: aView [ +AbstractWebInteractionInterpreter >> open: aView [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> remove: anIdentifiedView [ +AbstractWebInteractionInterpreter >> remove: anIdentifiedView [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> render: anIdentifiedView [ +AbstractWebInteractionInterpreter >> render: anIdentifiedView [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> renderAll: anIdentifiedViewCollection [ +AbstractWebInteractionInterpreter >> renderAll: anIdentifiedViewCollection [ self subclassResponsibility ] { #category : #Configuring } -WebInteractionInterpreterBehavior >> scrollingIntoView: anIdentifier [ +AbstractWebInteractionInterpreter >> scrollingIntoView: anIdentifier [ self subclassResponsibility ] { #category : #'Configuring - Serialization' } -WebInteractionInterpreterBehavior >> serializeChildForm [ +AbstractWebInteractionInterpreter >> serializeChildForm [ self subclassResponsibility ] { #category : #'Configuring - Serialization' } -WebInteractionInterpreterBehavior >> serializeContainerForm [ +AbstractWebInteractionInterpreter >> serializeContainerForm [ self subclassResponsibility ] { #category : #'Configuring - Serialization' } -WebInteractionInterpreterBehavior >> serializeForm: anIdentifiedForm [ +AbstractWebInteractionInterpreter >> serializeForm: anIdentifiedForm [ self subclassResponsibility ] { #category : #'Configuring - Serialization' } -WebInteractionInterpreterBehavior >> serializeIt [ +AbstractWebInteractionInterpreter >> serializeIt [ self subclassResponsibility ] { #category : #'Configuring - Serialization' } -WebInteractionInterpreterBehavior >> serializeWithHiddenInputs [ +AbstractWebInteractionInterpreter >> serializeWithHiddenInputs [ self subclassResponsibility ] { #category : #Configuring } -WebInteractionInterpreterBehavior >> serverDo: aCallbackBlock [ +AbstractWebInteractionInterpreter >> serverDo: aCallbackBlock [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> setValueTo: aValueProvider thenTriggerChangeOf: aView [ +AbstractWebInteractionInterpreter >> setValueTo: aValueProvider thenTriggerChangeOf: aView [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> setValueTo: aValueProvider withoutTriggeringChangeOf: aView [ +AbstractWebInteractionInterpreter >> setValueTo: aValueProvider withoutTriggeringChangeOf: aView [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> show: aRenderable whileCallingServerToRender: anIdentifiedWebView [ +AbstractWebInteractionInterpreter >> show: aRenderable whileCallingServerToRender: anIdentifiedWebView [ "This will replace anIdentifiedWebView contents with aRenderable in the DOM before doing the server call, and replace it again with the rendering obtained from the server call response." @@ -154,37 +160,37 @@ WebInteractionInterpreterBehavior >> show: aRenderable whileCallingServerToRende ] { #category : #Configuring } -WebInteractionInterpreterBehavior >> showLoadingNotificationStyledAsAll: classes [ +AbstractWebInteractionInterpreter >> showLoadingNotificationStyledAsAll: classes [ self subclassResponsibility ] { #category : #'Configuring - Serialization' } -WebInteractionInterpreterBehavior >> submitForm: anIdentifiedForm [ +AbstractWebInteractionInterpreter >> submitForm: anIdentifiedForm [ self subclassResponsibility ] { #category : #Configuring } -WebInteractionInterpreterBehavior >> submitFormStyledAs: aCssStyle [ +AbstractWebInteractionInterpreter >> submitFormStyledAs: aCssStyle [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> temporarilyDisableAndTransform: anIdentifiedView into: aView [ +AbstractWebInteractionInterpreter >> temporarilyDisableAndTransform: anIdentifiedView into: aView [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> temporarilyDisableAndTransformInto: aView [ +AbstractWebInteractionInterpreter >> temporarilyDisableAndTransformInto: aView [ self subclassResponsibility ] { #category : #'Configuring - DOM' } -WebInteractionInterpreterBehavior >> transform: anIdentifiedWebView into: aRenderable [ +AbstractWebInteractionInterpreter >> transform: anIdentifiedWebView into: aRenderable [ "This will replace anIdentifiedWebView content with aRenderable on the browser side" @@ -192,7 +198,7 @@ WebInteractionInterpreterBehavior >> transform: anIdentifiedWebView into: aRende ] { #category : #'Configuring - CSS' } -WebInteractionInterpreterBehavior >> updateCssClasses: aCssClassConfigurationBlock [ +AbstractWebInteractionInterpreter >> updateCssClasses: aCssClassConfigurationBlock [ self updateCssClasses: aCssClassConfigurationBlock @@ -200,26 +206,26 @@ WebInteractionInterpreterBehavior >> updateCssClasses: aCssClassConfigurationBlo ] { #category : #'Configuring - CSS' } -WebInteractionInterpreterBehavior >> updateCssClasses: aCssClassConfigurationBlock +AbstractWebInteractionInterpreter >> updateCssClasses: aCssClassConfigurationBlock onElementsMatching: anElementMatchingBlock [ self subclassResponsibility ] { #category : #Configuring } -WebInteractionInterpreterBehavior >> userAgentDo: aServerIndependentAction [ +AbstractWebInteractionInterpreter >> userAgentDo: aServerIndependentAction [ self subclassResponsibility ] { #category : #Configuring } -WebInteractionInterpreterBehavior >> with: aParameter onlyWhen: aStringCondition serverDo: aCallbackBlock [ +AbstractWebInteractionInterpreter >> with: aParameter onlyWhen: aStringCondition serverDo: aCallbackBlock [ self subclassResponsibility ] { #category : #Configuring } -WebInteractionInterpreterBehavior >> with: aParameter serverDo: aCallbackBlock [ +AbstractWebInteractionInterpreter >> with: aParameter serverDo: aCallbackBlock [ self subclassResponsibility ] diff --git a/source/Willow-Core/WebTableColumnRendererBehavior.class.st b/source/Willow-Core/AbstractWebTableColumnRenderer.class.st similarity index 62% rename from source/Willow-Core/WebTableColumnRendererBehavior.class.st rename to source/Willow-Core/AbstractWebTableColumnRenderer.class.st index 166642b5..cfb772ae 100644 --- a/source/Willow-Core/WebTableColumnRendererBehavior.class.st +++ b/source/Willow-Core/AbstractWebTableColumnRenderer.class.st @@ -2,25 +2,25 @@ I'm an abstract class defining the required behavior for rendering columns in a table " Class { - #name : #WebTableColumnRendererBehavior, + #name : #AbstractWebTableColumnRenderer, #superclass : #Object, #category : #'Willow-Core-WebViews' } { #category : #rendering } -WebTableColumnRendererBehavior >> renderCellAt: anIndex for: anItem on: aCanvas [ +AbstractWebTableColumnRenderer >> renderCellAt: anIndex for: anItem on: aCanvas [ self subclassResponsibility ] { #category : #rendering } -WebTableColumnRendererBehavior >> renderFooterCellSummarizing: tableContents on: aCanvas [ +AbstractWebTableColumnRenderer >> renderFooterCellSummarizing: tableContents on: aCanvas [ self subclassResponsibility ] { #category : #rendering } -WebTableColumnRendererBehavior >> renderHeadingOn: aCanvas [ +AbstractWebTableColumnRenderer >> renderHeadingOn: aCanvas [ self subclassResponsibility ] diff --git a/source/Willow-Core/AsynchronicButtonWebView.class.st b/source/Willow-Core/AsynchronicButtonWebView.class.st index 7fd6a09c..85424518 100644 --- a/source/Willow-Core/AsynchronicButtonWebView.class.st +++ b/source/Willow-Core/AsynchronicButtonWebView.class.st @@ -43,7 +43,7 @@ AsynchronicButtonWebView >> initializeLabeled: aLabel applying: aComponentComman label := aLabel. commandToComponent := aComponentCommand. identifierAssigner := IdentifierAssigner prefixedBy: 'button'. - interactionInterpreter := EventInterpreterDispatcher defaultingToClick + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToClick ] { #category : #configuring } diff --git a/source/Willow-Core/BinaryChoiceWebViewBehavior.class.st b/source/Willow-Core/BinaryChoiceWebView.class.st similarity index 60% rename from source/Willow-Core/BinaryChoiceWebViewBehavior.class.st rename to source/Willow-Core/BinaryChoiceWebView.class.st index 9283e796..86fb99ea 100644 --- a/source/Willow-Core/BinaryChoiceWebViewBehavior.class.st +++ b/source/Willow-Core/BinaryChoiceWebView.class.st @@ -2,7 +2,7 @@ I'm an abstract class representing binary choice web views " Class { - #name : #BinaryChoiceWebViewBehavior, + #name : #BinaryChoiceWebView, #superclass : #WAPainter, #instVars : [ 'interested', @@ -12,31 +12,31 @@ Class { } { #category : #testing } -BinaryChoiceWebViewBehavior class >> isAbstract [ +BinaryChoiceWebView class >> isAbstract [ - ^ self name = #BinaryChoiceWebViewBehavior + ^ self name = #BinaryChoiceWebView ] { #category : #'instance creation' } -BinaryChoiceWebViewBehavior class >> onModel: anObjectToUseWhenOn offModel: anObjectToUseWhenOff [ +BinaryChoiceWebView class >> onModel: anObjectToUseWhenOn offModel: anObjectToUseWhenOff [ ^self new initializeOnModel: anObjectToUseWhenOn offModel: anObjectToUseWhenOff ] { #category : #'Binary Choice-API' } -BinaryChoiceWebViewBehavior >> allows: aModel [ +BinaryChoiceWebView >> allows: aModel [ ^ iterator includes: aModel ] { #category : #'Binary Choice-API' } -BinaryChoiceWebViewBehavior >> currentSelection [ +BinaryChoiceWebView >> currentSelection [ ^ iterator current ] { #category : #initialization } -BinaryChoiceWebViewBehavior >> initializeOnModel: anObjectToUseWhenOn offModel: anObjectToUseWhenOff [ +BinaryChoiceWebView >> initializeOnModel: anObjectToUseWhenOn offModel: anObjectToUseWhenOff [ iterator := CircularIterator cyclingOver: @@ -46,25 +46,25 @@ BinaryChoiceWebViewBehavior >> initializeOnModel: anObjectToUseWhenOn offModel: ] { #category : #'Binary Choice-API' } -BinaryChoiceWebViewBehavior >> notifyChangesTo: aSupervisor [ +BinaryChoiceWebView >> notifyChangesTo: aSupervisor [ interested add: aSupervisor ] { #category : #private } -BinaryChoiceWebViewBehavior >> notifyInterested [ +BinaryChoiceWebView >> notifyInterested [ interested do: [ :anInterested | anInterested changeNotifiedBy: self ] ] { #category : #configuring } -BinaryChoiceWebViewBehavior >> on [ +BinaryChoiceWebView >> on [ ^ self subclassResponsibility ] { #category : #'Binary Choice-API' } -BinaryChoiceWebViewBehavior >> selectOffModel [ +BinaryChoiceWebView >> selectOffModel [ iterator reset. self toggleCurrentSelection. @@ -72,14 +72,14 @@ BinaryChoiceWebViewBehavior >> selectOffModel [ ] { #category : #'Binary Choice-API' } -BinaryChoiceWebViewBehavior >> selectOnModel [ +BinaryChoiceWebView >> selectOnModel [ iterator reset. self notifyInterested ] { #category : #'Binary Choice-API' } -BinaryChoiceWebViewBehavior >> toggleCurrentSelection [ +BinaryChoiceWebView >> toggleCurrentSelection [ iterator next. self notifyInterested diff --git a/source/Willow-Core/CheckboxWebView.class.st b/source/Willow-Core/CheckboxWebView.class.st index 40249582..d0867511 100644 --- a/source/Willow-Core/CheckboxWebView.class.st +++ b/source/Willow-Core/CheckboxWebView.class.st @@ -3,7 +3,7 @@ I'm a binary choice web view implemented as a checkbox " Class { #name : #CheckboxWebView, - #superclass : #BinaryChoiceWebViewBehavior, + #superclass : #BinaryChoiceWebView, #instVars : [ 'commandToComponent', 'interactionInterpreter', @@ -65,7 +65,7 @@ CheckboxWebView >> initializeLabeledAccordingTo: anOptionalLabel applying: aComm labelOptional := anOptionalLabel. commandToComponent := aCommandToComponent. - interactionInterpreter := EventInterpreterDispatcher defaultingToClickHidden. + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToClickHidden. identifierAssigner := IdentifierAssigner prefixedBy: 'checkbox'. isChecked := true ] diff --git a/source/Willow-Core/CombinedEventInterpreterDispatcher.class.st b/source/Willow-Core/CombinedEventInterpreterDispatcher.class.st index 642627af..5b0d3770 100644 --- a/source/Willow-Core/CombinedEventInterpreterDispatcher.class.st +++ b/source/Willow-Core/CombinedEventInterpreterDispatcher.class.st @@ -1,6 +1,6 @@ Class { #name : #CombinedEventInterpreterDispatcher, - #superclass : #EventInterpreterDispatcherBehavior, + #superclass : #EventInterpreterDispatcher, #instVars : [ 'eventInterpreterDispatchers' ], diff --git a/source/Willow-Core/CombinedWebInteractionInterpreter.class.st b/source/Willow-Core/CombinedWebInteractionInterpreter.class.st index 910adb70..0c6ec2da 100644 --- a/source/Willow-Core/CombinedWebInteractionInterpreter.class.st +++ b/source/Willow-Core/CombinedWebInteractionInterpreter.class.st @@ -1,6 +1,6 @@ Class { #name : #CombinedWebInteractionInterpreter, - #superclass : #WebInteractionInterpreterBehavior, + #superclass : #AbstractWebInteractionInterpreter, #instVars : [ 'interpreters' ], diff --git a/source/Willow-Core/ContainerWebView.class.st b/source/Willow-Core/ContainerWebView.class.st index 24cdba50..cb496c0c 100644 --- a/source/Willow-Core/ContainerWebView.class.st +++ b/source/Willow-Core/ContainerWebView.class.st @@ -39,7 +39,7 @@ ContainerWebView >> initializeWrapping: aRenderable intoElementBuiltUsing: anEle renderableContent := aRenderable. commandToComponent := aComponentCommand. identifierAssigner := IdentifierAssigner prefixedBy: 'container'. - interactionInterpreter := EventInterpreterDispatcher defaultingToClick + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToClick ] { #category : #configuring } diff --git a/source/Willow-Core/DocumentLoadTrigger.class.st b/source/Willow-Core/DocumentLoadTriggeringPolicy.class.st similarity index 57% rename from source/Willow-Core/DocumentLoadTrigger.class.st rename to source/Willow-Core/DocumentLoadTriggeringPolicy.class.st index bd50dd31..7ec5eebd 100644 --- a/source/Willow-Core/DocumentLoadTrigger.class.st +++ b/source/Willow-Core/DocumentLoadTriggeringPolicy.class.st @@ -1,11 +1,11 @@ Class { - #name : #DocumentLoadTrigger, + #name : #DocumentLoadTriggeringPolicy, #superclass : #TriggeringPolicy, #category : #'Willow-Core-WebInteraction' } { #category : #evaluating } -DocumentLoadTrigger >> apply: anAsynchronousCall to: aComponent on: aCanvas [ +DocumentLoadTriggeringPolicy >> apply: anAsynchronousCall to: aComponent on: aCanvas [ aCanvas document addLoadScript: anAsynchronousCall ] diff --git a/source/Willow-Core/EventInterpreterDispatcher.class.st b/source/Willow-Core/EventInterpreterDispatcher.class.st index 62bda71a..4ad954e5 100644 --- a/source/Willow-Core/EventInterpreterDispatcher.class.st +++ b/source/Willow-Core/EventInterpreterDispatcher.class.st @@ -1,113 +1,47 @@ Class { #name : #EventInterpreterDispatcher, - #superclass : #EventInterpreterDispatcherBehavior, - #instVars : [ - 'interpretersByEvent', - 'defaultInterpreter' - ], + #superclass : #Object, #category : #'Willow-Core-WebInteraction' } -{ #category : #'instance creation' } -EventInterpreterDispatcher class >> defaultingToChange [ +{ #category : #testing } +EventInterpreterDispatcher class >> isAbstract [ - ^ self interpretingByDefault: #change configuring: ( self interpreterSending: #change ) -] - -{ #category : #'instance creation' } -EventInterpreterDispatcher class >> defaultingToChangeHidden [ - - ^ self - interpretingByDefault: #change - configuring: - ( WebInteractionInterpreter - calling: #change - serializingWith: SerializationCommand forCurrentObjectWithHiddenInputs ) -] - -{ #category : #'instance creation' } -EventInterpreterDispatcher class >> defaultingToClick [ - - ^ self interpretingByDefault: #click configuring: ( self interpreterSending: #click ) -] - -{ #category : #'instance creation' } -EventInterpreterDispatcher class >> defaultingToClickHidden [ - - ^ self - interpretingByDefault: #click - configuring: - ( WebInteractionInterpreter - calling: #click - serializingWith: SerializationCommand forCurrentObjectWithHiddenInputs ) -] - -{ #category : #'private - accessing' } -EventInterpreterDispatcher class >> interpreterSending: anEventName [ - - | serializationCommand | - - "Users can always manually add a serialization command to the interaction collaboration if the situation requires it." - serializationCommand := ( #(change keyup) includes: anEventName ) - then: [ SerializationCommand forCurrentObject ] - otherwise: NullWebInteractionCommand new. - - ^ WebInteractionInterpreter calling: anEventName serializingWith: serializationCommand -] - -{ #category : #'private - instance creation' } -EventInterpreterDispatcher class >> interpretingByDefault: anEventName configuring: aWebInteractionInterpreter [ - - ^ self new initializeInterpretingByDefault: anEventName configuring: aWebInteractionInterpreter -] - -{ #category : #evaluating } -EventInterpreterDispatcher >> applyTo: aComponent on: aCanvas [ - - interpretersByEvent - keysAndValuesDo: [ :event :interpreter | interpreter applyTo: aComponent on: aCanvas ] + ^ self = EventInterpreterDispatcher ] { #category : #configuring } EventInterpreterDispatcher >> change [ - ^ self eventNamed: #change + ^ self subclassResponsibility ] { #category : #configuring } EventInterpreterDispatcher >> click [ - ^ self eventNamed: #click + ^ self subclassResponsibility ] { #category : #configuring } EventInterpreterDispatcher >> eventNamed: anEventName [ - ^ interpretersByEvent at: anEventName ifAbsentPut: [ self class interpreterSending: anEventName ] -] - -{ #category : #initialization } -EventInterpreterDispatcher >> initializeInterpretingByDefault: anEventName configuring: aWebInteractionInterpreter [ - - defaultInterpreter := aWebInteractionInterpreter. - interpretersByEvent := Dictionary new. - interpretersByEvent at: anEventName put: aWebInteractionInterpreter + ^ self subclassResponsibility ] { #category : #configuring } EventInterpreterDispatcher >> keyUp [ - ^ self eventNamed: #keyup + ^ self subclassResponsibility ] { #category : #configuring } EventInterpreterDispatcher >> mouseOver [ - ^ self eventNamed: #mouseover + ^ self subclassResponsibility ] { #category : #configuring } EventInterpreterDispatcher >> trigger [ - ^ defaultInterpreter + ^ self subclassResponsibility ] diff --git a/source/Willow-Core/EventInterpreterDispatcherBehavior.class.st b/source/Willow-Core/EventInterpreterDispatcherBehavior.class.st deleted file mode 100644 index 884da1cf..00000000 --- a/source/Willow-Core/EventInterpreterDispatcherBehavior.class.st +++ /dev/null @@ -1,41 +0,0 @@ -Class { - #name : #EventInterpreterDispatcherBehavior, - #superclass : #Object, - #category : #'Willow-Core-WebInteraction' -} - -{ #category : #configuring } -EventInterpreterDispatcherBehavior >> change [ - - ^ self subclassResponsibility -] - -{ #category : #configuring } -EventInterpreterDispatcherBehavior >> click [ - - ^ self subclassResponsibility -] - -{ #category : #configuring } -EventInterpreterDispatcherBehavior >> eventNamed: anEventName [ - - ^ self subclassResponsibility -] - -{ #category : #configuring } -EventInterpreterDispatcherBehavior >> keyUp [ - - ^ self subclassResponsibility -] - -{ #category : #configuring } -EventInterpreterDispatcherBehavior >> mouseOver [ - - ^ self subclassResponsibility -] - -{ #category : #configuring } -EventInterpreterDispatcherBehavior >> trigger [ - - ^ self subclassResponsibility -] diff --git a/source/Willow-Core/FieldWebView.class.st b/source/Willow-Core/FieldWebView.class.st index 539b1b45..3a90c943 100644 --- a/source/Willow-Core/FieldWebView.class.st +++ b/source/Willow-Core/FieldWebView.class.st @@ -18,7 +18,7 @@ Class { { #category : #private } FieldWebView class >> changeInterpreter [ - ^ EventInterpreterDispatcher defaultingToChange + ^ SingleEventInterpreterDispatcher defaultingToChange ] { #category : #private } diff --git a/source/Willow-Core/FunctionEvaluationTrigger.class.st b/source/Willow-Core/FunctionEvaluationTriggeringPolicy.class.st similarity index 58% rename from source/Willow-Core/FunctionEvaluationTrigger.class.st rename to source/Willow-Core/FunctionEvaluationTriggeringPolicy.class.st index f387cd50..1fefab05 100644 --- a/source/Willow-Core/FunctionEvaluationTrigger.class.st +++ b/source/Willow-Core/FunctionEvaluationTriggeringPolicy.class.st @@ -1,5 +1,5 @@ Class { - #name : #FunctionEvaluationTrigger, + #name : #FunctionEvaluationTriggeringPolicy, #superclass : #TriggeringPolicy, #instVars : [ 'functionSelector', @@ -9,19 +9,19 @@ Class { } { #category : #'instance creation' } -FunctionEvaluationTrigger class >> sending: aFunctionSelector parameterizedBy: anArgumentNameCollection [ +FunctionEvaluationTriggeringPolicy class >> sending: aFunctionSelector parameterizedBy: anArgumentNameCollection [ ^ self new initializeSending: aFunctionSelector parameterizedBy: anArgumentNameCollection ] { #category : #evaluating } -FunctionEvaluationTrigger >> apply: anAsynchronousCall to: aComponent on: aCanvas [ +FunctionEvaluationTriggeringPolicy >> apply: anAsynchronousCall to: aComponent on: aCanvas [ aComponent perform: functionSelector with: ( anAsynchronousCall asFunction: argumentNames ) ] { #category : #initialization } -FunctionEvaluationTrigger >> initializeSending: aFunctionSelector parameterizedBy: anArgumentNameCollection [ +FunctionEvaluationTriggeringPolicy >> initializeSending: aFunctionSelector parameterizedBy: anArgumentNameCollection [ functionSelector := aFunctionSelector. argumentNames := anArgumentNameCollection diff --git a/source/Willow-Core/ImageWebView.class.st b/source/Willow-Core/ImageWebView.class.st index e28e3e0e..7d077430 100644 --- a/source/Willow-Core/ImageWebView.class.st +++ b/source/Willow-Core/ImageWebView.class.st @@ -29,7 +29,7 @@ ImageWebView >> initializeLocatedAt: aLocation applying: aComponentCommand [ imageLocation := aLocation. commandToComponent := aComponentCommand. - interactionInterpreter := EventInterpreterDispatcher defaultingToClick + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToClick ] { #category : #configuring } diff --git a/source/Willow-Core/InteractionScriptTrigger.class.st b/source/Willow-Core/InteractionScriptTriggeringPolicy.class.st similarity index 61% rename from source/Willow-Core/InteractionScriptTrigger.class.st rename to source/Willow-Core/InteractionScriptTriggeringPolicy.class.st index e880ac82..bdc4d418 100644 --- a/source/Willow-Core/InteractionScriptTrigger.class.st +++ b/source/Willow-Core/InteractionScriptTriggeringPolicy.class.st @@ -1,5 +1,5 @@ Class { - #name : #InteractionScriptTrigger, + #name : #InteractionScriptTriggeringPolicy, #superclass : #TriggeringPolicy, #instVars : [ 'eventName' @@ -8,13 +8,13 @@ Class { } { #category : #'instance creation' } -InteractionScriptTrigger class >> interactCalling: anEventName [ +InteractionScriptTriggeringPolicy class >> interactCalling: anEventName [ ^ self new initializeInteractCalling: anEventName ] { #category : #evaluating } -InteractionScriptTrigger >> apply: aJavascriptScript to: aComponent on: aCanvas [ +InteractionScriptTriggeringPolicy >> apply: aJavascriptScript to: aComponent on: aCanvas [ aCanvas ensureIdFor: aComponent. aComponent @@ -22,7 +22,7 @@ InteractionScriptTrigger >> apply: aJavascriptScript to: aComponent on: aCanvas ] { #category : #initialization } -InteractionScriptTrigger >> initializeInteractCalling: anEventName [ +InteractionScriptTriggeringPolicy >> initializeInteractCalling: anEventName [ eventName := anEventName ] diff --git a/source/Willow-Core/LinkWebView.class.st b/source/Willow-Core/LinkWebView.class.st index 9a5b597d..073f4d7f 100644 --- a/source/Willow-Core/LinkWebView.class.st +++ b/source/Willow-Core/LinkWebView.class.st @@ -40,7 +40,7 @@ LinkWebView >> initializeLabeled: aLabel applying: aComponentCommand [ label := aLabel. commandToComponent := aComponentCommand. - interactionInterpreter := EventInterpreterDispatcher defaultingToClick + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToClick ] { #category : #configuring } diff --git a/source/Willow-Core/MultipleSelectionListBoxWebView.class.st b/source/Willow-Core/MultipleSelectionListBoxWebView.class.st index 0dd9ba6f..648499f5 100644 --- a/source/Willow-Core/MultipleSelectionListBoxWebView.class.st +++ b/source/Willow-Core/MultipleSelectionListBoxWebView.class.st @@ -91,7 +91,7 @@ MultipleSelectionListBoxWebView >> initializeApplying: aCommandToComponent [ interested := Set new. commandToComponent := aCommandToComponent. - interactionInterpreter := EventInterpreterDispatcher defaultingToChangeHidden. + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToChangeHidden. identifierAssigner := IdentifierAssigner prefixedBy: 'list-box'. self disallowAll ] diff --git a/source/Willow-Core/NullTableFooterWebView.class.st b/source/Willow-Core/NullTableFooterWebView.class.st index 4c17b02b..55138347 100644 --- a/source/Willow-Core/NullTableFooterWebView.class.st +++ b/source/Willow-Core/NullTableFooterWebView.class.st @@ -3,7 +3,7 @@ I represent the absence of a table footer " Class { #name : #NullTableFooterWebView, - #superclass : #TableFooterWebViewBehavior, + #superclass : #AbstractTableFooterWebView, #category : #'Willow-Core-WebViews' } diff --git a/source/Willow-Core/RadioGroupWebView.class.st b/source/Willow-Core/RadioGroupWebView.class.st index 8881b230..02b59a16 100644 --- a/source/Willow-Core/RadioGroupWebView.class.st +++ b/source/Willow-Core/RadioGroupWebView.class.st @@ -3,7 +3,7 @@ I'm a group of radio buttons allowing the user to select one of many options. " Class { #name : #RadioGroupWebView, - #superclass : #SingleSelectionWebViewBehavior, + #superclass : #AbstractSingleSelectionWebView, #instVars : [ 'interactionInterpreter', 'renderingBlock', @@ -36,7 +36,7 @@ RadioGroupWebView >> initializeRenderingWith: aRenderingBlock applyingToLabel: a labelCommand := aLabelCommand. inputCommand := anInputCommand. - interactionInterpreter := EventInterpreterDispatcher defaultingToChange. + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToChange. renderingBlock := aRenderingBlock ] diff --git a/source/Willow-Core/SingleEventInterpreterDispatcher.class.st b/source/Willow-Core/SingleEventInterpreterDispatcher.class.st new file mode 100644 index 00000000..85a81ba9 --- /dev/null +++ b/source/Willow-Core/SingleEventInterpreterDispatcher.class.st @@ -0,0 +1,113 @@ +Class { + #name : #SingleEventInterpreterDispatcher, + #superclass : #EventInterpreterDispatcher, + #instVars : [ + 'interpretersByEvent', + 'defaultInterpreter' + ], + #category : #'Willow-Core-WebInteraction' +} + +{ #category : #'instance creation' } +SingleEventInterpreterDispatcher class >> defaultingToChange [ + + ^ self interpretingByDefault: #change configuring: ( self interpreterSending: #change ) +] + +{ #category : #'instance creation' } +SingleEventInterpreterDispatcher class >> defaultingToChangeHidden [ + + ^ self + interpretingByDefault: #change + configuring: + ( WebInteractionInterpreter + calling: #change + serializingWith: SerializationCommand forCurrentObjectWithHiddenInputs ) +] + +{ #category : #'instance creation' } +SingleEventInterpreterDispatcher class >> defaultingToClick [ + + ^ self interpretingByDefault: #click configuring: ( self interpreterSending: #click ) +] + +{ #category : #'instance creation' } +SingleEventInterpreterDispatcher class >> defaultingToClickHidden [ + + ^ self + interpretingByDefault: #click + configuring: + ( WebInteractionInterpreter + calling: #click + serializingWith: SerializationCommand forCurrentObjectWithHiddenInputs ) +] + +{ #category : #'private - accessing' } +SingleEventInterpreterDispatcher class >> interpreterSending: anEventName [ + + | serializationCommand | + + "Users can always manually add a serialization command to the interaction collaboration if the situation requires it." + serializationCommand := ( #(change keyup) includes: anEventName ) + then: [ SerializationCommand forCurrentObject ] + otherwise: NullWebInteractionCommand new. + + ^ WebInteractionInterpreter calling: anEventName serializingWith: serializationCommand +] + +{ #category : #'private - instance creation' } +SingleEventInterpreterDispatcher class >> interpretingByDefault: anEventName configuring: aWebInteractionInterpreter [ + + ^ self new initializeInterpretingByDefault: anEventName configuring: aWebInteractionInterpreter +] + +{ #category : #evaluating } +SingleEventInterpreterDispatcher >> applyTo: aComponent on: aCanvas [ + + interpretersByEvent + keysAndValuesDo: [ :event :interpreter | interpreter applyTo: aComponent on: aCanvas ] +] + +{ #category : #configuring } +SingleEventInterpreterDispatcher >> change [ + + ^ self eventNamed: #change +] + +{ #category : #configuring } +SingleEventInterpreterDispatcher >> click [ + + ^ self eventNamed: #click +] + +{ #category : #configuring } +SingleEventInterpreterDispatcher >> eventNamed: anEventName [ + + ^ interpretersByEvent at: anEventName ifAbsentPut: [ self class interpreterSending: anEventName ] +] + +{ #category : #initialization } +SingleEventInterpreterDispatcher >> initializeInterpretingByDefault: anEventName configuring: aWebInteractionInterpreter [ + + defaultInterpreter := aWebInteractionInterpreter. + interpretersByEvent := Dictionary new. + interpretersByEvent at: anEventName put: aWebInteractionInterpreter +] + +{ #category : #configuring } +SingleEventInterpreterDispatcher >> keyUp [ + + ^ self eventNamed: #keyup +] + +{ #category : #configuring } +SingleEventInterpreterDispatcher >> mouseOver [ + + ^ self eventNamed: #mouseover +] + +{ #category : #configuring } +SingleEventInterpreterDispatcher >> trigger [ + + ^ defaultInterpreter +] diff --git a/source/Willow-Core/SingleSelectionWebView.class.st b/source/Willow-Core/SingleSelectionWebView.class.st index a06da028..47ee3023 100644 --- a/source/Willow-Core/SingleSelectionWebView.class.st +++ b/source/Willow-Core/SingleSelectionWebView.class.st @@ -1,6 +1,6 @@ Class { #name : #SingleSelectionWebView, - #superclass : #SingleSelectionWebViewBehavior, + #superclass : #AbstractSingleSelectionWebView, #instVars : [ 'interactionInterpreter', 'identifierAssigner', @@ -66,7 +66,7 @@ SingleSelectionWebView >> initializeApplyingToSelect: aSelectCommand applyingToO selectCommand := aSelectCommand. optionCommand := anOptionCommand. - interactionInterpreter := EventInterpreterDispatcher defaultingToChange. + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToChange. identifierAssigner := IdentifierAssigner prefixedBy: 'single-select'. ] diff --git a/source/Willow-Core/SynchronicSubmitButtonWebView.class.st b/source/Willow-Core/SynchronicSubmitButtonWebView.class.st index 62fecf64..7f052c6b 100644 --- a/source/Willow-Core/SynchronicSubmitButtonWebView.class.st +++ b/source/Willow-Core/SynchronicSubmitButtonWebView.class.st @@ -40,7 +40,7 @@ SynchronicSubmitButtonWebView >> initializeLabeled: aLabel applying: aCommandCol label := aLabel. commandToComponent := aCommandCollection. - interactionInterpreter := EventInterpreterDispatcher defaultingToClick. + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToClick. submitCallback := actionOnSubmit. identifierAssigner := IdentifierAssigner prefixedBy: 'submit-button' ] diff --git a/source/Willow-Core/TableFooterWebView.class.st b/source/Willow-Core/TableFooterWebView.class.st index b9def68c..b779b385 100644 --- a/source/Willow-Core/TableFooterWebView.class.st +++ b/source/Willow-Core/TableFooterWebView.class.st @@ -3,7 +3,7 @@ I represent a table footer " Class { #name : #TableFooterWebView, - #superclass : #TableFooterWebViewBehavior, + #superclass : #AbstractTableFooterWebView, #instVars : [ 'columnRenderers', 'tableContents' diff --git a/source/Willow-Core/TableFooterWebViewBehavior.class.st b/source/Willow-Core/TableFooterWebViewBehavior.class.st deleted file mode 100644 index 20efa832..00000000 --- a/source/Willow-Core/TableFooterWebViewBehavior.class.st +++ /dev/null @@ -1,14 +0,0 @@ -" -I'm an abstract class representing table footers -" -Class { - #name : #TableFooterWebViewBehavior, - #superclass : #WAPainter, - #category : #'Willow-Core-WebViews' -} - -{ #category : #support } -TableFooterWebViewBehavior >> changeNotifiedBy: aTableWebView [ - - ^ self subclassResponsibility -] diff --git a/source/Willow-Core/TableWebView.class.st b/source/Willow-Core/TableWebView.class.st index a69374fe..a1f85ab9 100644 --- a/source/Willow-Core/TableWebView.class.st +++ b/source/Willow-Core/TableWebView.class.st @@ -64,7 +64,7 @@ TableWebView >> initializeDefinedBy: aColumnRendererCollection applying: aTableC header := aHeader. footer := aFooter. self notifyChangesTo: footer. - interactionInterpreter := EventInterpreterDispatcher defaultingToClick. + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToClick. identifierAssigner := IdentifierAssigner prefixedBy: 'table'. self changeContentsTo: #() ] diff --git a/source/Willow-Core/UnorderedListWebView.class.st b/source/Willow-Core/UnorderedListWebView.class.st index 22200096..b31f5756 100644 --- a/source/Willow-Core/UnorderedListWebView.class.st +++ b/source/Willow-Core/UnorderedListWebView.class.st @@ -41,7 +41,7 @@ UnorderedListWebView >> initializeApplying: aComponentCommand listing: anElement elements := anElementCollection. commandToItem := anElementCommand. commandToList := aComponentCommand. - interactionInterpreter := EventInterpreterDispatcher defaultingToClick. + interactionInterpreter := SingleEventInterpreterDispatcher defaultingToClick. identifierAssigner := IdentifierAssigner prefixedBy: 'unordered-list' ] diff --git a/source/Willow-Core/WebComponentInteraction.class.st b/source/Willow-Core/WebComponentInteraction.class.st index a0e0d242..daa4b4c5 100644 --- a/source/Willow-Core/WebComponentInteraction.class.st +++ b/source/Willow-Core/WebComponentInteraction.class.st @@ -28,14 +28,14 @@ WebComponentInteraction class >> triggeredAccordingTo: aTriggerPolicy serializin { #category : #'instance creation' } WebComponentInteraction class >> triggeredOnDocumentLoad [ - ^ self triggeredAccordingTo: DocumentLoadTrigger new serializingWith: NullWebInteractionCommand new + ^ self triggeredAccordingTo: DocumentLoadTriggeringPolicy new serializingWith: NullWebInteractionCommand new ] { #category : #'instance creation' } WebComponentInteraction class >> triggeredOnEvaluationOf: aSelector withAll: aParameterArray [ ^ self - triggeredAccordingTo: ( FunctionEvaluationTrigger sending: aSelector parameterizedBy: aParameterArray ) + triggeredAccordingTo: ( FunctionEvaluationTriggeringPolicy sending: aSelector parameterizedBy: aParameterArray ) serializingWith: SerializationCommand forCurrentObject ] diff --git a/source/Willow-Core/WebInteractionInterpreter.class.st b/source/Willow-Core/WebInteractionInterpreter.class.st index f41dad38..226b3816 100644 --- a/source/Willow-Core/WebInteractionInterpreter.class.st +++ b/source/Willow-Core/WebInteractionInterpreter.class.st @@ -1,6 +1,6 @@ Class { #name : #WebInteractionInterpreter, - #superclass : #WebInteractionInterpreterBehavior, + #superclass : #AbstractWebInteractionInterpreter, #instVars : [ 'interaction' ], @@ -13,7 +13,7 @@ WebInteractionInterpreter class >> calling: anEventName serializingWith: seriali ^ self workingWith: ( WebComponentInteraction - triggeredAccordingTo: ( InteractionScriptTrigger interactCalling: anEventName ) + triggeredAccordingTo: ( InteractionScriptTriggeringPolicy interactCalling: anEventName ) serializingWith: serializationCommand ) ] diff --git a/source/Willow-Core/WebTableColumnRenderer.class.st b/source/Willow-Core/WebTableColumnRenderer.class.st index e5a7f00d..45abad82 100644 --- a/source/Willow-Core/WebTableColumnRenderer.class.st +++ b/source/Willow-Core/WebTableColumnRenderer.class.st @@ -3,7 +3,7 @@ I'm responsible of rendering a column and header in a table. " Class { #name : #WebTableColumnRenderer, - #superclass : #WebTableColumnRendererBehavior, + #superclass : #AbstractWebTableColumnRenderer, #instVars : [ 'title', 'renderingCommand', diff --git a/source/Willow-Core/WillowApplication.class.st b/source/Willow-Core/WillowApplication.class.st index 1c47ece3..f683c22b 100644 --- a/source/Willow-Core/WillowApplication.class.st +++ b/source/Willow-Core/WillowApplication.class.st @@ -42,6 +42,12 @@ WillowApplication class >> installFileHandlerAccordingTo: theDeploymentMode [ WADeploymentAwareFileHandler installAsFileHandlerAccordingTo: theDeploymentMode ] +{ #category : #testing } +WillowApplication class >> isAbstract [ + + ^ self = WillowApplication +] + { #category : #'private-utility' } WillowApplication class >> registerAsApplicationUsing: deploymentModeClass [