Thank you for the feedback! Merged via Tools-ct.1150 + (ST80-ct.285 + Services-Base-ct.72 + Protocols-ct.84 + Monticello-ct.778 + 60Deprecated-ct.114). :-)<br>
<br>
Best,<br>
Christoph<br>
<br>
<font color="#808080">---<br>
</font><font color="#808080"><i>Sent from </i></font><font color="#808080"><i><a href="https://github.com/hpi-swa-lab/squeak-inbox-talk"><u><font color="#808080">Squeak Inbox Talk</font></u></a></i></font><br>
<br>
On 2022-04-08T09:50:19+02:00, marcel.taeumel@hpi.de wrote:<br>
<br>
> Hi Christoph --<br>
> <br>
> Looks good. Except for "some" -> "any":<br>
> <br>
> someTextPaneWithSelector: -> anyTextPaneWithSelector:<br>
> <br>
> <br>
> Just like we have in the Collection protocol.<br>
> <br>
> <br>
> Best,<br>
> Marcel<br>
> Am 05.04.2022 20:51:36 schrieb christoph.thiede at student.hpi.uni-potsdam.de <christoph.thiede at student.hpi.uni-potsdam.de>:<br>
> =============== Summary ===============<br>
> <br>
> Change Set:        toolCodePane<br>
> Date:            5 April 2022<br>
> Author:            Christoph Thiede<br>
> <br>
> Improves MVC compatibility for view accesses from model.<br>
> <br>
> * Moves up #someTextPaneWithSelector: & friends from StringHolder to Model and improves documentation on the antiidiomatic pattern they represent.<br>
> * Fixes 'run to selection' & 'tally it' button in MVC debugger.<br>
> * Improves MVC compatibility in Monticello save version dialog (still, showModally does not yet work, though.)<br>
> <br>
> =============== Diff ===============<br>
> <br>
> CodeHolder>>searchPane {categories & search pane} · ct 4/5/2022 20:19 (changed)<br>
> searchPane<br>
>     "Answer the search pane associated with the receiver in its window, or nil if none. Morphic only"<br>
> <br>
> -     ^ self textPaneWithSelector: #lastSearchString<br>
> +     | pane |<br>
> +     pane := self someTextPaneWithSelector: #lastSearchString.<br>
> +     ^ pane isMorph ifTrue: [pane]<br>
> <br>
> Debugger>>codePaneSelectionInterval {code pane} · ct 4/5/2022 19:50 (changed)<br>
> codePaneSelectionInterval<br>
> <br>
> -     ^ self codeTextMorph<br>
> +     ^ self codeTextPane<br>
>         ifNotNil: [:cp | cp selectionInterval]<br>
>         ifNil: [Interval from: 0 to: 0]<br>
> <br>
> Debugger>>getSelectedText {tally support} · ct 4/5/2022 19:50 (changed)<br>
> getSelectedText<br>
>     | m interval text |<br>
> -     m := self codeTextMorph ifNil: [^ ''].<br>
> +     m := self codeTextPane ifNil: [^ ''].<br>
>     interval := m selectionInterval.<br>
>     text := m text.<br>
>     ^ text copyFrom: interval first to: interval last<br>
>     <br>
> <br>
> Debugger>>tally {tally support} · ct 4/5/2022 19:46 (changed)<br>
> tally<br>
> <br>
> -     self codeTextMorph ifNotNil: [:o| o tallyIt] ifNil: [Beeper beep]<br>
> +     self codeTextPane ifNotNil: [:o | o tallyIt] ifNil: [Beeper beep]<br>
> <br>
> <br>
> MCSaveVersionDialog>>accept {actions} · ct 4/5/2022 19:57 (changed)<br>
> accept<br>
>     | logMessage logMessageWidget |<br>
>     self updateItems.<br>
> -     logMessage := (logMessageWidget := self findTextMorph: #logMessage) text asString.<br>
> +     logMessage := (logMessageWidget := self someTextPaneWithSelector: #logMessage) text asString.<br>
>     (logMessage isEmpty or: [logMessage beginsWith: 'empty log message'])<br>
>         ifTrue:<br>
> -             [(UIManager confirm: 'the log message is empty; are you sure you want to commit') ifFalse: [^ self]]<br>
> +             [(Project uiManager confirm: 'the log message is empty; are you sure you want to commit') ifFalse: [^ self]]<br>
>         ifFalse: [logMessageWidget accept].<br>
>     self answer: {<br>
> -         (self findTextMorph: #versionName) text asString.<br>
> +         (self someTextPaneWithSelector: #versionName) text asString.<br>
>         logMessage.<br>
>         ignore }<br>
> <br>
> MCSaveVersionDialog>>okToClose {actions} · ct 4/5/2022 19:57 (changed)<br>
> okToClose<br>
> -     ^ (self findTextMorph: #logMessage)<br>
> +     ^ (self someTextPaneWithSelector: #logMessage)<br>
>         ifNil: [true]<br>
>         ifNotNil:<br>
>             [:widget | widget canDiscardEdits or: [self confirm: 'Version notes are not saved.<br>
> Is it OK to discard those notes?' translated]]<br>
> <br>
> Model>>dependentTextPaneWithSelector: {*Tools-private} · ct 4/5/2022 19:42<br>
> + dependentTextPaneWithSelector: selector<br>
> +<br>
> +     ^ self dependents detect:<br>
> +         [:dependent | dependent isTextView and:<br>
> +             [dependent getTextSelector == selector]]<br>
> +         ifNone: [nil]<br>
> <br>
> Model>>someTextPaneWithSelector: {*Tools} · ct 4/5/2022 20:17<br>
> + someTextPaneWithSelector: aSelector<br>
> +     "Try to find the text pane for aSelector in my dependents or my window. Note that this is a hack only and violates the original idea of the model-view pattern. Usually, the communication should come from the view instead, e.g., via a pluggable selector."<br>
> +     ^ (self dependentTextPaneWithSelector: aSelector)<br>
> +         ifNil: [self textPaneWithSelector: aSelector]<br>
> <br>
> Model>>textPaneWithSelector: {*Tools-private} · mt 4/12/2015 19:45<br>
> + textPaneWithSelector: aSelector<br>
> +     "If, among my window's paneMorphs, there is a text pane defined with aSelector as its retriever, answer it, else answer nil"<br>
> +<br>
> +     | aWindow |<br>
> +     Smalltalk isMorphic ifFalse: [^ nil].<br>
> +     ^ (aWindow := self containingWindow) ifNotNil:<br>
> +         [aWindow paneMorphSatisfying:<br>
> +             [:aMorph | (aMorph isKindOf: PluggableTextMorph) and:<br>
> +                 [aMorph getTextSelector == aSelector]]]<br>
> <br>
> PluggableTextView>>tallyIt {as yet unclassified} · ct 4/5/2022 19:50<br>
> + tallyIt<br>
> +<br>
> +     self controller tallyIt.<br>
> <br>
> StringHolder>>codeTextMorph {*Tools} · ct 4/5/2022 20:16 (changed)<br>
> codeTextMorph<br>
> -     <br>
> -     ^ self someTextPaneWithSelector: #contents<br>
> +     "Find a Morphic text pane that displays the contents of the receiver. Note that this is a hack only and violates the original idea of the model-view pattern. Using this selector in your model will likely break compatibility with other UI frameworks such as MVC. Usually, the communication should come from the view instead, e.g., via a pluggable selector."<br>
> +<br>
> +     | textPane |<br>
> +     textPane := self codeTextPane.<br>
> +     ^ textPane isMorph ifTrue: [textPane]<br>
> <br>
> StringHolder>>codeTextPane {*Tools} · ct 4/5/2022 20:16<br>
> + codeTextPane<br>
> +     "Find a text pane that displays the contents of the receiver. Note that this is a hack only and violates the original idea of the model-view pattern. Usually, the communication should come from the view instead, e.g., via a pluggable selector."<br>
> +     <br>
> +     ^ self someTextPaneWithSelector: #contents<br>
> <br>
> StringHolder>>selectedInterval {*services-base} · ct 4/5/2022 19:46 (changed)<br>
> selectedInterval<br>
> -     ^self codeTextMorph selectionInterval<br>
> +     ^self codeTextPane selectionInterval<br>
> <br>
> StringHolderView>>accept {controller access} · ct 4/5/2022 19:59<br>
> + accept<br>
> +<br>
> +     ^ self controller accept<br>
> <br>
> StringHolderView>>text {controller access} · ct 4/5/2022 19:56<br>
> + text<br>
> +<br>
> +     ^ self displayContents text<br>
> <br>
> ["toolCodePane.2.cs"]<br>
> <br>
> ---<br>
> Sent from Squeak Inbox Talk [https://github.com/hpi-swa-lab/squeak-inbox-talk]<br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220408/5d240c55/attachment-0001.html><br>
> <br>