# HG changeset patch # User Claus Gittinger # Date 1569975717 -7200 # Node ID bc17ad12cef08946b14227d41efd55c39766dc85 # Parent 371ad059085ab7c64a7780461cd183a157b7e361 #REFACTORING by exept class: MethodFinderWindow class definition added: #argStringAndValueFromEditorContents: #classOfResultListHolder #classOfResultNameListHolder #selectedClassOfResultIndexHolder #selectedClassOfResultIndexHolderChanged removed: #classOfResultHolder #selectedClassOfResultHolder #selectedClassOfResultHolderChanged comment/format in: #cleanInputs: #extractClassAndSelectorFrom: changed: #argumentEditorsContents #clear #isExpression: #messageAnswerEditorContents #openBrowserOn: #receiverEditorContents #search (send #classOfResultListHolder instead of #classOfResultHolder) #searchPatternMatchesInBackground (send #classOfResultListHolder instead of #classOfResultHolder) #updateImplementorsOf: #updateListAfterPatternSearch: (send #classOfResultListHolder instead of #classOfResultHolder) class: MethodFinderWindow class changed: #windowSpec #windowSpec_old diff -r 371ad059085a -r bc17ad12cef0 MethodFinderWindow.st --- a/MethodFinderWindow.st Wed Oct 02 02:20:29 2019 +0200 +++ b/MethodFinderWindow.st Wed Oct 02 02:21:57 2019 +0200 @@ -30,12 +30,13 @@ ApplicationModel subclass:#MethodFinderWindow instanceVariableNames:'resultHolder selectorPatternHolder classOfResultHolder - selectedClassOfResultHolder selectedImplementorsHolder - argumentsEditor messageAnswerEditor receiverEditor receiver - resultSelectors arg2BoxVisible arg1BoxVisible arg4BoxVisible - arg3BoxVisible argCountHolder argCountList argument1Editor - argument2Editor argument3Editor argument4Editor resultSelected - lookAtResultEditor codeHolder searchProcess' + selectedImplementorsHolder argumentsEditor messageAnswerEditor + receiverEditor receiver resultSelectors arg2BoxVisible + arg1BoxVisible arg4BoxVisible arg3BoxVisible argCountHolder + argCountList argument1Editor argument2Editor argument3Editor + argument4Editor resultSelected lookAtResultEditor codeHolder + searchProcess classOfResultNameListHolder + selectedClassOfResultIndexHolder classOfResultListHolder' classVariableNames:'' poolDictionaries:'' category:'Interface-Tools' @@ -183,23 +184,20 @@ ^ #(FullSpec name: windowSpec - uuid: '1871401e-aa2d-11e9-8c78-b8f6b1108e05' + uuid: '7da03570-e499-11e9-8918-10ddb1cc5928' window: (WindowSpec label: 'MethodFinder' name: 'MethodFinder' uuid: '5fb0c87a-89f6-11e9-8df0-b8f6b1108e05' - bounds: (Rectangle 0 0 816 738) - menu: menu + bounds: (Rectangle 0 0 816 738) menu: menu icon: defaultIcon - ) - component: + ) component: (SpecCollection collection: ( (VariableHorizontalPanelSpec name: 'VariableHorizontalPanel1' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - uuid: '5fb0cd98-89f6-11e9-8df0-b8f6b1108e05' + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) uuid: '5fb0cd98-89f6-11e9-8df0-b8f6b1108e05' showHandle: true snapMode: both component: @@ -220,39 +218,34 @@ collection: ( (ViewSpec name: 'ReceiverArgBox' - layout: (LayoutFrame 0 0 0 0 0 1 -30 1) - uuid: '5fb0d4f0-89f6-11e9-8df0-b8f6b1108e05' + layout: (LayoutFrame 0 0 0 0 0 1 -30 1) uuid: '5fb0d4f0-89f6-11e9-8df0-b8f6b1108e05' component: (SpecCollection collection: ( (LabelSpec label: 'Receiver' name: 'ReceiverLabel' - layout: (LayoutFrame 0 0 0 0 0 0.34000000000000002 28 0) - uuid: '5fb0d6b2-89f6-11e9-8df0-b8f6b1108e05' + layout: (LayoutFrame 0 0 0 0 0 0.34000000000000002 28 0) uuid: '5fb0d6b2-89f6-11e9-8df0-b8f6b1108e05' translateLabel: true - ) + ) (ComboListSpec name: 'AllowedArguments' - layout: (LayoutFrame 0 0.34000000000000002 1 0 0 0.64000000000000135 28 0) - activeHelpKey: argumentCount + layout: (LayoutFrame 0 0.34000000000000002 1 0 0 0.64000000000000135 28 0) activeHelpKey: argumentCount uuid: '5fb0da9a-89f6-11e9-8df0-b8f6b1108e05' model: argCountHolder comboList: argCountList useIndex: true - ) + ) (LabelSpec label: 'Answer' name: 'MessageAnswerLabel' - layout: (LayoutFrame 0 0.64000000000000135 0 0 0 1 28 0) - activeHelpKey: arg1Value + layout: (LayoutFrame 0 0.64000000000000135 0 0 0 1 28 0) activeHelpKey: arg1Value uuid: '5fb0dd60-89f6-11e9-8df0-b8f6b1108e05' translateLabel: true - ) + ) (HorizontalPanelViewSpec name: 'HorizontalPanel1' - layout: (LayoutFrame 0 0 30 0 0 1 0 1) - uuid: '5fb0dee6-89f6-11e9-8df0-b8f6b1108e05' + layout: (LayoutFrame 0 0 30 0 0 1 0 1) uuid: '5fb0dee6-89f6-11e9-8df0-b8f6b1108e05' horizontalLayout: fit verticalLayout: fit horizontalSpace: 3 @@ -271,9 +264,8 @@ miniScrollerVertical: true autoHideScrollBars: true hasKeyboardFocusInitially: false - extent: (Point 86 142) - postBuildCallback: receiverWidgetCreated: - ) + extent: (Point 86 142) postBuildCallback: receiverWidgetCreated: + ) (VerticalPanelViewSpec name: 'VerticalPanel1' uuid: '5fb0e51c-89f6-11e9-8df0-b8f6b1108e05' @@ -285,7 +277,7 @@ (SpecCollection collection: ( (ViewSpec - name: 'Box1' + name: 'Arg1Box' uuid: '5fb0e6d4-89f6-11e9-8df0-b8f6b1108e05' visibilityChannel: arg1BoxVisible component: @@ -293,8 +285,7 @@ collection: ( (WorkspaceSpec name: 'Arg1Editor' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - activeHelpKey: arg1Value + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) activeHelpKey: arg1Value uuid: '5fb0e7ce-89f6-11e9-8df0-b8f6b1108e05' tabable: true hasHorizontalScrollBar: true @@ -304,23 +295,20 @@ autoHideScrollBars: true hasKeyboardFocusInitially: false postBuildCallback: argument1WidgetCreated: - ) ) - - ) - extent: (Point 87 45) - ) + ) + ) extent: (Point 87 45) + ) (ViewSpec - name: 'Box2' + name: 'Arg2Box' uuid: '5fb0e9b8-89f6-11e9-8df0-b8f6b1108e05' visibilityChannel: arg2BoxVisible component: (SpecCollection collection: ( (WorkspaceSpec - name: 'TextEditor5' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - activeHelpKey: arg2Value + name: 'Arg2Editor' + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) activeHelpKey: arg2Value uuid: '5fb0eabc-89f6-11e9-8df0-b8f6b1108e05' tabable: true hasHorizontalScrollBar: true @@ -330,23 +318,20 @@ autoHideScrollBars: true hasKeyboardFocusInitially: false postBuildCallback: argument2WidgetCreated: - ) ) - - ) - extent: (Point 87 46) - ) + ) + ) extent: (Point 87 46) + ) (ViewSpec - name: 'Box3' + name: 'Arg3Box' uuid: '5fb0ec74-89f6-11e9-8df0-b8f6b1108e05' visibilityChannel: arg3BoxVisible component: (SpecCollection collection: ( (WorkspaceSpec - name: 'TextEditor6' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - activeHelpKey: arg3Value + name: 'Arg3Editor' + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) activeHelpKey: arg3Value uuid: '5fb0ed64-89f6-11e9-8df0-b8f6b1108e05' tabable: true hasHorizontalScrollBar: true @@ -356,17 +341,13 @@ autoHideScrollBars: true hasKeyboardFocusInitially: false postBuildCallback: argument3WidgetCreated: - ) ) - - ) - extent: (Point 87 45) - ) + ) + ) extent: (Point 87 45) ) - - ) - extent: (Point 87 142) - ) + ) + ) extent: (Point 87 142) + ) (WorkspaceSpec name: 'AnswerEditor' activeHelpKey: answerValue @@ -378,51 +359,43 @@ miniScrollerVertical: true autoHideScrollBars: true hasKeyboardFocusInitially: false - extent: (Point 87 142) - postBuildCallback: messageAnswerWidgetCreated: - ) + extent: (Point 87 142) postBuildCallback: messageAnswerWidgetCreated: ) - - ) - ) + ) + ) ) - - ) - ) + ) + ) + ) (ViewSpec name: 'ReceiverArgBoxActionBox' - layout: (LayoutFrame 0 0 -30 1 0 1 0 1) - uuid: '5fb0f0fc-89f6-11e9-8df0-b8f6b1108e05' + layout: (LayoutFrame 0 0 -30 1 0 1 0 1) uuid: '5fb0f0fc-89f6-11e9-8df0-b8f6b1108e05' component: (SpecCollection collection: ( (ActionButtonSpec label: 'Clear' name: 'ClearButton' - layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1) - activeHelpKey: clearButton + layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1) activeHelpKey: clearButton uuid: '5fb0f214-89f6-11e9-8df0-b8f6b1108e05' translateLabel: true model: clear - ) + ) (ActionButtonSpec label: 'Search' name: 'SearchButton' - layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1) - activeHelpKey: startSearchButton + layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1) activeHelpKey: startSearchButton uuid: '5fb0f52a-89f6-11e9-8df0-b8f6b1108e05' translateLabel: true tabable: true model: search - ) ) - - ) - ) + ) + ) ) - - ) - ) + ) + ) + ) (ViewSpec name: 'SelectorFinderBox' uuid: '5fb0f714-89f6-11e9-8df0-b8f6b1108e05' @@ -431,48 +404,42 @@ collection: ( (ViewSpec name: 'MatchActionBox' - layout: (LayoutFrame 0 0 0 0 0 1 90 0) - uuid: '5fb0f818-89f6-11e9-8df0-b8f6b1108e05' + layout: (LayoutFrame 0 0 0 0 0 1 90 0) uuid: '5fb0f818-89f6-11e9-8df0-b8f6b1108e05' component: (SpecCollection collection: ( (LabelSpec label: 'Selector Pattern:' name: 'SelectorPatternLabel' - layout: (LayoutFrame 0 0 0 0 0 1 25 0) - uuid: '5fb0f908-89f6-11e9-8df0-b8f6b1108e05' + layout: (LayoutFrame 0 0 0 0 0 1 25 0) uuid: '5fb0f908-89f6-11e9-8df0-b8f6b1108e05' translateLabel: true adjust: left - ) + ) (InputFieldSpec name: 'SelectorPattern' - layout: (LayoutFrame 2 0 -54 1 -2 1 -29 1) - activeHelpKey: selectorPattern + layout: (LayoutFrame 2 0 -54 1 -2 1 -29 1) activeHelpKey: selectorPattern uuid: '5fb0fa70-89f6-11e9-8df0-b8f6b1108e05' model: selectorPatternHolder immediateAccept: true acceptOnReturn: true acceptOnTab: true acceptOnPointerLeave: true - ) + ) (ActionButtonSpec label: 'Search' name: 'SearchPatternButton' - layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1) - activeHelpKey: startSearchPatternButton + layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1) activeHelpKey: startSearchPatternButton uuid: '5fb0fea8-89f6-11e9-8df0-b8f6b1108e05' translateLabel: true tabable: true model: searchPatternMatchesInBackground - ) ) - - ) - ) + ) + ) + ) (SequenceViewSpec name: 'ResultList' - layout: (LayoutFrame 0 0 94 0 0 1 0 1) - activeHelpKey: implementorsFound + layout: (LayoutFrame 0 0 94 0 0 1 0 1) activeHelpKey: implementorsFound uuid: '5fb1009c-89f6-11e9-8df0-b8f6b1108e05' model: selectedImplementorsHolder menu: resultListMenu @@ -481,16 +448,13 @@ autoHideScrollBars: true useIndex: true sequenceList: resultHolder - ) ) - - ) - ) + ) + ) ) - - ) - handles: (Any 0.28000000000000003 1.0) - ) + ) + ) handles: (Any 0.28000000000000003 1.0) + ) (VariableVerticalPanelSpec name: 'RightBox' uuid: '5fb103c6-89f6-11e9-8df0-b8f6b1108e05' @@ -500,16 +464,16 @@ (SequenceViewSpec name: 'ImplementorsList' uuid: '5fb10524-89f6-11e9-8df0-b8f6b1108e05' - model: selectedClassOfResultHolder + model: selectedClassOfResultIndexHolder menu: implementorListMenu hasHorizontalScrollBar: true hasVerticalScrollBar: true autoHideScrollBars: true doubleClickSelector: openBrowserOn: - valueChangeSelector: selectedClassOfResultHolderChanged - useIndex: false - sequenceList: classOfResultHolder - ) + valueChangeSelector: selectedClassOfResultIndexHolderChanged + useIndex: true + sequenceList: classOfResultNameListHolder + ) (ViewSpec name: 'Box4' uuid: '4698d744-a993-11e9-b8a4-b8f6b1108e05' @@ -518,8 +482,7 @@ collection: ( (CodeViewSpec name: 'CodeView' - layout: (LayoutFrame 0 0 0 0 0 1 0 1) - uuid: '5fb106dc-89f6-11e9-8df0-b8f6b1108e05' + layout: (LayoutFrame 0 0 0 0 0 1 0 1) uuid: '5fb106dc-89f6-11e9-8df0-b8f6b1108e05' model: codeHolder hasHorizontalScrollBar: true hasVerticalScrollBar: true @@ -527,25 +490,19 @@ hasKeyboardFocusInitially: false viewClassName: 'codeViewClass' postBuildCallback: sourceCodeWidgetCreated: - ) ) - - ) - ) + ) + ) ) - - ) - handles: (Any 0.5 1.0) - ) + ) + ) handles: (Any 0.5 1.0) ) - - ) - handles: (Any 0.33000000000000002 1.0) - ) + ) + ) handles: (Any 0.33000000000000002 1.0) ) - - ) - ) + ) + ) + ) ! windowSpec_old @@ -556,70 +513,70 @@ the UIPainter may not be able to read the specification." " - UIPainter new openOnClass:MethodFinderWindow andSelector:#windowSpec - MethodFinderWindow new openInterface:#windowSpec - MethodFinderWindow open + UIPainter new openOnClass:MethodFinderWindow andSelector:#windowSpec_old + MethodFinderWindow new openInterface:#windowSpec_old " ^ #(FullSpec - name: windowSpec + name: #'windowSpec_old' + uuid: '92a85286-e499-11e9-8918-10ddb1cc5928' window: (WindowSpec label: 'MethodFinder' name: 'MethodFinder' - bounds: (Rectangle 0 0 920 690) - menu: menu + uuid: '92a85542-e499-11e9-8918-10ddb1cc5928' + bounds: (Rectangle 0 0 920 690) menu: menu icon: defaultIcon - ) - component: + ) component: (SpecCollection collection: ( (VariableHorizontalPanelSpec name: 'VariableHorizontalPanel1' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) uuid: '92a857b8-e499-11e9-8918-10ddb1cc5928' snapMode: both component: (SpecCollection collection: ( (ViewSpec name: 'LeftBox' + uuid: '92a85998-e499-11e9-8918-10ddb1cc5928' level: 1 component: (SpecCollection collection: ( (ViewSpec name: 'ReceiverArgBox' - layout: (LayoutFrame 0 0 0 0 0 1 -100 0.5) + layout: (LayoutFrame 0 0 0 0 0 1 -100 0.5) uuid: '92a85ad8-e499-11e9-8918-10ddb1cc5928' component: (SpecCollection collection: ( (LabelSpec label: 'Receiver' name: 'ReceiverLabel' - layout: (LayoutFrame 0 0 0 0 0 0.34000000000000002 28 0) + layout: (LayoutFrame 0 0 0 0 0 0.34000000000000002 28 0) uuid: '92a85bd2-e499-11e9-8918-10ddb1cc5928' translateLabel: true - ) + ) (ComboListSpec name: 'AllowedArguments' - layout: (LayoutFrame 0 0.34000000000000002 1 0 0 0.64000000000000046 28 0) - activeHelpKey: argumentCount + layout: (LayoutFrame 0 0.34000000000000002 1 0 0 0.64000000000000046 28 0) activeHelpKey: argumentCount + uuid: '92a85d8a-e499-11e9-8918-10ddb1cc5928' model: argCountHolder comboList: argCountList useIndex: true - ) + ) (LabelSpec label: 'Answer' name: 'MessageAnswerLabel' - layout: (LayoutFrame 0 0.64000000000000046 0 0 0 1 28 0) - activeHelpKey: arg1Value + layout: (LayoutFrame 0 0.64000000000000046 0 0 0 1 28 0) activeHelpKey: arg1Value + uuid: '92a85f4c-e499-11e9-8918-10ddb1cc5928' translateLabel: true - ) + ) (HorizontalPanelViewSpec name: 'HorizontalPanel1' - layout: (LayoutFrame 0 0 30 0 0 1 0 1) + layout: (LayoutFrame 0 0 30 0 0 1 0 1) uuid: '92a860aa-e499-11e9-8918-10ddb1cc5928' horizontalLayout: fit verticalLayout: fit horizontalSpace: 3 @@ -630,6 +587,7 @@ (WorkspaceSpec name: 'ReceiverEditor' activeHelpKey: receiverValue + uuid: '92a8626c-e499-11e9-8918-10ddb1cc5928' tabable: true hasHorizontalScrollBar: true hasVerticalScrollBar: true @@ -637,11 +595,11 @@ miniScrollerVertical: true autoHideScrollBars: true hasKeyboardFocusInitially: false - extent: (Point 110 214) - postBuildCallback: receiverWidgetCreated: - ) + extent: (Point 111 214) postBuildCallback: receiverWidgetCreated: + ) (VerticalPanelViewSpec name: 'VerticalPanel1' + uuid: '92a864f6-e499-11e9-8918-10ddb1cc5928' horizontalLayout: fit verticalLayout: fit horizontalSpace: 3 @@ -650,15 +608,16 @@ (SpecCollection collection: ( (ViewSpec - name: 'Box1' + name: 'Arg1Box' + uuid: '92a8667c-e499-11e9-8918-10ddb1cc5928' visibilityChannel: arg1BoxVisible component: (SpecCollection collection: ( (WorkspaceSpec name: 'Arg1Editor' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - activeHelpKey: arg1Value + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) activeHelpKey: arg1Value + uuid: '92a8678a-e499-11e9-8918-10ddb1cc5928' tabable: true hasHorizontalScrollBar: true hasVerticalScrollBar: true @@ -667,22 +626,21 @@ autoHideScrollBars: true hasKeyboardFocusInitially: false postBuildCallback: argument1WidgetCreated: - ) ) - - ) - extent: (Point 110 69) - ) + ) + ) extent: (Point 111 69) + ) (ViewSpec - name: 'Box2' + name: 'Arg2Box' + uuid: '92a86974-e499-11e9-8918-10ddb1cc5928' visibilityChannel: arg2BoxVisible component: (SpecCollection collection: ( (WorkspaceSpec - name: 'TextEditor5' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - activeHelpKey: arg2Value + name: 'Arg2Editor' + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) activeHelpKey: arg2Value + uuid: '92a86a6e-e499-11e9-8918-10ddb1cc5928' tabable: true hasHorizontalScrollBar: true hasVerticalScrollBar: true @@ -691,22 +649,21 @@ autoHideScrollBars: true hasKeyboardFocusInitially: false postBuildCallback: argument2WidgetCreated: - ) ) - - ) - extent: (Point 110 70) - ) + ) + ) extent: (Point 111 70) + ) (ViewSpec - name: 'Box3' + name: 'Arg3Box' + uuid: '92a86c30-e499-11e9-8918-10ddb1cc5928' visibilityChannel: arg3BoxVisible component: (SpecCollection collection: ( (WorkspaceSpec - name: 'TextEditor6' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - activeHelpKey: arg3Value + name: 'Arg3Editor' + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) activeHelpKey: arg3Value + uuid: '92a86d20-e499-11e9-8918-10ddb1cc5928' tabable: true hasHorizontalScrollBar: true hasVerticalScrollBar: true @@ -715,20 +672,17 @@ autoHideScrollBars: true hasKeyboardFocusInitially: false postBuildCallback: argument3WidgetCreated: - ) ) - - ) - extent: (Point 110 69) - ) + ) + ) extent: (Point 111 69) ) - - ) - extent: (Point 110 214) - ) + ) + ) extent: (Point 111 214) + ) (WorkspaceSpec name: 'AnswerEditor' activeHelpKey: answerValue + uuid: '92a86ef6-e499-11e9-8918-10ddb1cc5928' tabable: true hasHorizontalScrollBar: true hasVerticalScrollBar: true @@ -736,81 +690,76 @@ miniScrollerVertical: true autoHideScrollBars: true hasKeyboardFocusInitially: false - extent: (Point 110 214) - postBuildCallback: messageAnswerWidgetCreated: - ) + extent: (Point 111 214) postBuildCallback: messageAnswerWidgetCreated: ) - - ) - ) + ) + ) ) - - ) - ) + ) + ) + ) (ViewSpec name: 'ReceiverArgBoxActionBox' - layout: (LayoutFrame 0 0 -98 0.5 0 1 -75 0.5) + layout: (LayoutFrame 0 0 -98 0.5 0 1 -75 0.5) uuid: '92a870cc-e499-11e9-8918-10ddb1cc5928' component: (SpecCollection collection: ( (ActionButtonSpec - activeHelpKey: clearButton label: 'Clear' name: 'Button2' - layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1) + layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1) activeHelpKey: clearButton + uuid: '92a871d0-e499-11e9-8918-10ddb1cc5928' translateLabel: true model: clear - ) + ) (ActionButtonSpec - activeHelpKey: startSearchButton label: 'Search' name: 'Button1' - layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1) + layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1) activeHelpKey: startSearchButton + uuid: '92a8740a-e499-11e9-8918-10ddb1cc5928' translateLabel: true tabable: true model: search - ) ) - - ) - ) + ) + ) + ) (ViewSpec name: 'MatchActionBox' - layout: (LayoutFrame 0 0 -70 0.5 0 1 10 0.5) + layout: (LayoutFrame 0 0 -70 0.5 0 1 10 0.5) uuid: '92a875e0-e499-11e9-8918-10ddb1cc5928' component: (SpecCollection collection: ( (LabelSpec label: 'Selector Pattern:' name: 'Label1' - layout: (LayoutFrame 0 0 0 0 0 0.5 25 0) + layout: (LayoutFrame 0 0 0 0 0 0.5 25 0) uuid: '92a876e4-e499-11e9-8918-10ddb1cc5928' translateLabel: true adjust: left - ) + ) (InputFieldSpec name: 'EntryField1' - layout: (LayoutFrame 2 0 -54 1 -2 1 -29 1) + layout: (LayoutFrame 2 0 -54 1 -2 1 -29 1) uuid: '92a87838-e499-11e9-8918-10ddb1cc5928' model: selectorPatternHolder immediateAccept: true acceptOnReturn: true acceptOnTab: true acceptOnPointerLeave: true - ) + ) (ActionButtonSpec label: 'Search' name: 'Button4' - layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1) + layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1) uuid: '92a87a9a-e499-11e9-8918-10ddb1cc5928' translateLabel: true tabable: true model: searchPatternMatchesInBackground - ) ) - - ) - ) + ) + ) + ) (SequenceViewSpec name: 'ResultList' - layout: (LayoutFrame 0 0 15 0.5 0 1 0 1) + layout: (LayoutFrame 0 0 15 0.5 0 1 0 1) uuid: '92a87c66-e499-11e9-8918-10ddb1cc5928' model: selectedImplementorsHolder menu: resultListMenu hasHorizontalScrollBar: true @@ -818,54 +767,49 @@ autoHideScrollBars: true useIndex: true sequenceList: resultHolder - ) ) - - ) - ) + ) + ) + ) (VariableVerticalPanelSpec name: 'VariableVerticalPanel1' + uuid: '92a87e78-e499-11e9-8918-10ddb1cc5928' component: (SpecCollection collection: ( (SequenceViewSpec name: 'List2' - model: selectedClassOfResultHolder + uuid: '92a87fd6-e499-11e9-8918-10ddb1cc5928' + model: selectedClassOfResultIndexHolder menu: implementorListMenu hasHorizontalScrollBar: true hasVerticalScrollBar: true autoHideScrollBars: true doubleClickSelector: openBrowserOn: - valueChangeSelector: selectedClassOfResultHolderChanged - useIndex: false - sequenceList: classOfResultHolder - ) + valueChangeSelector: selectedClassOfResultIndexHolderChanged + useIndex: true + sequenceList: classOfResultNameListHolder + ) (CodeViewSpec name: 'CodeView' + uuid: '92a88184-e499-11e9-8918-10ddb1cc5928' model: codeHolder hasHorizontalScrollBar: true hasVerticalScrollBar: true autoHideScrollBars: true hasKeyboardFocusInitially: false + viewClassName: 'codeViewClass' postBuildCallback: sourceCodeWidgetCreated: - viewClassName: 'codeViewClass' - ) ) - - ) - handles: (Any 0.5 1.0) - ) + ) + ) handles: (Any 0.5 1.0) ) - - ) - handles: (Any 0.37391304347826104 1.0) - ) + ) + ) handles: (Any 0.37 1.0) ) - - ) - ) - - "Modified: / 19-07-2019 / 12:01:12 / Claus Gittinger" + ) + ) + ) ! ! !MethodFinderWindow class methodsFor:'menu specs'! @@ -1038,8 +982,10 @@ argument3Editor contents:nil. messageAnswerEditor contents:nil. self resultHolder value:nil. - self classOfResultHolder value: nil. - codeHolder value:nil. + self classOfResultListHolder value: nil. + codeHolder notNil ifTrue:[ + codeHolder value:nil. + ]. ! messageAnswerEditorContents @@ -1050,20 +996,28 @@ |aCleanedAnswerString compiledAnswer| aCleanedAnswerString := self cleanInputs:(messageAnswerEditor contents). - compiledAnswer := Compiler evaluate:aCleanedAnswerString. + compiledAnswer := Compiler evaluate:aCleanedAnswerString + ifFail:[ + Dialog information:'Bad value in the answer field'. + AbortOperationRequest raise. + ]. ((self isExpression:aCleanedAnswerString) or:[ compiledAnswer isNil ]) ifTrue:[ aCleanedAnswerString := compiledAnswer printString ]. ^ aCleanedAnswerString -> compiledAnswer. ! -openBrowserOn:anArgument - "Opens browser on theArgument of a specific class. anArgument being a string with the - Class and the selector upon which the browser is to be opened. Return the receiver." +openBrowserOn:indexInList + "Opens browser on theArgument of a specific class. + anArgument being the index of the selected list entry, + which is a string with the class and the selector + upon which the browser is to be opened. + Return the receiver." - |classAndSelector| + |sel classAndSelector| - classAndSelector := self extractClassAndSelectorFrom:anArgument. + sel := classOfResultListHolder value at:indexInList. + classAndSelector := self extractClassAndSelectorFrom:sel. classAndSelector isNil ifTrue:[ ^ self ]. @@ -1128,7 +1082,7 @@ |tempReceiver tempAnswer tempArguments anArray resultArrayOrErrorString receiverWithArgument mf| self resultHolder value:nil. - self classOfResultHolder value:nil. + self classOfResultListHolder value:nil. self codeHolder value:nil. tempArguments := self argumentEditorsContents. tempReceiver := self receiverEditorContents. @@ -1338,7 +1292,7 @@ pattern := self selectorPatternHolder value. pattern isEmptyOrNil ifTrue:[ self resultHolder value:self resultInfoText. - self classOfResultHolder value:nil. + self classOfResultListHolder value:nil. self codeHolder value:nil. ^ self ]. @@ -1356,40 +1310,45 @@ ! updateImplementorsOf:anInteger - "Request the implementors of the selected argument provided by aNumber. + "Request the implementors of the selected argument provided by aNumber (index in list). Return the receiver." - |methods classList aNumber| + |methods classList classNameList aNumber| - (anInteger isNil) ifTrue:[ + (anInteger isNil or:[anInteger == 0]) ifTrue:[ ^ self ]. + aNumber := anInteger ? 1. methods := SystemBrowser - findImplementorsOf:(resultSelectors at:aNumber) - in:Smalltalk allClasses - ignoreCase:false. + findImplementorsOf:(resultSelectors at:aNumber) + in:Smalltalk allClasses + ignoreCase:false. methods := methods asOrderedCollection. classList := methods collect:[:m | m mclass name , ' ' , m selector ]. - classList := self markMatchingClasses:(resultSelectors at:aNumber) - classesWithSelector:classList. + classList := self markMatchingClasses:(resultSelectors at:aNumber) classesWithSelector:classList. + + classNameList := classList with:methods collect:[:s1 :m | s1 , ' ' , ('{' , m category , '}') allGray ]. + "/ now classList contains a list of , "/ where the one which is responsible for the selected result is marked (bold) - self classOfResultHolder value:classList. + self classOfResultListHolder value:classList. + self classOfResultNameListHolder value:classNameList. "/ initially select the bold one classList notEmptyOrNil ifTrue:[ - |receiversMethodEntryInClass| - + |idx receiversMethodEntryInClass| + + idx := classList findFirst:#isText. + idx == 0 ifTrue:[ + "/ not found; select the first + idx := 1. + ]. receiversMethodEntryInClass := classList detect:#isText ifNone:nil. - receiversMethodEntryInClass notNil ifTrue:[ - self selectedClassOfResultHolder value:receiversMethodEntryInClass. - ] ifFalse:[ - self selectedClassOfResultHolder value:(classList first). - ]. - self selectedClassOfResultHolderChanged. + self selectedClassOfResultIndexHolder value:idx. + self selectedClassOfResultIndexHolderChanged. ] ifFalse:[ - self selectedClassOfResultHolder value:nil. + self selectedClassOfResultIndexHolder value:nil. ]. "Modified (comment): / 24-06-2012 / 18:41:45 / cg" @@ -1399,7 +1358,7 @@ updateListAfterPatternSearch:resultList |searchPattern idx| - self classOfResultHolder value:nil. + self classOfResultListHolder value:nil. self codeHolder value:nil. self resultHolder value:resultList. @@ -1488,14 +1447,25 @@ ^ argCountList. ! -classOfResultHolder +classOfResultListHolder "Return a valueHolder which contains a collection with the names of the implementors of a specific message. " - classOfResultHolder isNil ifTrue:[ - classOfResultHolder := ValueHolder new. + classOfResultListHolder isNil ifTrue:[ + classOfResultListHolder := ValueHolder new. ]. - ^ classOfResultHolder + ^ classOfResultListHolder +! + +classOfResultNameListHolder + "Return a valueHolder which contains a collection with the names of the + implementors of a specific message with cateogy. + This is shown in the list view" + + classOfResultNameListHolder isNil ifTrue:[ + classOfResultNameListHolder := ValueHolder new. + ]. + ^ classOfResultNameListHolder ! codeHolder @@ -1536,13 +1506,13 @@ } ! -selectedClassOfResultHolder +selectedClassOfResultIndexHolder "valueHolder which contains the index of the selected result class (right list)" - selectedClassOfResultHolder isNil ifTrue:[ - selectedClassOfResultHolder := ValueHolder new. + selectedClassOfResultIndexHolder isNil ifTrue:[ + selectedClassOfResultIndexHolder := ValueHolder new. ]. - ^ selectedClassOfResultHolder + ^ selectedClassOfResultIndexHolder "Modified (comment): / 21-09-2012 / 11:10:29 / cg" ! @@ -1572,8 +1542,8 @@ !MethodFinderWindow methodsFor:'controlInput'! cleanInputs:aDirtyString - "Find and remove common mistakes made by the user. Return the - 'aStringToBeCleaned' variable" + "Find and remove common mistakes made by the user. + Return the 'aStringToBeCleaned' variable" |aStringToBeCleaned rs position| @@ -1775,62 +1745,58 @@ !MethodFinderWindow methodsFor:'private'! +argStringAndValueFromEditorContents:editorContents + |associationKey associationValue| + + associationValue := Compiler + evaluate:editorContents + ifFail:[ + Dialog information:'Bad value in the answer field'. + AbortOperationRequest raise. + ]. + ((self isExpression:editorContents) or:[ associationValue isNil]) ifTrue:[ + "looks if an expression is typed in" + associationKey := associationValue printString + ] ifFalse:[ + associationKey := editorContents + ]. + ^ (associationKey -> associationValue). +! + argumentEditorsContents "Determine how many text editors of the arguments are used and store the result - as argCounter. The result being the minimum between how many editors have - expressions in and how many are displayed. + as argCounter. The result being the minimum between how many editors have + expressions in and how many are displayed. - Add each argument string (key)and the evaluated version (value) to an Ordered Dictionary - from each of the text editors. + Add each argument string (key)and the evaluated version (value) to an Ordered Dictionary + from each of the text editors. - Return the OrderedDictionary with the expressions from all the text editors. " + Return the OrderedDictionary with the expressions from all the text editors. " - | tempArguments argCounter tempArgument1Editor tempArgument2Editor tempArgument3Editor - associationKey associationValue| + | tempArguments argCounter + tempArgument1EditorContents tempArgument2EditorContents tempArgument3EditorContents | argCounter:=0. - tempArgument1Editor:= (self cleanInputs: argument1Editor contents). - tempArgument2Editor:= (self cleanInputs: argument2Editor contents). - tempArgument3Editor:= (self cleanInputs: argument3Editor contents). + tempArgument1EditorContents := (self cleanInputs: argument1Editor contents). + tempArgument2EditorContents := (self cleanInputs: argument2Editor contents). + tempArgument3EditorContents := (self cleanInputs: argument3Editor contents). - tempArgument1Editor = '' ifFalse:[argCounter:=argCounter +1]. - tempArgument2Editor = '' ifFalse:[argCounter:=argCounter +1]. - tempArgument3Editor = '' ifFalse:[argCounter:=argCounter +1]. + tempArgument1EditorContents = '' ifFalse:[argCounter := argCounter +1]. + tempArgument2EditorContents = '' ifFalse:[argCounter := argCounter +1]. + tempArgument3EditorContents = '' ifFalse:[argCounter := argCounter +1]. argCounter:= (argCounter min: (self argCountHolder value -1)). tempArguments:= OrderedDictionary new:argCounter. (argCounter value >= 1) ifTrue:[ - associationValue:= (Compiler evaluate: tempArgument1Editor). - ((self isExpression:tempArgument1Editor) or:[ associationValue isNil]) ifTrue:[ - "looks if an expression is typed in" - associationKey:=associationValue printString - ] ifFalse:[ - associationKey:=tempArgument1Editor - ]. - tempArguments add: associationKey-> associationValue. + tempArguments add:(self argStringAndValueFromEditorContents:tempArgument1EditorContents) ]. (argCounter value >= 2) ifTrue:[ - associationValue:= (Compiler evaluate: tempArgument2Editor). - (((self isExpression:tempArgument2Editor) or:[ associationValue isNil])) ifTrue:[ - "looks if an expression is typed in" - associationKey:=associationValue printString - ] ifFalse:[ - associationKey:=tempArgument2Editor - ]. - tempArguments add: associationKey-> associationValue + tempArguments add:(self argStringAndValueFromEditorContents:tempArgument2EditorContents) ]. - (argCounter value >= 3) ifTrue:[ - associationValue:= (Compiler evaluate: tempArgument3Editor). - ((self isExpression:tempArgument3Editor) or:[ associationValue isNil]) ifTrue:[ - "looks if an expression is typed in" - associationKey:=associationValue printString - ] ifFalse:[ - associationKey:=tempArgument3Editor - ]. - tempArguments add: associationKey-> associationValue + tempArguments add:(self argStringAndValueFromEditorContents:tempArgument3EditorContents) ]. @@ -1838,8 +1804,9 @@ ! extractClassAndSelectorFrom:anArgument - "Opens browser on theArgument of a specific class. anArgument being a string with the - Class and the selector upon which the browser is to be opened. Return the receiver." + "extracts the class and selector from a list entry, + which contains the classname and selector sep'd by a space. + Return an association" |aClass aSelector x theArgument marker| @@ -1859,20 +1826,25 @@ ]. ^ aClass -> aSelector asSymbol -" -MethodFinderWindow new extractClassAndSelectorFrom: '*SmallInteger +' -MethodFinderWindow new extractClassAndSelectorFrom: 'String ,' -MethodFinderWindow new extractClassAndSelectorFrom: 'Number detentBy:atMultiplesOf:snap:' - - -" + " + MethodFinderWindow new extractClassAndSelectorFrom: '*SmallInteger +' + MethodFinderWindow new extractClassAndSelectorFrom: 'String ,' + MethodFinderWindow new extractClassAndSelectorFrom: 'Number detentBy:atMultiplesOf:snap:' + " "Modified: / 27-04-2012 / 15:05:53 / cg" ! isExpression:aString "Return true or false depending on if the subString includes certain characters" - + + |tree| + + Error ignoreIn:[ + tree := Parser parseExpression:aString. + ^ tree isMessage + ]. + "/ cg: this is naive - why not ask the parser, if it is a literal? (aString includesSubString:': ') ifTrue:[ ^ true @@ -1916,18 +1888,20 @@ |aCleanedReceiverString compiledReceiver| aCleanedReceiverString := self cleanInputs:(receiverEditor contents). - "/ allow C-style integers - (aCleanedReceiverString startsWith:'0b') ifTrue:[ - aCleanedReceiverString := '2r',(aCleanedReceiverString withoutPrefix:'0b') - ] ifFalse:[ - (aCleanedReceiverString startsWith:'0x') ifTrue:[ - aCleanedReceiverString := '16r',(aCleanedReceiverString withoutPrefix:'0x') - ] ifFalse:[ - (aCleanedReceiverString startsWith:'0o') ifTrue:[ - aCleanedReceiverString := '8r',(aCleanedReceiverString withoutPrefix:'0o') - ]. - ]. - ]. + + "/ allow C-style integers +"/ (now supported by compiler) +"/ (aCleanedReceiverString startsWith:'0b') ifTrue:[ +"/ aCleanedReceiverString := '2r',(aCleanedReceiverString withoutPrefix:'0b') +"/ ] ifFalse:[ +"/ (aCleanedReceiverString startsWith:'0x') ifTrue:[ +"/ aCleanedReceiverString := '16r',(aCleanedReceiverString withoutPrefix:'0x') +"/ ] ifFalse:[ +"/ (aCleanedReceiverString startsWith:'0o') ifTrue:[ +"/ aCleanedReceiverString := '8r',(aCleanedReceiverString withoutPrefix:'0o') +"/ ]. +"/ ]. +"/ ]. compiledReceiver := Compiler evaluate:aCleanedReceiverString. ((self isExpression:aCleanedReceiverString) or:[ compiledReceiver isNil ]) ifTrue:[ aCleanedReceiverString := compiledReceiver printString @@ -1945,15 +1919,19 @@ !MethodFinderWindow methodsFor:'user actions'! -selectedClassOfResultHolderChanged - |sel classAndSelector mthd| +selectedClassOfResultIndexHolderChanged + |selIdx sel classAndSelector mthd| - sel := self selectedClassOfResultHolder value. + selIdx := self selectedClassOfResultIndexHolder value. + selIdx isNil ifTrue:[^ self]. + + sel := classOfResultListHolder value at:selIdx. classAndSelector := self extractClassAndSelectorFrom:sel. classAndSelector isNil ifTrue:[ ^ self ]. + mthd := classAndSelector key >> classAndSelector value. mthd notNil ifTrue:[ self withWaitCursorDo:[