[squeak-dev] The Inbox: Tools-fbs.220.mcz
Frank Shearar
frank.shearar at angband.za.org
Sun Apr 4 18:00:03 UTC 2010
As a follow-on, I don't think #alternativeBrowseIt has anything to do
with this particular commit.
#alternativeBrowseIt allows you to, within ParagraphEditors and
TextEditors, browse a Class, right?
This commit just makes the browse button in a MessageNames work in (what
I think is) an intuitive manner.
(I should add that Tools-fbs.220.mcz has a bug that's fixed in
Tools-fbs.221.mcz in the Inbox: selectorListIndex can be nil, when the
left-hand pane's empty.)
frank
Frank Shearar wrote:
> I'll look at #alternativeBrowseIt - I didn't know there was such a thing :)
>
> I've attached a screenshot of what I mean, at any rate. Assuming we're
> talking about the same thing, the left-hand pane one might call a
> selector list (accessed through instvars called selectorListIndex,
> selectorList) and the right-hand pane one might call a message list
> (accessed through instvars like messageList and messageListIndex).
>
> The left-hand pane actually contains both selector names and class names.
>
> When you choose a selector in the left-hand pane (say
> writeClassRename:was) the right-hand pane fills up with the implementors
> of that selector. Hit "browse" and you go where you'd expect.
>
> If you choose a class in the left-hand pane (say XMLWarningException)
> the right-hand pane is empty, obviously.
>
> Now if you hit "browse" at this point, nothing happens. That surprised
> me: I'd expected a Browser to open up displaying XMLWarningException.
>
> So I dug around, and changed the behaviour of #selection and
> #selectedClassOrMetaClass to say "well, if there's no method selected in
> the right-hand pane, look in the left-hand pane. If something there's
> selected, open a Browser on it, otherwise do nothing."
>
> "No method selected" can only happen when you've selected a class in the
> left-hand pane: otherwise, the first item in the right-hand pane's
> selected.
>
> frank
>
> Chris Muller wrote:
>> I don't understand, MessageNames don't have a "left-hand pane" do
>> they? Only a top and bottom....
>>
>> On Wed, Mar 31, 2010 at 2:42 PM, <commits at source.squeak.org> wrote:
>>> A new version of Tools was added to project The Inbox:
>>> http://source.squeak.org/inbox/Tools-fbs.220.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: Tools-fbs.220
>>> Author: fbs
>>> Time: 31 March 2010, 10:42:28.8 pm
>>> UUID: 0eca72cb-a1d4-4849-9da6-15d4b31ab9a4
>>> Ancestors: Tools-fbs.219, Tools-nice.219
>>>
>>> Allows the Browse button to work on class names that appear in the
>>> left-hand pane of a MessageNames browser.
>>>
>>> =============== Diff against Tools-nice.219 ===============
>>>
>>> Item was changed:
>>> ----- Method: MessageNames>>selection (in category 'selection') -----
>>> selection
>>> "Answer the item in the list that is currently selected, or
>>> nil if no selection is present"
>>>
>>> + ^ messageListIndex = 0
>>> + ifTrue: [self selectorList at: selectorListIndex
>>> ifAbsent: [nil]]
>>> + ifFalse: [self messageList at: messageListIndex
>>> ifAbsent: [nil]].!
>>> - ^ self messageList at: messageListIndex ifAbsent: [nil]!
>>>
>>> Item was added:
>>> + ----- Method: MessageNames>>selectedClassOrMetaClass (in category
>>> 'class list') -----
>>> + selectedClassOrMetaClass
>>> + "Answer the currently selected class (or metaclass)."
>>> + messageListIndex > 0 ifTrue: [
>>> + ^ self setClassAndSelectorIn: [:c :s | ^c]].
>>> + selectorListIndex > 0 ifTrue: [^Smalltalk classNamed: (self
>>> selectorList at: selectorListIndex)].
>>> +
>>> + ^ nil.
>>> + !
>>>
>>>
>>>
>>
>>
>>
>
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
>
More information about the Squeak-dev
mailing list
|