-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove almost all methods from BlTextAnnouncer (except #postCopy) (as…
… a fix for #670) Introduce BlElement>>focusHolder to allow an element to specify the element that should be focused when a focus is requested.
- Loading branch information
Showing
2 changed files
with
8 additions
and
58 deletions.
There are no files selected for viewing
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,68 +1,11 @@ | ||
Class { | ||
#name : #BlTextAnnouncer, | ||
#superclass : #Announcer, | ||
#instVars : [ | ||
'suspendAll', | ||
'suspendedAnnouncemets' | ||
], | ||
#category : #'Bloc-Text-Text' | ||
} | ||
|
||
{ #category : #announce } | ||
BlTextAnnouncer >> announce: anAnnouncement [ | ||
(self isAnnouncementSuspended: anAnnouncement) ifTrue: [ ^ anAnnouncement asAnnouncement ]. | ||
^ super announce: anAnnouncement | ||
] | ||
|
||
{ #category : #accessing } | ||
BlTextAnnouncer >> announcer [ | ||
^ self | ||
] | ||
|
||
{ #category : #testing } | ||
BlTextAnnouncer >> isAnnouncementSuspended: anAnnouncement [ | ||
^ self suspendAll or: [ |announcementType| | ||
announcementType := anAnnouncement isClass | ||
ifTrue: [ anAnnouncement ] ifFalse: [ anAnnouncement class ]. | ||
self suspendedAnnouncemets anySatisfy: [ :anAnnouncementType | | ||
"Suspend the announcement if it has the same class or if it inherits from a suspended announcement class." | ||
announcementType = anAnnouncementType or: [ announcementType inheritsFrom: anAnnouncementType ] ] ] | ||
] | ||
|
||
{ #category : #copying } | ||
BlTextAnnouncer >> postCopy [ | ||
super postCopy. | ||
registry := registry copy. | ||
] | ||
|
||
{ #category : #accessing } | ||
BlTextAnnouncer >> resetAnnouncer [ | ||
registry reset | ||
] | ||
|
||
{ #category : #suspending } | ||
BlTextAnnouncer >> suspendAll [ | ||
^ suspendAll ifNil: [ suspendAll := false ]. | ||
] | ||
|
||
{ #category : #suspending } | ||
BlTextAnnouncer >> suspendAll: aCollection while: aBlock [ | ||
| previousSuspendedAnnouncemets | | ||
previousSuspendedAnnouncemets := suspendedAnnouncemets. | ||
suspendedAnnouncemets := aCollection copy. | ||
aBlock ensure: [suspendedAnnouncemets := previousSuspendedAnnouncemets] | ||
] | ||
|
||
{ #category : #suspending } | ||
BlTextAnnouncer >> suspendAllWhile: aBlock [ | ||
| previousSuspensionState | | ||
previousSuspensionState := suspendAll. | ||
suspendAll := true. | ||
aBlock ensure: [suspendAll := previousSuspensionState] | ||
|
||
] | ||
|
||
{ #category : #accessing } | ||
BlTextAnnouncer >> suspendedAnnouncemets [ | ||
^ suspendedAnnouncemets ifNil: [ suspendedAnnouncemets := OrderedCollection new ]. | ||
] |
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