Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.493.mcz
==================== Summary ====================
Name: System-ul.493
Author: ul
Time: 16 August 2012, 4:07:05.302 pm
UUID: 9b43acfa-a8e6-6442-a8cb-34aa8ca2370a
Ancestors: System-cmm.492
- enh: Clipboard instances send notifications (triggerEvent) to their subscribers when their content changes.
=============== Diff against System-cmm.492 ===============
Item was changed:
Object subclass: #Clipboard
instanceVariableNames: 'contents recent interpreter'
classVariableNames: 'Default'
poolDictionaries: ''
category: 'System-Support'!
+ !Clipboard commentStamp: 'ul 8/16/2012 15:26' prior: 0!
+ The Clipboard class implements a basic buffering scheme for text. The currently selected text is also exported to the OS so that text can be copied from and to other applications. Commonly only a single instance is used (the default clipboard) but applications are free to use other than the default clipboard if necessary.
+
+ If you'd like to be notified of the changes of the clipboard, you can subscribe to it's #contentChanged event. For example:
+
+ | subscriber |
+ subscriber := [ :newClipboardText :updateSource |
+ Transcript show: ('Clipboard was updated by {1}, the new content is: {2}'
+ format: {
+ updateSource.
+ newClipboardText }); cr ].
+ Clipboard default
+ when: #contentChanged
+ send: #value:value:
+ to: subscriber.
+
+ To unsubscribe from the clipboard changes, just evaluate:
+
+ Clipboard default removeActionsWithReceiver: subscriber!
- !Clipboard commentStamp: '<historical>' prior: 0!
- The Clipboard class implements a basic buffering scheme for text. The currently selected text is also exported to the OS so that text can be copied from and to other applications. Commonly only a single instance is used (the default clipboard) but applications are free to use other than the default clipboard if necessary.!
Item was changed:
----- Method: Clipboard>>clipboardText: (in category 'accessing') -----
clipboardText: text
+ self clipboardText: text notifyWith: nil!
- | string |
- string := text asString.
- self noteRecentClipping: text asText.
- contents := text asText.
- string := self interpreter toSystemClipboard: string.
- self primitiveClipboardText: string.
- !
Item was added:
+ ----- Method: Clipboard>>clipboardText:notifyWith: (in category 'accessing') -----
+ clipboardText: text notifyWith: anObject
+ "Set the contents of the clipboard to text. anObject can be used as a marker for the source of the clipboard change, the default value is nil."
+
+ | string |
+ string := text asString.
+ self noteRecentClipping: text asText.
+ contents := text asText.
+ string := self interpreter toSystemClipboard: string.
+ self primitiveClipboardText: string.
+ self triggerEvent: #contentChanged withArguments: { text. anObject }!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.493.mcz
==================== Summary ====================
Name: System-ul.493
Author: ul
Time: 16 August 2012, 4:07:05.302 pm
UUID: 9b43acfa-a8e6-6442-a8cb-34aa8ca2370a
Ancestors: System-cmm.492
- enh: Clipboard instances send notifications (triggerEvent) to their subscribers when their content changes.
=============== Diff against System-cmm.492 ===============
Item was changed:
Object subclass: #Clipboard
instanceVariableNames: 'contents recent interpreter'
classVariableNames: 'Default'
poolDictionaries: ''
category: 'System-Support'!
+ !Clipboard commentStamp: 'ul 8/16/2012 15:26' prior: 0!
+ The Clipboard class implements a basic buffering scheme for text. The currently selected text is also exported to the OS so that text can be copied from and to other applications. Commonly only a single instance is used (the default clipboard) but applications are free to use other than the default clipboard if necessary.
+
+ If you'd like to be notified of the changes of the clipboard, you can subscribe to it's #contentChanged event. For example:
+
+ | subscriber |
+ subscriber := [ :newClipboardText :updateSource |
+ Transcript show: ('Clipboard was updated by {1}, the new content is: {2}'
+ format: {
+ updateSource.
+ newClipboardText }); cr ].
+ Clipboard default
+ when: #contentChanged
+ send: #value:value:
+ to: subscriber.
+
+ To unsubscribe from the clipboard changes, just evaluate:
+
+ Clipboard default removeActionsWithReceiver: subscriber!
- !Clipboard commentStamp: '<historical>' prior: 0!
- The Clipboard class implements a basic buffering scheme for text. The currently selected text is also exported to the OS so that text can be copied from and to other applications. Commonly only a single instance is used (the default clipboard) but applications are free to use other than the default clipboard if necessary.!
Item was changed:
----- Method: Clipboard>>clipboardText: (in category 'accessing') -----
clipboardText: text
+ self clipboardText: text notifyWith: nil!
- | string |
- string := text asString.
- self noteRecentClipping: text asText.
- contents := text asText.
- string := self interpreter toSystemClipboard: string.
- self primitiveClipboardText: string.
- !
Item was added:
+ ----- Method: Clipboard>>clipboardText:notifyWith: (in category 'accessing') -----
+ clipboardText: text notifyWith: anObject
+ "Set the contents of the clipboard to text. anObject can be used as a marker for the source of the clipboard change, the default value is nil."
+
+ | string |
+ string := text asString.
+ self noteRecentClipping: text asText.
+ contents := text asText.
+ string := self interpreter toSystemClipboard: string.
+ self primitiveClipboardText: string.
+ self triggerEvent: #contentChanged withArguments: { text. anObject }!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.493.mcz
==================== Summary ====================
Name: System-ul.493
Author: ul
Time: 16 August 2012, 4:07:05.302 pm
UUID: 9b43acfa-a8e6-6442-a8cb-34aa8ca2370a
Ancestors: System-cmm.492
- enh: Clipboard instances send notifications (triggerEvent) to their subscribers when their content changes.
=============== Diff against System-cmm.492 ===============
Item was changed:
Object subclass: #Clipboard
instanceVariableNames: 'contents recent interpreter'
classVariableNames: 'Default'
poolDictionaries: ''
category: 'System-Support'!
+ !Clipboard commentStamp: 'ul 8/16/2012 15:26' prior: 0!
+ The Clipboard class implements a basic buffering scheme for text. The currently selected text is also exported to the OS so that text can be copied from and to other applications. Commonly only a single instance is used (the default clipboard) but applications are free to use other than the default clipboard if necessary.
+
+ If you'd like to be notified of the changes of the clipboard, you can subscribe to it's #contentChanged event. For example:
+
+ | subscriber |
+ subscriber := [ :newClipboardText :updateSource |
+ Transcript show: ('Clipboard was updated by {1}, the new content is: {2}'
+ format: {
+ updateSource.
+ newClipboardText }); cr ].
+ Clipboard default
+ when: #contentChanged
+ send: #value:value:
+ to: subscriber.
+
+ To unsubscribe from the clipboard changes, just evaluate:
+
+ Clipboard default removeActionsWithReceiver: subscriber!
- !Clipboard commentStamp: '<historical>' prior: 0!
- The Clipboard class implements a basic buffering scheme for text. The currently selected text is also exported to the OS so that text can be copied from and to other applications. Commonly only a single instance is used (the default clipboard) but applications are free to use other than the default clipboard if necessary.!
Item was changed:
----- Method: Clipboard>>clipboardText: (in category 'accessing') -----
clipboardText: text
+ self clipboardText: text notifyWith: nil!
- | string |
- string := text asString.
- self noteRecentClipping: text asText.
- contents := text asText.
- string := self interpreter toSystemClipboard: string.
- self primitiveClipboardText: string.
- !
Item was added:
+ ----- Method: Clipboard>>clipboardText:notifyWith: (in category 'accessing') -----
+ clipboardText: text notifyWith: anObject
+ "Set the contents of the clipboard to text. anObject can be used as a marker for the source of the clipboard change, the default value is nil."
+
+ | string |
+ string := text asString.
+ self noteRecentClipping: text asText.
+ contents := text asText.
+ string := self interpreter toSystemClipboard: string.
+ self primitiveClipboardText: string.
+ self triggerEvent: #contentChanged withArguments: { text. anObject }!
Colin Putney uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-cwp.160.mcz
==================== Summary ====================
Name: Tests-cwp.160
Author: cwp
Time: 17 August 2012, 2:02:48.348 pm
UUID: 7f94a1f9-3176-43aa-aef1-05ce3b437125
Ancestors: Tests-cwp.159, Tests-eem.158
merge Tests-eem.158:
Add a test that tests outer in the contex of an enclosing
handler, unlike testResumableOuter which tests
outer in the absence of an enclosing handler.
=============== Diff against Tests-cwp.159 ===============
Item was added:
+ ----- Method: ExceptionTests>>testOuter (in category 'testing-outer') -----
+ testOuter
+ | result |
+ result := [[Notification signal. #signal]
+ on: Notification
+ do: [:ex| ex outer. #inner]]
+ on: Notification
+ do: [:ex| #outer].
+ self assert: result = #outer!
Colin Putney uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-cwp.160.mcz
==================== Summary ====================
Name: Tests-cwp.160
Author: cwp
Time: 17 August 2012, 2:02:48.348 pm
UUID: 7f94a1f9-3176-43aa-aef1-05ce3b437125
Ancestors: Tests-cwp.159, Tests-eem.158
merge Tests-eem.158:
Add a test that tests outer in the contex of an enclosing
handler, unlike testResumableOuter which tests
outer in the absence of an enclosing handler.
=============== Diff against Tests-cwp.159 ===============
Item was added:
+ ----- Method: ExceptionTests>>testOuter (in category 'testing-outer') -----
+ testOuter
+ | result |
+ result := [[Notification signal. #signal]
+ on: Notification
+ do: [:ex| ex outer. #inner]]
+ on: Notification
+ do: [:ex| #outer].
+ self assert: result = #outer!
Colin Putney uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-cwp.160.mcz
==================== Summary ====================
Name: Tests-cwp.160
Author: cwp
Time: 17 August 2012, 2:02:48.348 pm
UUID: 7f94a1f9-3176-43aa-aef1-05ce3b437125
Ancestors: Tests-cwp.159, Tests-eem.158
merge Tests-eem.158:
Add a test that tests outer in the contex of an enclosing
handler, unlike testResumableOuter which tests
outer in the absence of an enclosing handler.
=============== Diff against Tests-cwp.159 ===============
Item was added:
+ ----- Method: ExceptionTests>>testOuter (in category 'testing-outer') -----
+ testOuter
+ | result |
+ result := [[Notification signal. #signal]
+ on: Notification
+ do: [:ex| ex outer. #inner]]
+ on: Notification
+ do: [:ex| #outer].
+ self assert: result = #outer!