Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1050.mcz ==================== Summary ==================== Name: Tools-mt.1050 Author: mt Time: 30 April 2021, 9:19:14.010936 am UUID: c1a1da37-9117-f548-b3a3-f910d6ae2c4c Ancestors: Tools-mt.1049 Refactors buildWith: in ChangeSorter to match the implementation in other tools (such as MessageSet and Browser). Complements Kernel-mt.1396 =============== Diff against Tools-mt.1049 =============== Item was added: + ----- Method: ChangeSorter>>buildChangeSetListWith: (in category 'toolbuilder') ----- + buildChangeSetListWith: builder + + | listSpec | + listSpec := builder pluggableListSpec new. + listSpec + model: self; + list: #changeSetList; + getSelected: #currentCngSet; + setSelected: #showChangeSetNamed:; + menu: #changeSetMenu:shifted:; + keyPress: #changeSetListKey:from:; + dragItem: #dragChangeSet:; + autoDeselect: false. + ^ listSpec! Item was added: + ----- Method: ChangeSorter>>buildClassListWith: (in category 'toolbuilder') ----- + buildClassListWith: builder + + | listSpec | + listSpec := builder pluggableListSpec new. + listSpec + model: self; + list: #classList; + getSelected: #currentClassName; + setSelected: #currentClassName:; + menu: #classListMenu:shifted:; + keyPress: #classListKey:from:; + dragItem: #dragClass:. + ^ listSpec! Item was added: + ----- Method: ChangeSorter>>buildCodePaneWith: (in category 'toolbuilder') ----- + buildCodePaneWith: builder + + | textSpec | + textSpec := builder pluggableCodePaneSpec new. + textSpec + model: self; + getText: #contents; + setText: #contents:notifying:; + selection: #contentsSelection; + menu: #codePaneMenu:shifted:. + ^ textSpec! Item was added: + ----- Method: ChangeSorter>>buildMessageListWith: (in category 'toolbuilder') ----- + buildMessageListWith: builder + + | listSpec | + listSpec := builder pluggableListSpec new. + listSpec + model: self; + list: #messageList; + getSelected: #currentSelector; + setSelected: #currentSelector:; + menu: #messageMenu:shifted:; + keyPress: #messageListKey:from:; + dragItem: #dragMessage:. + ^ listSpec! Item was changed: ----- Method: ChangeSorter>>buildWith: (in category 'toolbuilder') ----- buildWith: builder + + ^ builder build: + (self + buildWith: builder + in: (self buildWindowWith: builder) + rect: (0@0 extent: 1@1))! - " - ToolBuilder open: ChangeSorter. - " - | windowSpec | - windowSpec := builder pluggableWindowSpec new. - windowSpec label: 'Change Sorter'. - windowSpec model: self. - windowSpec children: OrderedCollection new. - windowSpec label: #labelString. - self buildWith: builder in: windowSpec rect: (0@0 extent: 1@1). - ^builder build: windowSpec! Item was changed: ----- Method: ChangeSorter>>buildWith:in:rect: (in category 'toolbuilder') ----- buildWith: builder in: window rect: rect - | csListHeight msgListHeight csMsgListHeight listSpec textSpec | - contents := ''. - csListHeight := 0.25. - msgListHeight := 0.25. - csMsgListHeight := csListHeight + msgListHeight. + | windowSpec offset factor | + offset := rect origin. + factor := rect extent. + windowSpec := self buildWindow: window with: builder specs: (({ + (0.0@0.0 corner: 0.5@0.25) -> [self buildChangeSetListWith: builder]. + (0.5@0.0 corner: 1.0@0.25) -> [self buildClassListWith: builder]. + (0.0@0.25 corner: 1.0@0.5) -> [self buildMessageListWith: builder]. + (0.0@0.5 corner: 1.0@1.0) -> [self buildCodePaneWith: builder] }) + collect: [:spec | ((spec key scaleBy: factor) translateBy: offset) -> spec value]). + ^ builder build: windowSpec! - listSpec := builder pluggableListSpec new. - listSpec - model: self; - list: #changeSetList; - getSelected: #currentCngSet; - setSelected: #showChangeSetNamed:; - menu: #changeSetMenu:shifted:; - keyPress: #changeSetListKey:from:; - dragItem: #dragChangeSet:; - autoDeselect: false; - frame: (((0@0 extent: 0.5@csListHeight) - scaleBy: rect extent) translateBy: rect origin). - window children add: listSpec. - - listSpec := builder pluggableListSpec new. - listSpec - model: self; - list: #classList; - getSelected: #currentClassName; - setSelected: #currentClassName:; - menu: #classListMenu:shifted:; - keyPress: #classListKey:from:; - dragItem: #dragClass:; - frame: (((0.5@0 extent: 0.5@csListHeight) - scaleBy: rect extent) translateBy: rect origin). - window children add: listSpec. - - listSpec := builder pluggableListSpec new. - listSpec - model: self; - list: #messageList; - getSelected: #currentSelector; - setSelected: #currentSelector:; - menu: #messageMenu:shifted:; - keyPress: #messageListKey:from:; - dragItem: #dragMessage:; - frame: (((0@csListHeight extent: 1@msgListHeight) - scaleBy: rect extent) translateBy: rect origin). - window children add: listSpec. - - textSpec := builder pluggableCodePaneSpec new. - textSpec - model: self; - getText: #contents; - setText: #contents:notifying:; - selection: #contentsSelection; - menu: #codePaneMenu:shifted:; - frame: (((0@csMsgListHeight corner: 1@1) scaleBy: rect extent) translateBy: rect origin). - window children add: textSpec. - ^window! Item was changed: ----- Method: DualChangeSorter>>buildWith: (in category 'toolbuilder') ----- buildWith: builder | windowSpec window | leftCngSorter := ChangeSorter new myChangeSet: ChangeSet current. leftCngSorter parent: self. rightCngSorter := ChangeSorter new myChangeSet: ChangeSet secondaryChangeSet. rightCngSorter parent: self. + windowSpec := self buildWindowWith: builder. - windowSpec := builder pluggableWindowSpec new. - windowSpec model: self. - windowSpec label: 'Change Sorter'. - windowSpec children: OrderedCollection new. - windowSpec label: #labelString. leftCngSorter buildWith: builder in: windowSpec rect: (0@0 extent: 0.5@1). rightCngSorter buildWith: builder in: windowSpec rect: (0.5@0 extent: 0.5@1). window := builder build: windowSpec. leftCngSorter addDependent: window. "so it will get changed: #relabel" rightCngSorter addDependent: window. "so it will get changed: #relabel" ^window! |
Free forum by Nabble | Edit this page |