Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several renames to improve naming consistency #206

Draft
wants to merge 1 commit into
base: release-candidate
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions source/Willow-Core-Tests/EventInterpreterDispatcherTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,7 +30,7 @@ EventInterpreterDispatcherTest >> testChange [

| dispatcher html |

dispatcher := EventInterpreterDispatcher defaultingToClick.
dispatcher := SingleEventInterpreterDispatcher defaultingToClick.
dispatcher change inform: 'A message'.
html := self configureTextInputWith: dispatcher.
self
Expand All @@ -44,7 +44,7 @@ EventInterpreterDispatcherTest >> testClick [

| dispatcher html |

dispatcher := EventInterpreterDispatcher defaultingToChange.
dispatcher := SingleEventInterpreterDispatcher defaultingToChange.
dispatcher click inform: 'A message'.
html := self configureTextInputWith: dispatcher.
self
Expand All @@ -58,7 +58,7 @@ EventInterpreterDispatcherTest >> testDefaultingToChange [

| dispatcher html |

dispatcher := EventInterpreterDispatcher defaultingToChange.
dispatcher := SingleEventInterpreterDispatcher defaultingToChange.
dispatcher trigger inform: 'A message'.
html := self configureTextInputWith: dispatcher.
self
Expand All @@ -72,7 +72,7 @@ EventInterpreterDispatcherTest >> testDefaultingToChangeHidden [

| dispatcher html |

dispatcher := EventInterpreterDispatcher defaultingToChangeHidden.
dispatcher := SingleEventInterpreterDispatcher defaultingToChangeHidden.
dispatcher trigger inform: 'A message'.
html := self configureTextInputWith: dispatcher.
self
Expand All @@ -86,7 +86,7 @@ EventInterpreterDispatcherTest >> testDefaultingToClick [

| dispatcher html |

dispatcher := EventInterpreterDispatcher defaultingToClick.
dispatcher := SingleEventInterpreterDispatcher defaultingToClick.
dispatcher trigger inform: 'A message'.
html := self configureTextInputWith: dispatcher.
self
Expand All @@ -100,7 +100,7 @@ EventInterpreterDispatcherTest >> testDefaultingToClickHidden [

| dispatcher html |

dispatcher := EventInterpreterDispatcher defaultingToClickHidden.
dispatcher := SingleEventInterpreterDispatcher defaultingToClickHidden.
dispatcher trigger inform: 'A message'.
html := self configureTextInputWith: dispatcher.
self
Expand All @@ -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
Expand All @@ -128,7 +128,7 @@ EventInterpreterDispatcherTest >> testKeyUp [

| dispatcher html |

dispatcher := EventInterpreterDispatcher defaultingToChange.
dispatcher := SingleEventInterpreterDispatcher defaultingToChange.
dispatcher keyUp inform: 'A message'.
html := self configureTextInputWith: dispatcher.
self
Expand All @@ -142,7 +142,7 @@ EventInterpreterDispatcherTest >> testMouseOver [

| dispatcher html |

dispatcher := EventInterpreterDispatcher defaultingToChange.
dispatcher := SingleEventInterpreterDispatcher defaultingToChange.
dispatcher mouseOver inform: 'A message'.
html := self configureTextInputWith: dispatcher.
self
Expand All @@ -156,7 +156,7 @@ EventInterpreterDispatcherTest >> testTrigger [

| dispatcher html |

dispatcher := EventInterpreterDispatcher defaultingToChange.
dispatcher := SingleEventInterpreterDispatcher defaultingToChange.
dispatcher trigger inform: 'A message'.
html := self configureTextInputWith: dispatcher.
self
Expand Down
2 changes: 1 addition & 1 deletion source/Willow-Core-Tests/RadioGroupWebViewTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 |

Expand All @@ -45,7 +45,7 @@ SingleSelectionWebViewBehaviorTest >> testAllowsAnySatisfying [
]

{ #category : #'tests-Single Selection-API' }
SingleSelectionWebViewBehaviorTest >> testChooseAny [
SingleSelectionWebViewTest >> testChooseAny [

| singleSelectionView allowedElements |

Expand All @@ -65,7 +65,7 @@ SingleSelectionWebViewBehaviorTest >> testChooseAny [
]

{ #category : #'tests-Single Selection-API' }
SingleSelectionWebViewBehaviorTest >> testChooseEqualTo [
SingleSelectionWebViewTest >> testChooseEqualTo [

| singleSelectionView allowedElements |

Expand All @@ -89,7 +89,7 @@ SingleSelectionWebViewBehaviorTest >> testChooseEqualTo [
]

{ #category : #'tests-Single Selection-API' }
SingleSelectionWebViewBehaviorTest >> testNotifyChangesTo [
SingleSelectionWebViewTest >> testNotifyChangesTo [

| singleSelectionView |

Expand All @@ -103,7 +103,7 @@ SingleSelectionWebViewBehaviorTest >> testNotifyChangesTo [
]

{ #category : #'tests-Single Selection-API' }
SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenAvailableElementsChangeButContainsTheSelectedOne [
SingleSelectionWebViewTest >> testNotifyChangesWhenAvailableElementsChangeButContainsTheSelectedOne [

| singleSelectionView |

Expand All @@ -124,7 +124,7 @@ SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenAvailableElementsChan
]

{ #category : #'tests-Single Selection-API' }
SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenAvailableElementsChangeButDoesNotContainTheSelectedOne [
SingleSelectionWebViewTest >> testNotifyChangesWhenAvailableElementsChangeButDoesNotContainTheSelectedOne [

| singleSelectionView |

Expand All @@ -146,7 +146,7 @@ SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenAvailableElementsChan
]

{ #category : #'tests-Single Selection-API' }
SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenSelectionChanged [
SingleSelectionWebViewTest >> testNotifyChangesWhenSelectionChanged [

| singleSelectionView |

Expand All @@ -163,7 +163,7 @@ SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenSelectionChanged [
]

{ #category : #'tests-Single Selection-API' }
SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenSelectionDoesNotChange [
SingleSelectionWebViewTest >> testNotifyChangesWhenSelectionDoesNotChange [

| singleSelectionView |

Expand All @@ -181,7 +181,7 @@ SingleSelectionWebViewBehaviorTest >> testNotifyChangesWhenSelectionDoesNotChang
]

{ #category : #'tests-Single Selection-API' }
SingleSelectionWebViewBehaviorTest >> testWithCurrentSelectionDo [
SingleSelectionWebViewTest >> testWithCurrentSelectionDo [

| singleSelectionView allowedElements |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
I'm an abstract class representing single selection web views
"
Class {
#name : #SingleSelectionWebViewBehavior,
#name : #AbstractSingleSelectionWebView,
#superclass : #WAPainter,
#instVars : [
'availableElements',
Expand All @@ -12,107 +12,113 @@ 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."
self chooseAnySatisfying: [ :element | chosenElementOptional withContentDo: [ :chosenElement | chosenElement = element ] ifUnused: [ false ] ] ifNone: [ self invalidateSelection ]
]

{ #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 ]
ifNone: [ SelectionIsInvalid signal: ('There''s no available object equal to <1p>' expandMacrosWith: 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.
self disallowAll
]

{ #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: [ ]
]
Loading