-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/stlutz/Squeak-ActiveExpre…
- Loading branch information
Showing
21 changed files
with
85 additions
and
15 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
src/ActiveExpressions-Core.package/ActiveExpression.class/instance/disable.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
change detection | ||
disable | ||
|
||
self uninstallMonitors. | ||
self disableAllCallbacks |
5 changes: 5 additions & 0 deletions
5
src/ActiveExpressions-Core.package/ActiveExpression.class/instance/enable.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
change detection | ||
enable | ||
|
||
self updateMonitors. | ||
self enableAllCallbacks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/ActiveExpressions-Core.package/ActiveExpression.class/instance/installMonitors.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
change detection | ||
installMonitors | ||
|
||
| instVarsToMonitor | | ||
instVarsToMonitor := self instVarsToMonitor. | ||
self monitorInstVars: instVarsToMonitor. | ||
self monitoredInstVars: instVarsToMonitor. |
8 changes: 8 additions & 0 deletions
8
src/ActiveExpressions-Core.package/ActiveExpression.class/instance/monitorInstVars..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
change detection | ||
monitorInstVars: objectInstVarsDict | ||
|
||
objectInstVarsDict keysAndValuesDo: [:object :instVars | | ||
instVars do: [:instVar | object | ||
onChangeOfInstVarNamed: instVar | ||
notify: self | ||
using: #variable:of:changedTo:]] |
4 changes: 4 additions & 0 deletions
4
src/ActiveExpressions-Core.package/ActiveExpression.class/instance/monitoredInstVars..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
monitoredInstVars: anObject | ||
|
||
monitoredInstVars := anObject |
4 changes: 4 additions & 0 deletions
4
src/ActiveExpressions-Core.package/ActiveExpression.class/instance/monitoredInstVars.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
monitoredInstVars | ||
|
||
^ monitoredInstVars ifNil: [monitoredInstVars := Dictionary new] |
5 changes: 5 additions & 0 deletions
5
src/ActiveExpressions-Core.package/ActiveExpression.class/instance/uninstallMonitors.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
change detection | ||
uninstallMonitors | ||
|
||
self unmonitorInstVars: self monitoredInstVars. | ||
self monitoredInstVars: nil |
6 changes: 6 additions & 0 deletions
6
src/ActiveExpressions-Core.package/ActiveExpression.class/instance/unmonitorInstVars..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
change detection | ||
unmonitorInstVars: objectInstVarsDict | ||
|
||
objectInstVarsDict keysAndValuesDo: [:object :instVars | | ||
instVars do: [:instVar | | ||
object unsubscribe: self fromAssignmentNotificationsFor: instVar]] |
5 changes: 5 additions & 0 deletions
5
src/ActiveExpressions-Core.package/ActiveExpression.class/instance/updateMonitors.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
change detection | ||
updateMonitors | ||
|
||
self uninstallMonitors. | ||
self installMonitors |
5 changes: 5 additions & 0 deletions
5
src/ActiveExpressions-Core.package/ActiveExpression.class/instance/variable.of.changedTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
change detection | ||
variable: variableName of: aMonitoredObject changedTo: newValue | ||
|
||
self updateMonitors. | ||
self update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
...iveExpressions-Tests.package/ActiveExpressionChangeDetectionTests.class/instance/setUp.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
running | ||
setUp | ||
|
||
publisher := AExpMockPublisher new. | ||
publisher := AExpMockPublisher new. | ||
lastValue := 100. | ||
value := self newValue. | ||
callbackCount := 0. | ||
callback := [callbackCount := callbackCount + 1] |
7 changes: 7 additions & 0 deletions
7
...age/ActiveExpressionChangeDetectionTests.class/instance/testAutomaticChangePropagation.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
tests | ||
testAutomaticChangePropagation | ||
|
||
activeExpression := ActiveExpression monitoring: [publisher variableOfInterest]. | ||
activeExpression onChangeDo: callback. | ||
publisher variableOfInterest: self newValue. | ||
self assert: 1 equals: callbackCount |
2 changes: 1 addition & 1 deletion
2
...onChangeDetectionTests.class/instance/testInstVarsInMethodsWithKeywordMessagesAreFound.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tests | ||
tests - simulation | ||
testInstVarsInMethodsWithKeywordMessagesAreFound | ||
|
||
| foundVars | | ||
|
2 changes: 1 addition & 1 deletion
2
...ActiveExpressionChangeDetectionTests.class/instance/testInstVarsInQuickMethodsAreFound.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tests | ||
tests - simulation | ||
testInstVarsInQuickMethodsAreFound | ||
|
||
| foundVars | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/ActiveExpressions-Tests.package/ActiveExpressionTests.class/instance/tearDown.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
running | ||
tearDown | ||
|
||
activeExpression disable | ||
activeExpression ifNotNil: [activeExpression disable]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters