The Inbox: Tools-ct.934.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-ct.934.mcz

commits-2
Christoph Thiede uploaded a new version of Tools to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.934.mcz

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

Name: Tools-ct.934
Author: ct
Time: 20 January 2020, 12:41:49.670545 am
UUID: f843367b-5a18-6742-a930-9dadcbbf7a9b
Ancestors: Tools-mt.929

Minor refactoring of Debugger's toolbuilding.

- Some deduplication, some decomposition
- Improve multilingual support
- Rename #notifierContextStackFrame (formerly named #contextStackFrame)

=============== Diff against Tools-mt.929 ===============

Item was added:
+ ----- Method: Debugger>>buildButtonRowWith:from: (in category 'toolbuilder') -----
+ buildButtonRowWith: builder from: quads
+
+ | panelSpec |
+ panelSpec := builder pluggablePanelSpec new.
+ panelSpec layout: #horizontal.
+ panelSpec children: OrderedCollection new.
+ quads do: [:spec | | buttonSpec |
+ buttonSpec := builder pluggableButtonSpec new.
+ buttonSpec model: self.
+ buttonSpec label: spec first.
+ buttonSpec action: spec second.
+ buttonSpec help: spec fourth.
+ spec at: 5 ifPresent: [:boolean | buttonSpec enabled: boolean].
+ panelSpec children add: buttonSpec].
+ ^ panelSpec!

Item was added:
+ ----- Method: Debugger>>buildContextStackListWith: (in category 'toolbuilder') -----
+ buildContextStackListWith: builder
+
+ ^ builder pluggableListSpec new
+ model: self;
+ list: #contextStackList;
+ getIndex: #contextStackIndex;
+ setIndex: #toggleContextStackIndex:;
+ menu: #contextStackMenu:shifted:;
+ icon: #messageIconAt:;
+ helpItem: #messageHelpAt:;
+ keyPress: #contextStackKey:from:;
+ frame: (0 @ 0 corner: 1 @ 0.22)
+ yourself!

Item was changed:
  ----- Method: Debugger>>buildFullWith: (in category 'toolbuilder') -----
  buildFullWith: builder
+
+ | windowSpec |
- | windowSpec listSpec textSpec |
  windowSpec := builder pluggableWindowSpec new
  model: self;
+ label: 'Debugger' translated;
+ children: {
+ self buildContextStackListWith: builder.
+ (self buildCodePaneWith: builder)
+ frame: (0 @ 0.22 corner: 1 @ 0.8);
+ yourself.
+ (self receiverInspector buildFieldListWith: builder)
+ frame: (0 @ 0.8 corner: 0.2 @ 1);
+ help: 'Receiver''s instance variables' translated.
+ (self receiverInspector buildValuePaneWith: builder)
+ help: '<- ' , 'Select receiver''s field' translated;
+ frame: (0.2 @ 0.8 corner: 0.5 @ 1);
+ yourself.
+ (self contextVariablesInspector buildFieldListWith: builder)
+ frame: (0.5 @ 0.8 corner: 0.7 @ 1);
+ help: 'Other Context Bindings' translated;
+ yourself.
+ (self contextVariablesInspector buildValuePaneWith: builder)
+ help: '<- ', 'Select context''s field' translated;
+ frame: (0.7 @ 0.8 corner: 1 @ 1);
+ yourself }.
+ ^ builder build: windowSpec!
- label: 'Debugger';
- children: OrderedCollection new.
-
- listSpec := builder pluggableListSpec new.
- listSpec
- model: self;
- list: #contextStackList;
- getIndex: #contextStackIndex;
- setIndex: #toggleContextStackIndex:;
- menu: #contextStackMenu:shifted:;
- icon: #messageIconAt:;
- helpItem: #messageHelpAt:;
- keyPress: #contextStackKey:from:;
- frame: (0@0 corner: 1@0.22).
- windowSpec children add: listSpec.
-
-
- textSpec := self buildCodePaneWith: builder.
- textSpec frame: (0@0.22corner: 1@0.8).
- windowSpec children add: textSpec.
-
- listSpec := self receiverInspector buildFieldListWith: builder.
- listSpec
- frame: (0@0.8 corner: 0.2@1);
- help: 'Receiver''s\Instance\Variables' withCRs.
- windowSpec children add: listSpec.
-
- textSpec := self receiverInspector buildValuePaneWith: builder.
- textSpec
- help: '<- Select receiver''s field' translated;
- frame: (0.2@0.8 corner: 0.5@1).
- windowSpec children add: textSpec.
-
- listSpec := self contextVariablesInspector buildFieldListWith: builder.
- listSpec
- frame: (0.5@0.8 corner: 0.7@1);
- help: 'Other\Context\Bindings' withCRs.
- windowSpec children add: listSpec.
-
- textSpec := self contextVariablesInspector buildValuePaneWith: builder.
- textSpec
- help: '<- Select context''s field' translated;
- frame: (0.7@0.8 corner: 1@1).
- windowSpec children add: textSpec.
-
- ^builder build: windowSpec!

Item was changed:
  ----- Method: Debugger>>buildNotifierWith:label:message: (in category 'toolbuilder') -----
  buildNotifierWith: builder label: label message: messageString
+
+ | panelSpec quads windowSpec contentsSpec |
- | windowSpec listSpec textSpec panelSpec quads |
  windowSpec := builder pluggableWindowSpec new
  model: self;
  extent: self initialExtentForNotifier;
  label: label;
  children: OrderedCollection new.
+
-
- panelSpec := builder pluggablePanelSpec new.
- panelSpec children: OrderedCollection new.
  quads := self preDebugButtonQuads.
+ self preDebugCreateButtonQuadOrNil ifNotNil: [:createQuad |
+ quads := quads copyWith: createQuad].
+ panelSpec := self buildButtonRowWith: builder from: quads.
- (self interruptedContext selector == #doesNotUnderstand:) ifTrue: [
- quads := quads copyWith:
- { 'Create'. #createMethod. #magenta. 'create the missing method' }
- ].
- (#(#notYetImplemented #shouldBeImplemented #requirement) includes: self interruptedContext selector) ifTrue: [
- quads := quads copyWith:
- { 'Create'. #createImplementingMethod. #magenta. 'implement the marked method' }
- ].
- (self interruptedContext selector == #subclassResponsibility) ifTrue: [
- quads := quads copyWith:
- { 'Create'. #createOverridingMethod. #magenta. 'create the missing overriding method' }
- ].
- quads do:[:spec| | buttonSpec |
- buttonSpec := builder pluggableButtonSpec new.
- buttonSpec model: self.
- buttonSpec label: spec first.
- buttonSpec action: spec second.
- buttonSpec help: spec fourth.
- spec size >= 5 ifTrue: [buttonSpec enabled: spec fifth].
- panelSpec children add: buttonSpec.
- ].
- panelSpec layout: #horizontal. "buttons"
  panelSpec frame: self preDebugButtonQuadFrame.
  windowSpec children add: panelSpec.
 
+ contentsSpec := (Preferences eToyFriendly or: [messageString notNil])
+ ifFalse: [
+ (self buildContextStackListWith: builder)
+ setIndex: #debugAt:;
+ autoDeselect: false;
+ frame: self notifierContextStackFrame;
+ yourself]
+ ifTrue: [
+ message := messageString.
+ builder pluggableTextSpec new
+ model: self;
+ getText: #preDebugMessageString;
+ setText: nil;
+ selection: nil;
+ menu: #debugProceedMenu:;
+ frame: self notifierContextStackFrame;
+ yourself].
+ windowSpec children add: contentsSpec.
+
+ ^ windowSpec!
- Preferences eToyFriendly | messageString notNil ifFalse:[
- listSpec := builder pluggableListSpec new.
- listSpec
- model: self;
- list: #contextStackList;
- getIndex: #contextStackIndex;
- setIndex: #debugAt:;
- icon: #messageIconAt:;
- helpItem: #messageHelpAt:;
- frame: self contextStackFrame.
- windowSpec children add: listSpec.
- ] ifTrue:[
- message := messageString.
- textSpec := builder pluggableTextSpec new.
- textSpec
- model: self;
- getText: #preDebugMessageString;
- setText: nil;
- selection: nil;
- menu: #debugProceedMenu:;
- frame: self contextStackFrame.
- windowSpec children add: textSpec.
- ].
-
- ^windowSpec!

Item was removed:
- ----- Method: Debugger>>contextStackFrame (in category 'toolbuilder') -----
- contextStackFrame
-
- ^LayoutFrame new
- leftFraction: 0 offset: 0;
- topFraction: 0 offset: self buttonHeight;
- rightFraction: 1 offset: 0;
- bottomFraction: 1 offset: 0!

Item was added:
+ ----- Method: Debugger>>notifierContextStackFrame (in category 'toolbuilder') -----
+ notifierContextStackFrame
+
+ ^ LayoutFrame new
+ leftFraction: 0 offset: 0;
+ topFraction: 0 offset: self buttonHeight;
+ rightFraction: 1 offset: 0;
+ bottomFraction: 1 offset: 0!

Item was added:
+ ----- Method: Debugger>>preDebugCreateButtonQuadOrNil (in category 'initialize') -----
+ preDebugCreateButtonQuadOrNil
+
+ | contextSelector description selector |
+ contextSelector := self interruptedContext selector.
+ true
+ caseOf: {
+ [contextSelector = #doesNotUnderstand:] -> [
+ selector :=  #createMethod.
+ description := 'create the missing method' translated].
+ [#(notYetImplemented shouldBeImplemented requirement) includes: contextSelector] -> [
+ selector := #createImplementingMethod.
+ description := 'implement the marked method' translated].
+ [contextSelector = #subclassResponsibility] -> [
+ selector := #createOverridingMethod.
+ description := 'create the missing overriding method' translated] }
+ otherwise: [^ nil].
+ ^ { 'Create' translated. selector. #magenta. description }!