The Trunk: Tools-mt.584.mcz

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

The Trunk: Tools-mt.584.mcz

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

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

Name: Tools-mt.584
Author: mt
Time: 12 April 2015, 7:13:53.589 pm
UUID: a5f20353-d6c2-f84e-bf86-a470a2e42610
Ancestors: Tools-mt.583

Make file list tool work in MVC again.

=============== Diff against Tools-mt.583 ===============

Item was added:
+ ----- Method: FileList class>>openInMVC (in category 'mvc compatibility') -----
+ openInMVC
+ "Open a view of an instance of me on the default directory."
+
+ | dir aFileList topView volListView templateView fileListView fileContentsView underPane pHeight |
+ dir := FileDirectory default.
+ aFileList := self new directory: dir.
+ topView := StandardSystemView new.
+ topView
+ model: aFileList;
+ label: dir pathName;
+ minimumSize: 200@200.
+ topView borderWidth: 1.
+
+ volListView := PluggableListView on: aFileList
+ list: #volumeList
+ selected: #volumeListIndex
+ changeSelected: #volumeListIndex:
+ menu: #volumeMenu:.
+ volListView autoDeselect: false.
+ volListView window: (0@0 extent: 80@45).
+ topView addSubView: volListView.
+
+ templateView _ PluggableTextView on: aFileList
+ text: #pattern
+ accept: #pattern:.
+ templateView askBeforeDiscardingEdits: false.
+ templateView window: (0@0 extent: 80@15).
+ topView addSubView: templateView below: volListView.
+
+ aFileList wantsOptionalButtons
+ ifTrue:
+ [underPane := aFileList optionalButtonViewForMVC.
+ underPane isNil
+ ifTrue: [pHeight := 60]
+ ifFalse: [
+ topView addSubView: underPane toRightOf: volListView.
+ pHeight := 60 - aFileList optionalButtonHeight]]
+ ifFalse:
+ [underPane := nil.
+ pHeight := 60].
+
+ fileListView := PluggableListView on: aFileList
+ list: #fileList
+ selected: #fileListIndex
+ changeSelected: #fileListIndex:
+ menu: #fileListMenu:.
+ fileListView window: (0@0 extent: 120@pHeight).
+ underPane isNil
+ ifTrue: [topView addSubView: fileListView toRightOf: volListView]
+ ifFalse: [topView addSubView: fileListView below: underPane].
+ fileListView controller terminateDuringSelect: true.  "Pane to left may change under scrollbar"
+
+ fileContentsView := PluggableTextView on: aFileList
+ text: #contents accept: #put:
+ readSelection: #contentsSelection menu: #fileContentsMenu:shifted:.
+ fileContentsView window: (0@0 extent: 200@140).
+ topView addSubView: fileContentsView below: templateView.
+
+ topView controller open!

Item was changed:
  ----- Method: FileList>>entriesMatching: (in category 'private') -----
  entriesMatching: patternString
  "Answer a list of directory entries which match the patternString.
  The patternString may consist of multiple patterns separated by ';'.
  Each pattern can include a '*' or '#' as wildcards - see String>>match:"
 
  | entries patterns |
+ entries := directory entries reject:[:e| Smalltalk isMorphic and: [e isDirectory]].
- entries := directory entries reject:[:e| e isDirectory].
  patterns := patternString findTokens: ';'.
  (patterns anySatisfy: [:each | each = '*'])
  ifTrue: [^ entries].
  ^ entries select: [:entry | patterns anySatisfy: [:each | each match: entry name]]!

Item was added:
+ ----- Method: FileList>>optionalButtonViewForMVC (in category 'mvc compatibility') -----
+ optionalButtonViewForMVC
+ "Answer a view of optional buttons"
+
+ | aView bHeight windowWidth offset previousView aButtonView wid services sel allServices |
+ aView := View new model: self.
+ bHeight := self optionalButtonHeight.
+ windowWidth := 120.
+ aView window: (0 @ 0 extent: windowWidth @ bHeight).
+ offset := 0.
+ allServices := self universalButtonServices.
+ services := allServices copyFrom: 1 to: (allServices size min: 5).
+ previousView := nil.
+ services
+ do: [:service | sel := service selector.
+ aButtonView := sel asString numArgs = 0
+ ifTrue: [PluggableButtonView
+ on: service provider
+ getState: (service extraSelector == #none
+ ifFalse: [service extraSelector])
+ action: sel]
+ ifFalse: [PluggableButtonView
+ on: service provider
+ getState: (service extraSelector == #none
+ ifFalse: [service extraSelector])
+ action: sel
+ getArguments: #fullName
+ from: self].
+ service selector = services last selector
+ ifTrue: [wid := windowWidth - offset]
+ ifFalse: [aButtonView
+ borderWidthLeft: 0
+ right: 1
+ top: 0
+ bottom: 0.
+ wid := windowWidth // services size - 2].
+ aButtonView label: service buttonLabel asParagraph;
+ window: (offset @ 0 extent: wid @ bHeight).
+ offset := offset + wid.
+ service selector = services first selector
+ ifTrue: [aView addSubView: aButtonView]
+ ifFalse: [aView addSubView: aButtonView toRightOf: previousView].
+ previousView := aButtonView].
+ ^ aView!