The Trunk: 46Deprecated-mt.2.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: 46Deprecated-mt.2.mcz

commits-2
Marcel Taeumel uploaded a new version of 46Deprecated to project The Trunk:
http://source.squeak.org/trunk/46Deprecated-mt.2.mcz

==================== Summary ====================

Name: 46Deprecated-mt.2
Author: mt
Time: 3 May 2015, 2:43:14.241 pm
UUID: a45140cf-2faa-8642-a1b8-2f81eaea8990
Ancestors: 46Deprecated-mt.1

Added a widget that was once used for showing message category lists.

=============== Diff against 46Deprecated-mt.1 ===============

Item was added:
+ SystemOrganization addCategory: #'46Deprecated-Morphic-Pluggable Widgets'!

Item was added:
+ PluggableListMorph subclass: #PluggableMessageCategoryListMorph
+ instanceVariableNames: 'getRawListSelector priorRawList'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: '46Deprecated-Morphic-Pluggable Widgets'!
+
+ !PluggableMessageCategoryListMorph commentStamp: '<historical>' prior: 0!
+ A variant of PluggableListMorph designed specially for efficient handling of the --all-- feature in message-list panes.  In order to be able *quickly* to check whether there has been an external change to the list, we cache the raw list for identity comparison (the actual list is a combination of the --all-- element and the the actual list).!

Item was added:
+ ----- Method: PluggableMessageCategoryListMorph class>>on:list:selected:changeSelected:menu:keystroke:getRawListSelector: (in category 'as yet unclassified') -----
+ on: anObject list: getListSel selected: getSelectionSel changeSelected: setSelectionSel menu: getMenuSel keystroke: keyActionSel getRawListSelector: getRawSel
+ ^ self new on: anObject list: getListSel selected: getSelectionSel changeSelected: setSelectionSel menu: getMenuSel keystroke: keyActionSel getRawListSelector: getRawSel!

Item was added:
+ ----- Method: PluggableMessageCategoryListMorph>>getList (in category 'model access') -----
+ getList
+ "Differs from the generic in that here we obtain and cache the raw list, then cons it together with the special '-- all --' item to produce the list to be used in the browser.  This special handling is done in order to avoid excessive and unnecessary reformulation of the list in the step method"
+
+ getRawListSelector == nil ifTrue: ["should not happen!!" priorRawList := nil.  ^ #()].
+ model classListIndex = 0 ifTrue: [^ priorRawList := list := Array new].
+ priorRawList := model perform: getRawListSelector.
+ list := (Array with: ClassOrganizer allCategory), priorRawList.
+ ^list!

Item was added:
+ ----- Method: PluggableMessageCategoryListMorph>>on:list:selected:changeSelected:menu:keystroke:getRawListSelector: (in category 'as yet unclassified') -----
+ on: anObject list: getListSel selected: getSelectionSel changeSelected: setSelectionSel menu: getMenuSel keystroke: keyActionSel getRawListSelector: getRawSel
+ self model: anObject.
+ getListSelector := getListSel.
+ getIndexSelector := getSelectionSel.
+ setIndexSelector := setSelectionSel.
+ getMenuSelector := getMenuSel.
+ keystrokeActionSelector := keyActionSel.
+ autoDeselect := true.
+ self borderWidth: 1.
+ getRawListSelector := getRawSel.
+ self updateList.
+ self selectionIndex: self getCurrentSelectionIndex.
+ self initForKeystrokes!

Item was added:
+ ----- Method: PluggableMessageCategoryListMorph>>verifyContents (in category 'updating') -----
+ verifyContents
+ | newList existingSelection anIndex newRawList |
+ (model editSelection == #editComment) ifTrue: [^ self].
+ model classListIndex = 0 ifTrue: [^ self].
+ newRawList := model perform: getRawListSelector.
+ newRawList == priorRawList ifTrue: [^ self].  "The usual case; very fast"
+ priorRawList := newRawList.
+ newList := (Array with: ClassOrganizer allCategory), priorRawList.
+ list = newList ifTrue: [^ self].
+ existingSelection := self selection.
+ self updateList.
+ (anIndex := newList indexOf: existingSelection ifAbsent: [nil])
+ ifNotNil:
+ [model noteSelectionIndex: anIndex for: getListSelector.
+ self selectionIndex: anIndex]
+ ifNil:
+ [self changeModelSelection: 0]!