Introducing new dependencies on Sensor is bad practice. We should stick to the event mechanism.
I'm not sure what you're trying to do, but did you know we already have AlternatePluggableListMorphOfMany which implements extending selection via Shift key..?
On Thu, Jul 31, 2014 at 12:46 AM, commits@source.squeak.org wrote:
Eliot Miranda uploaded a new version of Tools to project The Trunk: http://source.squeak.org/trunk/Tools-eem.526.mcz
==================== Summary ====================
Name: Tools-eem.526 Author: eem Time: 30 July 2014, 7:46:31.551 pm UUID: 458dab1f-dc91-4197-88d2-076aa9c7317b Ancestors: Tools-eem.525
Allow extending selection via shift in ChangeList>>selectMethodsForThisClass. Allow a class to specify its own integer base preference in the inspector and debugger.
=============== Diff against Tools-eem.525 ===============
Item was changed: ----- Method: ChangeList>>selectMethodsForThisClass (in category 'menu actions') ----- selectMethodsForThisClass
| name | self currentChange ifNil: [ ^self ].
self currentChange methodClassName ifNotNil:
[:name|
self selectSuchThat:
(Sensor leftShiftDown
ifTrue: [[:change :index| (listSelections
at: index) or: [change methodClassName = name]]]
ifFalse: [[:change| change methodClassName
= name]])]!
name := self currentChange methodClassName.
name ifNil: [ ^self ].
^self selectSuchThat: [ :change |
change methodClassName = name ].!
Item was changed:
----- Method: ChangeList>>selectSuchThat: (in category 'menu actions')
selectSuchThat: aBlock "select all changes for which block returns true"
listSelections := aBlock numArgs = 2
ifTrue: [changeList
withIndexCollect: aBlock]
ifFalse: [changeList
collect: aBlock].
listSelections := changeList collect: aBlock. self changed: #allSelections!
Item was added:
- ----- Method: ContextVariablesInspector>>defaultIntegerBase (in category
'selecting') -----
- defaultIntegerBase
"Answer the default base in which to print integers.
Defer to the class the code is compiled in."
^[object method methodClass defaultIntegerBaseInDebugger]
on: MessageNotUnderstood
do: [:ex| 10]!
Item was added:
- ----- Method: Inspector>>defaultIntegerBase (in category 'selecting')
- defaultIntegerBase
"Answer the default base in which to print integers.
Defer to the class of the instance."
^[object class defaultIntegerBaseInDebugger]
on: MessageNotUnderstood
do: [:ex| 10]!
Item was changed:
----- Method: Inspector>>selectionPrintString (in category 'selecting')
selectionPrintString | text |
selectionUpdateTime := [text := [self selection isInteger
ifTrue: [self selection storeStringBase: self defaultIntegerBase]
ifFalse: [self selection printStringLimitedTo: 5000]]
selectionUpdateTime := [text := [(self selection
printStringLimitedTo: 5000) asText] on: Error do: [text := self printStringErrorText. text
addAttribute: TextColor red from: 1 to: text size. text]] timeToRun. ^ text!