The Trunk: Tools-cmm.601.mcz

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

The Trunk: Tools-cmm.601.mcz

commits-2
Chris Muller uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-cmm.601.mcz

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

Name: Tools-cmm.601
Author: cmm
Time: 21 April 2015, 9:32:35.388 pm
UUID: 9a860ff9-21b9-48b6-9613-8a5f0303877b
Ancestors: Tools-cmm.600

- Added "Show System-Category in Hierarchy Browsers" so that HierarchyBrowsers may prefer to show their systemCategory or not.
- Let the new layout frame for FileContentsBrowser play nicely with the horizontal smart-splitter algorithm; by not making a one-line list.

=============== Diff against Tools-cmm.600 ===============

Item was changed:
  ----- Method: Browser>>selectClassNamed: (in category 'class list') -----
  selectClassNamed: aSymbolOrString
  | className currentMessageCategoryName currentMessageName |
 
  currentMessageCategoryName := [self selectedMessageCategoryName]
  on: Error
  do: [:ex| ex return: nil].
  currentMessageName := [self selectedMessageName]
  on: Error
  do: [:ex| ex return: nil].
 
  selectedClassName := aSymbolOrString ifNotNil: [ aSymbolOrString asSymbol ].
  self setClassOrganizer.
  self setClassDefinition.
 
  "Try to reselect the category and/or selector if the new class has them."
  selectedMessageCategoryName :=(self messageCategoryList includes: currentMessageCategoryName)
  ifTrue: [currentMessageCategoryName]
  ifFalse: [nil].
  selectedMessageName := (self messageList includes: currentMessageName)
  ifTrue: [currentMessageName]
  ifFalse: [nil].
 
  self hasMessageSelected ifTrue:
  [self editSelection: #editMessage] ifFalse:
  [self hasMessageCategorySelected ifTrue:
  [self editSelection: #newMessage] ifFalse:
  [self classCommentIndicated
  ifTrue: [self editSelection: #editComment]
  ifFalse: [self editSelection: (self hasClassSelected not
  ifTrue: [(metaClassIndicated or: [ self hasSystemCategorySelected not ])
  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 changed: #selectedSystemCategoryName.
  self contentsChanged!

Item was changed:
  ----- Method: FileContentsBrowser>>buildSystemCatListSingletonWith: (in category 'toolbuilder') -----
+ buildSystemCatListSingletonWith: aToolBuilder
- buildSystemCatListSingletonWith: builder
  "Overwritten to change callbacks for menu and keyboard interaction."
+ ^ aToolBuilder pluggableInputFieldSpec new
+ model: self ;
+ getText: #selectedSystemCategoryName ;
+ setText: nil ;
+ " keyPress: #systemCatSingletonKey:from: ;
+ " menu: #packageListMenu:shifted:;
+ " keyPress: #packageListKey:from:;
+ " yourself!
-
- ^ (super buildSystemCatListSingletonWith: builder)
- menu: #packageListMenu:shifted:;
- keyPress: #packageListKey:from:;
- yourself!

Item was changed:
  Browser subclass: #HierarchyBrowser
  instanceVariableNames: 'classDisplayList centralClass'
+ classVariableNames: 'ShowSystemCategory'
- classVariableNames: ''
  poolDictionaries: ''
  category: 'Tools-Browser'!
 
  !HierarchyBrowser commentStamp: 'fbs 3/9/2011 12:02' prior: 0!
  I provide facilities to explore classes in the context of their subclass hierarchy.
 
  My classDisplayList instvar uses indentation to show the subclassing relationship between the displayed classes.
  !

Item was added:
+ ----- Method: HierarchyBrowser class>>showSystemCategory (in category 'preferences') -----
+ showSystemCategory
+ <preference: 'Show System-Category in Hierarchy Browsers'
+ category: 'Morphic'
+ description: 'When true, hierarchy browsers will include a widget which reports the system category.'
+ type: #Boolean>
+ ^ ShowSystemCategory ifNil: [ true ]!

Item was added:
+ ----- Method: HierarchyBrowser class>>showSystemCategory: (in category 'preferences') -----
+ showSystemCategory: aBoolean
+ ShowSystemCategory := aBoolean!

Item was added:
+ ----- Method: HierarchyBrowser>>openSystemCatEditString: (in category 'toolbuilder') -----
+ openSystemCatEditString: aString
+ "Create a pluggable version of all the views for a Browser, including views and controllers.  The top list view is of the currently selected system class category--a single item list."
+ "Example:
+ Browser new browseAllClasses.
+ "
+ | builder catPaneHeight max |
+ self class showSystemCategory ifTrue: [ ^ super openSystemCatEditString: aString ].
+ catPaneHeight := Preferences standardListFont height + 5 "top margin/border" + 5 "bottom margin/border".
+ builder := ToolBuilder default.
+ max := self wantsOptionalButtons ifTrue:[0.32] ifFalse:[0.4].
+ ^self buildWindowWith: builder specs: {
+ (self classListFrame: max fromTop: 0 fromLeft: 0 width: 0.333) -> [self buildClassListWith: builder].
+ (self switchesFrame: max fromLeft: 0 width: 0.333) -> [self buildSwitchesWith: builder].
+ (LayoutFrame fractions: (0.333@0 corner: 0.666@max) offsets: (0@0 corner: 0@0)) -> [self buildMessageCategoryListWith: builder].
+ (LayoutFrame fractions: (0.666@0 corner: 1@max) offsets: (0@0 corner: 0@0)) -> [self buildMessageListWith: builder].
+ (0@max corner: 1@1) -> [self buildCodePaneWith: builder].
+ }!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-cmm.601.mcz

marcel.taeumel (old)
-1 on the code duplication in HierarchyBrowser>>openSystemCatEditString: ...  :-/

Why don't you change the way "singleton-browsers" are displayed in general? I would not make this specific to the HierarchyBrowser.

"Let the new layout frame for FileContentsBrowser play nicely with the horizontal smart-splitter algorithm; by not making a one-line list." --> The splitter should not be there if the list has a fixed height. This is a bug in SystemWindow >> #addPaneSplitters. We should really fix that bug.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-cmm.601.mcz

Chris Muller-3
> -1 on the code duplication in HierarchyBrowser>>openSystemCatEditString: ...
> :-/

Its similar, but not actually duplicate.  I thought about trying to
factor out some of the common portions into new methods but the widget
specs are specified as literal-Array's  for a reason (user
readability) and there really is no benefit to making more methods
until there is some basis for reuse there.  But there are no other
dependencies on this code.

> Why don't you change the way "singleton-browsers" are displayed in general?
> I would not make this specific to the HierarchyBrowser.

The only other one is FileContents right?  But it _needs_ its
"CatList" to be able to file in the whole file.  So this is really not
anything about "Cats" and so this actually reveals what a bad
generalization openSystemCatEditString: is in the first place, IMO.

Besides being a bad generalization and badly named ("cat" instead of
"category"), did you notice that none of the implementations use the
"aString" argument and most senders pass in nil?  Crapola..  :)

> "Let the new layout frame for FileContentsBrowser play nicely with the
> horizontal smart-splitter algorithm; by not making a one-line list." --> The
> splitter should not be there if the list has a fixed height. This is a bug
> in SystemWindow >> #addPaneSplitters. We should really fix that bug.

You know from my private email this is what this change is about.  If
we can do another acceptable solution that would be fine with me..

> Best,
> Marcel
>
>
>
> --
> View this message in context: http://forum.world.st/The-Trunk-Tools-cmm-601-mcz-tp4821038p4821151.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-cmm.601.mcz

marcel.taeumel (old)
Ah, okay. I thought that no tool makes use of the single-entry-list's menu. :)

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-cmm.601.mcz

marcel.taeumel (old)
What about nuking the widget for the system-category completely and adding that information to the window's label? :) At least for the hiearchy browser.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-cmm.601.mcz

Chris Muller-3
On Wed, Apr 22, 2015 at 2:38 PM, Marcel Taeumel
<[hidden email]> wrote:
> What about nuking the widget for the system-category completely and adding
> that information to the window's label? :) At least for the hiearchy
> browser.

Ohh, that might actually work..  :)   Maybe replace the phrase:
"Hierarchy Browser:" with the system category?