The Trunk: Tools-ul.146.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-ul.146.mcz

commits-2
Levente Uzonyi uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-ul.146.mcz

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

Name: Tools-ul.146
Author: ul
Time: 12 December 2009, 2:53:26 am
UUID: bb338904-70df-e346-92cf-8e431ed56474
Ancestors: Tools-dtl.145

- replace sends of #ifNotNilDo: to #ifNotNil:, #ifNil:ifNotNilDo: to #ifNil:ifNotNil:, #ifNotNilDo:ifNil: to #ifNotNil:ifNil:

=============== Diff against Tools-dtl.145 ===============

Item was changed:
  ----- Method: Debugger>>tally (in category 'tally support') -----
  tally
 
+ self getTextMorphWithSelection ifNotNil: [:o| o tallyIt] ifNil: [Beeper beep]
- self getTextMorphWithSelection ifNotNilDo: [:o| o tallyIt] ifNil: [Beeper beep]
  !

Item was changed:
  ----- Method: ObjectExplorer>>selector (in category 'accessing') -----
  selector
+ ^currentSelection ifNotNil: [ :cs | cs selector ]!
- ^currentSelection ifNotNilDo: [ :cs | cs selector ]!

Item was changed:
  ----- Method: ArchiveViewer>>readOnlyStream (in category 'accessing') -----
  readOnlyStream
  "Answer a read-only stream on the selected member.
  For the various stream-reading services."
 
+ ^self selectedMember ifNotNil: [ :mem | mem contentStream ascii ]!
- ^self selectedMember ifNotNilDo: [ :mem | mem contentStream ascii ]!

Item was changed:
  ----- Method: BrowserCommentTextMorph>>showPane (in category 'displaying') -----
  showPane
  owner ifNil: [
  | win |
  win := self window ifNil: [ ^self ].
  win addMorph: self fullFrame: self layoutFrame.
  win updatePanesFromSubmorphs ].
 
+ self lowerPane ifNotNil: [ :lp | lp layoutFrame bottomFraction: self layoutFrame topFraction ].
- self lowerPane ifNotNilDo: [ :lp | lp layoutFrame bottomFraction: self layoutFrame topFraction ].
 
+ self window ifNotNil: [:win | win addPaneSplitters]!
- self window ifNotNilDo: [:win | win addPaneSplitters]!

Item was changed:
  ----- Method: ArchiveViewer>>createWindow (in category 'initialization') -----
  createWindow
  | list heading font text buttonBar |
 
  font := (TextStyle named: #DefaultFixedTextStyle)
+ ifNotNil: [ :ts | ts fontArray first].
- ifNotNilDo: [ :ts | ts fontArray first].
 
  buttonBar := self createButtonBar.
  self addMorph: buttonBar
  fullFrame: (LayoutFrame fractions: (0@0 corner: 1.0@0.0) offsets: (0@0 corner: 0@44)).
 
  self minimumExtent: (buttonBar fullBounds width + 20) @ 230.
  self extent: self minimumExtent.
 
  heading := self createListHeadingUsingFont: font.
  self addMorph: heading
  fullFrame: (LayoutFrame fractions: (0@0 corner: 1.0@0.0) offsets: (0@44 corner: 0@60)).
 
  (list := PluggableListMorph new)
  on: self list: #memberList
  selected: #memberIndex changeSelected: #memberIndex:
  menu: #memberMenu:shifted: keystroke: nil.
  list color: self defaultBackgroundColor.
 
  font ifNotNil: [list font: font].
  self addMorph: list
  fullFrame: (LayoutFrame fractions: (0@0 corner: 1.0@0.8) offsets: (0@60 corner: 0@0)).
 
  text := PluggableTextMorph on: self
  text: #contents accept: nil
  readSelection: nil menu: nil.
  self addMorph: text
  frame: (0@0.8 corner: 1.0@1.0).
  text lock.
 
  self setLabel: 'Ned''s Zip Viewer'!

Item was changed:
  ----- Method: CodeHolder>>refreshAnnotation (in category 'misc') -----
  refreshAnnotation
  "If the receiver has an annotation pane that does not bear unaccepted edits, refresh it"
 
+ (self dependents detect: [:m | (m inheritsFromAnyIn: #('PluggableTextView' 'PluggableTextMorph')) and: [m getTextSelector == #annotation]] ifNone: [nil]) ifNotNil:
- (self dependents detect: [:m | (m inheritsFromAnyIn: #('PluggableTextView' 'PluggableTextMorph')) and: [m getTextSelector == #annotation]] ifNone: [nil]) ifNotNilDo:
  [:aPane | aPane hasUnacceptedEdits ifFalse:
  [aPane update: #annotation]]!

Item was changed:
  ----- Method: VersionsBrowser>>scanVersionsOf:class:meta:category:selector: (in category 'init & update') -----
  scanVersionsOf: method class: class meta: meta category: category selector: selector
  | position prevPos prevFileIndex preamble tokens sourceFilesCopy stamp cat |
  selectorOfMethod := selector.
  currentCompiledMethod := method.
  classOfMethod := meta ifTrue: [class class] ifFalse: [class].
  cat := category ifNil: [''].
  changeList := OrderedCollection new.
  list := OrderedCollection new.
+ self addedChangeRecord ifNotNil: [ :change |
- self addedChangeRecord ifNotNilDo: [ :change |
  self addItem: change text: ('{1} (in {2})' translated format: { change stamp. change fileName }) ].
  listIndex := 0.
  position := method filePosition.
  sourceFilesCopy := SourceFiles collect:
  [:x | x isNil ifTrue: [ nil ]
  ifFalse: [x readOnlyCopy]].
  method fileIndex == 0 ifTrue: [^ nil].
  file := sourceFilesCopy at: method fileIndex.
 
  [position notNil & file notNil]
  whileTrue:
  [file position: (0 max: position-150).  "Skip back to before the preamble"
  preamble := method getPreambleFrom: file at: (0 max: position - 3).
 
  "Preamble is likely a linked method preamble, if we're in
  a changes file (not the sources file).  Try to parse it
  for prior source position and file index"
  prevPos := nil.
  stamp := ''.
  (preamble findString: 'methodsFor:' startingAt: 1) > 0
  ifTrue: [tokens := Scanner new scanTokens: preamble]
  ifFalse: [tokens := Array new  "ie cant be back ref"].
  ((tokens size between: 7 and: 8)
  and: [(tokens at: tokens size-5) = #methodsFor:])
  ifTrue:
  [(tokens at: tokens size-3) = #stamp:
  ifTrue: ["New format gives change stamp and unified prior pointer"
  stamp := tokens at: tokens size-2.
  prevPos := tokens last.
  prevFileIndex := sourceFilesCopy fileIndexFromSourcePointer: prevPos.
  prevPos := sourceFilesCopy filePositionFromSourcePointer: prevPos]
  ifFalse: ["Old format gives no stamp; prior pointer in two parts"
  prevPos := tokens at: tokens size-2.
  prevFileIndex := tokens last].
  cat := tokens at: tokens size-4.
  (prevPos = 0 or: [prevFileIndex = 0]) ifTrue: [prevPos := nil]].
  ((tokens size between: 5 and: 6)
  and: [(tokens at: tokens size-3) = #methodsFor:])
  ifTrue:
  [(tokens at: tokens size-1) = #stamp:
  ifTrue: ["New format gives change stamp and unified prior pointer"
  stamp := tokens at: tokens size].
  cat := tokens at: tokens size-2].
    self addItem:
  (ChangeRecord new file: file position: position type: #method
  class: class name category: category meta: meta stamp: stamp)
  text: stamp , ' ' , class name , (meta ifTrue: [' class '] ifFalse: [' ']) , selector, ' {', cat, '}'.
  position := prevPos.
  prevPos notNil ifTrue:
  [file := sourceFilesCopy at: prevFileIndex]].
  sourceFilesCopy do: [:x | x notNil ifTrue: [x close]].
  listSelections := Array new: list size withAll: false!

Item was changed:
  ----- Method: ArchiveViewer>>memberMenu:shifted: (in category 'member list') -----
  memberMenu: menu shifted: shifted
  | services |
 
  menu
  add: 'Comment archive' target: self selector: #commentArchive;
  balloonTextForLastItem: 'Add a comment for the entire archive'.
 
+ self selectedMember ifNotNil: [ :member |
- self selectedMember ifNotNilDo: [ :member |
  menu
  addLine;
  add: 'Inspect member' target: self selector: #inspectMember;
  balloonTextForLastItem: 'Inspect the selected member';
  add: 'Comment member' target: self selector: #commentMember;
  balloonTextForLastItem: 'Add a comment for the selected member';
  addLine;
  add: 'member go up in order ' target: self selector: #upMember;
  add: 'member go down in order ' target: self selector: #downMember;
  add: 'select member order ' target: self selector: #toIndexPlace;
  addLine.
  services := FileList itemsForFile: member fileName.
  menu addServices2: services for: self extraLines: #().
  ].
 
 
  ^menu!

Item was changed:
  ----- Method: ObjectExplorer>>object (in category 'accessing') -----
  object
+ ^currentSelection ifNotNil: [ :cs | cs withoutListWrapper ]!
- ^currentSelection ifNotNilDo: [ :cs | cs withoutListWrapper ]!

Item was changed:
  ----- Method: MethodHolder>>doItReceiver (in category 'menu') -----
  doItReceiver
  "If there is an instance associated with me, answer it, for true mapping of self.  If not, then do what other code-bearing tools do, viz. give access to the class vars."
 
+ (self dependents detect: [:m | m isKindOf: MethodMorph]) ifNotNil:
- (self dependents detect: [:m | m isKindOf: MethodMorph]) ifNotNilDo:
  [:mm | (mm owner isKindOf: ScriptEditorMorph) ifTrue:
  [^ mm owner playerScripted]].
 
  ^ self selectedClass ifNil: [FakeClassPool new]!

Item was changed:
  ----- Method: BrowserCommentTextMorph>>hidePane (in category 'displaying') -----
  hidePane
  | win |
+ self window ifNotNil: [:window | window removePaneSplitters].
- self window ifNotNilDo: [:window | window removePaneSplitters].
 
+ self lowerPane ifNotNil:
- self lowerPane ifNotNilDo:
  [ :lp |
  lp layoutFrame bottomFraction: self layoutFrame bottomFraction.
  lp layoutFrame bottomOffset: SystemWindow borderWidth negated].
  win := self window ifNil: [ ^self ].
  self delete.
  win updatePanesFromSubmorphs.
  win addPaneSplitters!

Item was changed:
  ----- Method: ProcessBrowser>>pcRange (in category 'stack list') -----
  pcRange
  "Answer the indices in the source code for the method corresponding to  
  the selected context's program counter value."
  (selectedContext isNil or: [methodText isEmptyOrNil])
  ifTrue: [^ 1 to: 0].
  ^selectedContext debuggerMap
+ rangeForPC: (selectedContext pc ifNotNil: [:pc| pc] ifNil: [selectedContext method endPC])
- rangeForPC: (selectedContext pc ifNotNilDo: [:pc| pc] ifNil: [selectedContext method endPC])
  contextIsActiveContext: stackListIndex = 1!