# HG changeset patch # User Claus Gittinger # Date 1462341119 -7200 # Node ID 2902c1233b4eb0712f2f27b44819d7219001a873 # Parent 4edb3ebfe446223f9578e0c4d13bed95686bf321 #UI_ENHANCEMENT by cg class: MethodFinderWindow added: #openOnSelectorPattern: changed: #resultHolder #resultInfoText #windowSpec diff -r 4edb3ebfe446 -r 2902c1233b4e MethodFinderWindow.st --- a/MethodFinderWindow.st Sun May 01 23:15:35 2016 +0200 +++ b/MethodFinderWindow.st Wed May 04 07:51:59 2016 +0200 @@ -58,299 +58,297 @@ ^ - #(FullSpec - name: windowSpec - window: - (WindowSpec - label: 'MethodFinder' - name: 'MethodFinder' - bounds: (Rectangle 0 0 798 595) - menu: menu - icon: defaultIcon - ) - component: - (SpecCollection - collection: ( - (VariableHorizontalPanelSpec - name: 'VariableHorizontalPanel1' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - snapMode: both - component: - (SpecCollection - collection: ( - (ViewSpec - name: 'LeftBox' - level: 1 - component: - (SpecCollection - collection: ( - (ViewSpec - name: 'ReceiverArgBox' - layout: (LayoutFrame 0 0 0 0 0 1 -100 0.5) - component: - (SpecCollection - collection: ( - (LabelSpec - label: 'Receiver' - name: 'ReceiverLabel' - layout: (LayoutFrame 0 0 0 0 0 0.34 24 0) - translateLabel: true - ) - (ComboListSpec - name: 'allowedArgments' - layout: (LayoutFrame 0 0.34 1 0 0 0.64 23 0) - model: argCountHolder - comboList: argCountList - useIndex: true - ) - (LabelSpec - label: 'Answer' - name: 'MessageAnswerLabel' - layout: (LayoutFrame 0 0.64 0 0 0 1 24 0) - translateLabel: true - ) - (HorizontalPanelViewSpec - name: 'HorizontalPanel1' - layout: (LayoutFrame 0 0 25 0 0 1 0 1) - horizontalLayout: fit - verticalLayout: fit - horizontalSpace: 3 - verticalSpace: 3 - component: - (SpecCollection - collection: ( - (WorkspaceSpec - name: 'ReceiverEditor' - tabable: true - hasHorizontalScrollBar: true - hasVerticalScrollBar: true - miniScrollerHorizontal: true - miniScrollerVertical: true - autoHideScrollBars: true - hasKeyboardFocusInitially: false - extent: (Point 113 172) - postBuildCallback: receiverWidgetCreated: - ) - (VerticalPanelViewSpec - name: 'VerticalPanel1' - horizontalLayout: fit - verticalLayout: fit - horizontalSpace: 3 - verticalSpace: 3 - component: - (SpecCollection - collection: ( - (ViewSpec - name: 'Box1' - visibilityChannel: arg1BoxVisible - component: - (SpecCollection - collection: ( - (WorkspaceSpec - name: 'Arg1Editor' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - tabable: true - hasHorizontalScrollBar: true - hasVerticalScrollBar: true - miniScrollerHorizontal: true - miniScrollerVertical: true - autoHideScrollBars: true - hasKeyboardFocusInitially: false - postBuildCallback: argument1WidgetCreated: - ) + #(FullSpec + name: windowSpec + window: + (WindowSpec + label: 'MethodFinder' + name: 'MethodFinder' + bounds: (Rectangle 0 0 920 690) + menu: menu + icon: defaultIcon + ) + component: + (SpecCollection + collection: ( + (VariableHorizontalPanelSpec + name: 'VariableHorizontalPanel1' + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) + snapMode: both + component: + (SpecCollection + collection: ( + (ViewSpec + name: 'LeftBox' + level: 1 + component: + (SpecCollection + collection: ( + (ViewSpec + name: 'ReceiverArgBox' + layout: (LayoutFrame 0 0 0 0 0 1 -100 0.5) + component: + (SpecCollection + collection: ( + (LabelSpec + label: 'Receiver' + name: 'ReceiverLabel' + layout: (LayoutFrame 0 0 0 0 0 0.34000000000000002 28 0) + translateLabel: true + ) + (ComboListSpec + name: 'allowedArgments' + layout: (LayoutFrame 0 0.34000000000000002 1 0 0 0.64000000000000012 28 0) + model: argCountHolder + comboList: argCountList + useIndex: true + ) + (LabelSpec + label: 'Answer' + name: 'MessageAnswerLabel' + layout: (LayoutFrame 0 0.64000000000000012 0 0 0 1 28 0) + translateLabel: true + ) + (HorizontalPanelViewSpec + name: 'HorizontalPanel1' + layout: (LayoutFrame 0 0 30 0 0 1 0 1) + horizontalLayout: fit + verticalLayout: fit + horizontalSpace: 3 + verticalSpace: 3 + component: + (SpecCollection + collection: ( + (WorkspaceSpec + name: 'ReceiverEditor' + tabable: true + hasHorizontalScrollBar: true + hasVerticalScrollBar: true + miniScrollerHorizontal: true + miniScrollerVertical: true + autoHideScrollBars: true + hasKeyboardFocusInitially: false + extent: (Point 110 214) + postBuildCallback: receiverWidgetCreated: + ) + (VerticalPanelViewSpec + name: 'VerticalPanel1' + horizontalLayout: fit + verticalLayout: fit + horizontalSpace: 3 + verticalSpace: 3 + component: + (SpecCollection + collection: ( + (ViewSpec + name: 'Box1' + visibilityChannel: arg1BoxVisible + component: + (SpecCollection + collection: ( + (WorkspaceSpec + name: 'Arg1Editor' + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) + tabable: true + hasHorizontalScrollBar: true + hasVerticalScrollBar: true + miniScrollerHorizontal: true + miniScrollerVertical: true + autoHideScrollBars: true + hasKeyboardFocusInitially: false + postBuildCallback: argument1WidgetCreated: ) - - ) - extent: (Point 114 55) - ) - (ViewSpec - name: 'Box2' - visibilityChannel: arg2BoxVisible - component: - (SpecCollection - collection: ( - (WorkspaceSpec - name: 'TextEditor5' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - tabable: true - hasHorizontalScrollBar: true - hasVerticalScrollBar: true - miniScrollerHorizontal: true - miniScrollerVertical: true - autoHideScrollBars: true - hasKeyboardFocusInitially: false - postBuildCallback: argument2WidgetCreated: - ) + ) + + ) + extent: (Point 110 69) + ) + (ViewSpec + name: 'Box2' + visibilityChannel: arg2BoxVisible + component: + (SpecCollection + collection: ( + (WorkspaceSpec + name: 'TextEditor5' + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) + tabable: true + hasHorizontalScrollBar: true + hasVerticalScrollBar: true + miniScrollerHorizontal: true + miniScrollerVertical: true + autoHideScrollBars: true + hasKeyboardFocusInitially: false + postBuildCallback: argument2WidgetCreated: ) - - ) - extent: (Point 114 56) - ) - (ViewSpec - name: 'Box3' - visibilityChannel: arg3BoxVisible - component: - (SpecCollection - collection: ( - (WorkspaceSpec - name: 'TextEditor6' - layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) - tabable: true - hasHorizontalScrollBar: true - hasVerticalScrollBar: true - miniScrollerHorizontal: true - miniScrollerVertical: true - autoHideScrollBars: true - hasKeyboardFocusInitially: false - postBuildCallback: argument3WidgetCreated: - ) + ) + + ) + extent: (Point 110 70) + ) + (ViewSpec + name: 'Box3' + visibilityChannel: arg3BoxVisible + component: + (SpecCollection + collection: ( + (WorkspaceSpec + name: 'TextEditor6' + layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) + tabable: true + hasHorizontalScrollBar: true + hasVerticalScrollBar: true + miniScrollerHorizontal: true + miniScrollerVertical: true + autoHideScrollBars: true + hasKeyboardFocusInitially: false + postBuildCallback: argument3WidgetCreated: ) - - ) - extent: (Point 114 55) - ) + ) + + ) + extent: (Point 110 69) ) - - ) - extent: (Point 114 172) - ) - (WorkspaceSpec - name: 'AnswerEditor' - tabable: true - hasHorizontalScrollBar: true - hasVerticalScrollBar: true - miniScrollerHorizontal: true - miniScrollerVertical: true - autoHideScrollBars: true - hasKeyboardFocusInitially: false - extent: (Point 114 172) - postBuildCallback: messageAnswerWidgetCreated: - ) + ) + + ) + extent: (Point 110 214) + ) + (WorkspaceSpec + name: 'AnswerEditor' + tabable: true + hasHorizontalScrollBar: true + hasVerticalScrollBar: true + miniScrollerHorizontal: true + miniScrollerVertical: true + autoHideScrollBars: true + hasKeyboardFocusInitially: false + extent: (Point 110 214) + postBuildCallback: messageAnswerWidgetCreated: ) - - ) - ) + ) + + ) + ) + ) + + ) + ) + (ViewSpec + name: 'ReceiverArgBoxActionBox' + layout: (LayoutFrame 0 0 -98 0.5 0 1 -75 0.5) + component: + (SpecCollection + collection: ( + (ActionButtonSpec + label: 'Clear' + name: 'Button2' + layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1) + translateLabel: true + model: clear ) - - ) - ) - (ViewSpec - name: 'ReceiverArgBoxActionBox' - layout: (LayoutFrame 0 0 -98 0.5 0 1 -75 0.5) - component: - (SpecCollection - collection: ( - (ActionButtonSpec - label: 'Clear' - name: 'Button2' - layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1) - translateLabel: true - model: clear - ) - (ActionButtonSpec - label: 'Search' - name: 'Button1' - layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1) - translateLabel: true - tabable: true - model: search - ) + (ActionButtonSpec + label: 'Search' + name: 'Button1' + layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1) + translateLabel: true + tabable: true + model: search + ) + ) + + ) + ) + (ViewSpec + name: 'MatchActionBox' + layout: (LayoutFrame 0 0 -70 0.5 0 1 -20 0.5) + component: + (SpecCollection + collection: ( + (LabelSpec + label: 'Selector Pattern:' + name: 'Label1' + layout: (LayoutFrame 0 0 0 0 0 0.5 25 0) + translateLabel: true + adjust: left ) - - ) - ) - (ViewSpec - name: 'MatchActionBox' - layout: (LayoutFrame 0 0 -70 0.5 0 1 -20 0.5) - component: - (SpecCollection - collection: ( - (LabelSpec - label: 'Selector Pattern:' - name: 'Label1' - layout: (LayoutFrame 0 0 0 0 0 0.5 25 0) - translateLabel: true - adjust: left - ) - (InputFieldSpec - name: 'EntryField1' - layout: (LayoutFrame 0 0 -25 1 0 0.5 -5 1) - model: selectorPattern - immediateAccept: true - acceptOnReturn: true - acceptOnTab: true - acceptOnPointerLeave: true - ) - (ActionButtonSpec - label: 'Search' - name: 'Button4' - layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1) - translateLabel: true - tabable: true - model: searchPatternMatchesInBackground - ) + (InputFieldSpec + name: 'EntryField1' + layout: (LayoutFrame 0 0 -25 1 0 0.5 0 1) + model: selectorPattern + immediateAccept: true + acceptOnReturn: true + acceptOnTab: true + acceptOnPointerLeave: true + ) + (ActionButtonSpec + label: 'Search' + name: 'Button4' + layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1) + translateLabel: true + tabable: true + model: searchPatternMatchesInBackground ) - - ) - ) - (SequenceViewSpec - name: 'ResultList' - layout: (LayoutFrame 0 0 -15 0.5 0 1 0 1) - model: selectedImplementorsHolder - menu: resultListMenu - hasHorizontalScrollBar: true - hasVerticalScrollBar: true - autoHideScrollBars: true - valueChangeSelector: updateImplementorsOf: - useIndex: true - sequenceList: resultHolder - ) + ) + + ) + ) + (SequenceViewSpec + name: 'ResultList' + layout: (LayoutFrame 0 0 -15 0.5 0 1 0 1) + model: selectedImplementorsHolder + menu: resultListMenu + hasHorizontalScrollBar: true + hasVerticalScrollBar: true + autoHideScrollBars: true + valueChangeSelector: updateImplementorsOf: + useIndex: true + sequenceList: resultHolder ) - - ) - ) - (VariableVerticalPanelSpec - name: 'VariableVerticalPanel1' - component: - (SpecCollection - collection: ( - (SequenceViewSpec - name: 'List2' - model: selectedClassOfResultHolder - menu: implementorListMenu - hasHorizontalScrollBar: true - hasVerticalScrollBar: true - autoHideScrollBars: true - doubleClickSelector: openBrowserOn: - valueChangeSelector: selectedClassOfResultHolderChanged - useIndex: false - sequenceList: classOfResultHolder - ) - (CodeViewSpec - name: 'CodeView' - model: codeHolder - hasHorizontalScrollBar: true - hasVerticalScrollBar: true - autoHideScrollBars: true - hasKeyboardFocusInitially: false - postBuildCallback: sourceCodeWidgetCreated: - ) + ) + + ) + ) + (VariableVerticalPanelSpec + name: 'VariableVerticalPanel1' + component: + (SpecCollection + collection: ( + (SequenceViewSpec + name: 'List2' + model: selectedClassOfResultHolder + menu: implementorListMenu + hasHorizontalScrollBar: true + hasVerticalScrollBar: true + autoHideScrollBars: true + doubleClickSelector: openBrowserOn: + valueChangeSelector: selectedClassOfResultHolderChanged + useIndex: false + sequenceList: classOfResultHolder ) - - ) - handles: (Any 0.5 1.0) - ) + (CodeViewSpec + name: 'CodeView' + model: codeHolder + hasHorizontalScrollBar: true + hasVerticalScrollBar: true + autoHideScrollBars: true + hasKeyboardFocusInitially: false + postBuildCallback: sourceCodeWidgetCreated: + ) + ) + + ) + handles: (Any 0.5 1.0) ) - - ) - handles: (Any 0.443786982248521 1.0) - ) + ) + + ) + handles: (Any 0.37391304347826088 1.0) ) - - ) - ) - - "Modified: / 21-09-2012 / 11:09:44 / cg" + ) + + ) + ) ! ! !MethodFinderWindow class methodsFor:'menu specs'! @@ -480,6 +478,22 @@ "Created: / 21-09-2012 / 11:05:15 / cg" ! ! +!MethodFinderWindow class methodsFor:'startup'! + +openOnSelectorPattern:selector + |app| + + app := self new. + app allButOpen. + app selectorPattern value:selector. + app openWindow. + ^ app + + " + self openOnSelectorPattern:'asLowercase' + " +! ! + !MethodFinderWindow methodsFor:'accessing'! receiver @@ -1016,7 +1030,7 @@ (holder := builder bindingAt:#resultHolder) isNil ifTrue:[ holder := ValueHolder new. builder aspectAt:#resultHolder put:holder. - holder value:self resultInfoText. + holder value:(self resultInfoText collect:[:l | l withColor:Color darkGrey]). ]. ^ holder. @@ -1029,7 +1043,8 @@ ' ',('receiver, arg and result' allBold) . 'or a'. ' ',('selector search pattern' allBold) . - 'into the above fields, then click on either ',('"search"' allBold),'-button.' + 'into the above fields.' . + 'Then click on either ',('"search"' allBold),'-button.' } !