The Inbox: Tools-fbs.300.mcz

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

The Inbox: Tools-fbs.300.mcz

commits-2
A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-fbs.300.mcz

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

Name: Tools-fbs.300
Author: fbs
Time: 2 March 2011, 9:44:48.578 pm
UUID: 6ecc489f-5915-1b47-883b-25666a27aabd
Ancestors: Tools-dtl.299

Baby steps to Browser index death: change "systemCategoryListIndex <op> 0" to "self selectedSystemCategoryName isNil/notNil".

=============== Diff against Tools-dtl.299 ===============

Item was changed:
  ----- Method: Browser>>addSystemCategory (in category 'system category functions') -----
  addSystemCategory
  "Prompt for a new category name and add it before the
  current selection, or at the end if no current selection"
  | oldIndex newName |
  self okToChange ifFalse: [^ self].
  oldIndex := systemCategoryListIndex.
  newName := self
  request: 'Please type new category name'
  initialAnswer: 'Category-Name'.
  newName isEmpty
  ifTrue: [^ self]
  ifFalse: [newName := newName asSymbol].
  systemOrganizer
  addCategory: newName
+ before: self selectedSystemCategoryName.
- before: (systemCategoryListIndex = 0
- ifTrue: [nil]
- ifFalse: [self selectedSystemCategoryName]).
  self systemCategoryListIndex:
  (oldIndex = 0
  ifTrue: [self systemCategoryList size]
  ifFalse: [oldIndex]).
  self changed: #systemCategoryList.!

Item was changed:
  ----- Method: Browser>>classListIndex: (in category 'class list') -----
  classListIndex: anInteger
  "Set anInteger to be the index of the current class selection."
 
  | className currentMessageCategoryName currentMessageName |
  currentMessageCategoryName := [self selectedMessageCategoryName]
  on: Error
  do: [:ex| ex return: nil].
  currentMessageName := [self selectedMessageName]
  on: Error
  do: [:ex| ex return: nil].
 
  classListIndex := anInteger.
  self setClassOrganizer.
 
  "Try to reselect the category and/or selector if the new class has them."
  messageCategoryListIndex := self messageCategoryList
  indexOf: currentMessageCategoryName
  ifAbsent: [0].
  messageListIndex := messageCategoryListIndex = 0
  ifTrue: [0]
  ifFalse: [self messageList
  indexOf: currentMessageName
  ifAbsent: [0]].
 
  messageListIndex ~= 0 ifTrue:
  [self editSelection: #editMessage] ifFalse:
  [messageCategoryListIndex ~= 0 ifTrue:
  [self editSelection: #newMessage] ifFalse:
  [self classCommentIndicated
  ifTrue: []
  ifFalse: [self editSelection: (anInteger = 0
+ ifTrue: [(metaClassIndicated or: [ self selectedSystemCategoryName isNil ])
- ifTrue: [(metaClassIndicated or: [ systemCategoryListIndex = 0 ])
  ifTrue: [#none]
  ifFalse: [#newClass]]
  ifFalse: [#editClass])]]].
  contents := nil.
  self selectedClass isNil
  ifFalse: [className := self selectedClass name.
  (RecentClasses includes: className)
  ifTrue: [RecentClasses remove: className].
  RecentClasses addFirst: className.
  RecentClasses size > 16
  ifTrue: [RecentClasses removeLast]].
  self changed: #classSelectionChanged.
  self changed: #classCommentText.
  self changed: #classListIndex. "update my selection"
  self changed: #messageCategoryList.
  self changed: #messageList.
  self changed: #relabel.
  self contentsChanged!

Item was changed:
  ----- Method: Browser>>defaultClassList (in category 'class list') -----
  defaultClassList
  "Answer an array of the class names of the selected category. Answer an
  empty array if no selection exists."
 
+ ^ self selectedSystemCategoryName isNil
- ^ systemCategoryListIndex = 0
  ifTrue: [Array new]
  ifFalse: [systemOrganizer listAtCategoryNumber: systemCategoryListIndex]!

Item was changed:
  ----- Method: Browser>>fileOutSystemCategory (in category 'system category functions') -----
  fileOutSystemCategory
  "Print a description of each class in the selected category onto a file
  whose name is the category name followed by .st."
 
+ self selectedSystemCategoryName notNil
- systemCategoryListIndex ~= 0
  ifTrue: [systemOrganizer fileOutCategory: self selectedSystemCategoryName]!

Item was changed:
  ----- Method: Browser>>metaClassIndicated: (in category 'metaclass') -----
  metaClassIndicated: trueOrFalse
  "Indicate whether browsing instance or class messages."
 
  metaClassIndicated := trueOrFalse.
  self setClassOrganizer.
+ self selectedSystemCategoryName notNil ifTrue:
- systemCategoryListIndex > 0 ifTrue:
  [self editSelection: (classListIndex = 0
  ifTrue: [metaClassIndicated
  ifTrue: [#none]
  ifFalse: [#newClass]]
  ifFalse: [#editClass])].
  messageCategoryListIndex := 0.
  messageListIndex := 0.
  contents := nil.
  self changed: #classSelectionChanged.
  self changed: #messageCategoryList.
  self changed: #messageList.
  self changed: #contents.
  self changed: #annotation.
  self decorateButtons
  !

Item was changed:
  ----- Method: Browser>>removeSystemCategory (in category 'system category functions') -----
  removeSystemCategory
  "If a class category is selected, create a Confirmer so the user can
  verify that the currently selected class category and all of its classes
    should be removed from the system. If so, remove it."
 
+ self selectedSystemCategoryName isNil ifTrue: [^ self].
- systemCategoryListIndex = 0 ifTrue: [^ self].
  self okToChange ifFalse: [^ self].
  (self classList size = 0
  or: [self confirm: 'Are you sure you want to
  remove this system category
  and all its classes?'])
  ifTrue:
  [systemOrganizer removeSystemCategory: self selectedSystemCategoryName.
  self systemCategoryListIndex: 0.
  self changed: #systemCategoryList]!

Item was changed:
  ----- Method: Browser>>selectedEnvironment (in category 'system category list') -----
  selectedEnvironment
  "Answer the name of the selected system category or nil."
 
+ self selectedSystemCategoryName isNil ifTrue: [^nil].
- systemCategoryListIndex = 0 ifTrue: [^nil].
  ^ Smalltalk!