Skip to content

Commit

Permalink
Method Refactorings at the Category Level. Thanks Lisandro.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvuletich committed Nov 27, 2024
1 parent 7d57413 commit 1850db3
Show file tree
Hide file tree
Showing 2 changed files with 314 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
'From Cuis7.1 [latest update: #6858] on 27 November 2024 at 11:14:11 am'!

!SystemDictionary methodsFor: 'code authors' stamp: 'jmv 11/27/2024 11:13:17'!
knownInitialsAndNames
"This list could include people who hasn't contributed code to the Cuis image, but to some optional package."
"
| all ok |
all := Smalltalk allContributors asSet.
ok := (Smalltalk knownInitialsAndNames collect: [ :pair | pair first ]) asSet.
(all copyWithoutAll: ok) print
initials name"
^ #(
#('ab' 'Alexandre Bergel')
#('abc' 'Colin Putney')
#('acg' 'Andrew C. Greenberg')
#('ads' 'Adam Spitz')
#('AFi' 'Alain Fischer')
#('ajh' 'Anthony Hannan')
#('al' 'Adrian Lienhard')
#('and' 'Alan Dao')
#('aoy' 'Andres Otaduy')
#('apb' 'Andrew P. Black')
#('ar' 'Andreas Raab')
#('asm' 'Alejandro Magistrello')
#('avi' 'Avi Bryant')
#('AY' 'Angel Yan')
#('BAP' 'Barry Perryman')
#('BenComan' 'Ben Coman')
#('bf' 'Bert Freudenberg')
#('BG' 'Boris Gaertner')
#('bgs' 'Boris G. Shingarov')
#('BJP' 'Bijan Parsia')
#('bkv' 'Brent Vukmer')
#('bolot' 'Bolot Kerimbaev')
#('bp' 'Bernhard Pieber')
#('BP' 'Brent Pinkney')
#('brp' 'Brent Pinkney')
#('CAP' 'Cristián Abel Pérez')
#('cbc' 'Chris Cunningham')
#('cbr' 'Casey Ransberger')
#('ccn' 'Chris Norton')
#('chaider' 'Christian Haider')
#('cmm' 'Chris Muller')
#('crl' 'Craig Latta')
#('cwp' 'Colin Putney')
#('das' 'David A Smith')
#('db' 'Douglas Brebner')
#('dc' 'Damien Cassou')
#('dew' 'Doug Way')
#('DF' 'David Faitelson')
#('dgd' 'Diego Gomez Deck')
#('dhn' 'Dan Norton')
#('dhhi' 'Dan Ingalls')
#('di' 'Dan Ingalls')
#('djp' 'David J. Pennell')
#('dkh' 'Dale Henrichs')
#('DKL' 'Daniel K Lyons')
#('DM' 'Duncan Mak')
#('DSG' 'David Graham')
#('DSM' 'Duane Maxwell')
#('dtl' 'Dave Lewis')
#('dvf' 'Daniel Vainsencher')
#('eat' 'Eric Arseneau Tremblay')
#('EB' 'Eric Brandwein')
#('eem' 'Eliot Emilio Miranda')
#('eliot' 'Eliot Emilio Miranda')
#('efc' 'Eddie Cottongim')
#('em' 'Ernest Micklei?')
#('emm' 'Ernest Micklei')
#('Ez3' 'Ezequiel Birman')
#('fbs' 'Frank Shearar')
#('FBS' 'Frank Shearar')
#('fc' 'Frank Caggiano')
#('fcs' 'Frank Sergeant')
#('FernandoOlivero' 'Fernando Olivero')
#('FernanodOlivero' 'Fernando Olivero')
#('FGJ' 'Fernando Gasperi Jabalera')
#('fgz' 'Felipe Zak')
#('FJG' 'Facundo Javier Gelatti')
#('GabrielOmarCotelli' 'Gabriel Omar Cotelli')
#('GC' 'Gastón Caruso')
#('gera' 'Gerardo Richarte')
#('gh' 'Goran Krampe (nee Hultgren)')
#('gk' 'Goran Krampe (nee Hultgren)')
#('gm' 'German Morales')
#('go' 'Georg Gollmann')
#('gsa' 'German Arduino')
#('HAW' 'Hernan Wilkinson')
#('HB' 'Hari Balaraman')
#('hjh' 'Hannes Hirzel')
#('hlsf' 'Hilaire Fernandes')
#('hmm' 'Hans-Martin Mosner')
#('hsj' 'Henrik Sperre Johansen')
#('Igor.Stasenko' 'Igor Stasenko')
#('ikp' 'Ian Piumarta')
#('jar' 'Jaromir Matas')
#('Jb' 'Jean Baptiste Arnaud')
#('jcg' 'Joshua Gargus')
#('JCM' 'Juan Cruz Montero')
#('jdr' 'Javier Diaz-Reinoso')
#('je' 'Joern Eyrich')
#('jf' 'Julian Fitzell')
#('JF' 'Julian Fitzell')
#('jfr' 'Jon Raiford')
#('jhm' 'John Maloney')
#('jk' 'Jonathan Kelly')
#('jlb' 'Jim Benson')
#('jm' 'John Maloney')
#('jmb' 'Hans Baveco')
#('JMG' 'Jeff Gonis')
#('JMM' 'John McIntosh')
#('jmv' 'Juan Vuletich')
#('JMV' 'Juan Vuletich')
#('JO' 'Javier Olaechea')
#('jp' 'Joseph Pelrine')
#('jrm' 'John-Reed Maffeo')
#('jrp' 'John Pierce')
#('jsp' 'Jeff Pierce')
#('kdpm' 'Kevin Pérez Machado')
#('KenD' 'Ken Dickey')
#('kfr' 'Karl Ramberg')
#('KLC' 'Ken Causey')
#('KLG' 'Gerald Klix')
#('kph' 'Keith Hodges')
#('KTT' 'Kurt Thams')
#('laza' 'Alexander Lazarevic')
#('LC' 'Leandro Caniglia')
#('L C' 'Lisandro Córdoba')
#('len' 'Luciano Esteban Notarfrancesco')
#('lpc' 'Laura Perez Cerrato')
#('lr' 'Lukas Renggli')
#('Lukas Renggli' 'Lukas Renggli')
#('ls' 'Lex Spoon')
#('md' 'Marcus Denker')
#('MarcusDenker' 'Marcus Denker')
#('marcus.denker' 'Marcus Denker')
#('mdr' 'Mike Rutenberg')
#('MEGL' 'MarceloLamperti')
#('mga' 'Markus Galli')
#('MGD' 'Matías Dinota')
#('MH' 'Matías Halperin')
#('mha' 'Michael Haupt')
#('mir' 'Michael Rueger')
#('mjg' 'Mark Guzdial')
#('mk' 'Matej Kosik')
#('MM' 'Mariano Montone')
#('mnqpr' 'Szabolcs Komaromi')
#('MPH' 'Michael Hewner')
#('mpw' 'Marcel Weiher')
#('MPW' 'Marcel Weiher')
#('mrm' 'Martin McClure')
#('mtf' 'Matthew Fulmer')
#('mu' 'Masashi Umezawa')
#('nb' 'Naala Brewer')
#('nice' 'Nicolas Cellier')
#('nk' 'Ned Konz')
#('NM' 'Nicola Mingotti')
#('NMS' 'Nicolás Sarfati')
#('nop' 'Jay Carlson')
#('NS' 'Nathanael Schaerli')
#('ovv' 'Octavio Valentín Vives')
#('panda' 'Michael Rueger')
#('pau' 'Paula Perez Bianchi')
#('pb' 'Phil Bellalouna')
#('PB' 'Paolo Belforte')
#('PHK' 'Peter Keeler')
#('pmon' 'Paolo Montrasi')
#('PM' 'Peter Mikkelsen')
#('Pmm' 'Philippe Marschall')
#('pnm' 'Paul McDonough')
#('r++' 'Gerardo Richarte')
#('raa' 'Bob Arning')
#('RAA' 'Bob Arning')
#('raok' 'Richard A. O''Keefe')
#('rca' 'Russell Allen')
#('reThink' 'Paul McDonough')
#('rew' 'Roger Whitney')
#('rhi' 'Robert Hirschfeld')
#('RJT' 'Ron Teitelbaum')
#('RMV' 'R. Mark Volkmann')
#('RNG' 'Nahuel Garbezza')
#('rr' 'Romain Robbes')
#('rss' 'Ron Spengler')
#('rw' 'Robert Withers')
#('rww' 'Robert Withers')
#('Sames' 'Samuel S. Shuster')
#('sbw' 'Stephan B. Wessels')
#('sd' 'Stephane Ducasse')
#('SD' 'Stephane Ducasse')
#('sge' 'Steve Elkins')
#('sjd' 'Santiago Jose Dandois')
#('SLD' 'Steve Davies')
#('sma' 'Stefan Matthias Aust')
#('sps' 'Steven Swerling')
#('SqR' 'Andres Valloud')
#('sqr' 'Andres Valloud')
#('Squeak1.0' 'Squeak 1.0, September 20, 1996')
#('Squeak1.1' 'Squeak 1.1, September 23, 1996')
#('Squeak1.2' 'Squeak 1.2, June 29, 1997')
#('Squeak1.3' 'Squeak 1.3, January 16, 1998')
#('sr' 'Stephan Rudlof')
#('ss' 'Sebastian Sujarchuk')
#('SSC' 'Santiago Salvador Cubino')
#('SSS' 'Samuel S. Shuster')
#('ST-80' 'Smalltalk-80, version 2, of April 1, 1983')
#('stephane.ducasse' 'Stephane Ducasse')
#('stephaneducasse' 'Stephane Ducasse')
#('stp' 'Stephen Travis Pope')
#('sumim' 'Masato Sumi')
#('S.V.' 'Sebastián M. Vintoñuke')
#('svc' 'Sven Van Caekenberghe')
#('svp' 'Stephen Vincent Pair')
#('sw' 'Scott Wallace')
#('TAG' 'Travis Griggs')
#('tak' 'Takashi Yamamiya')
#('tao' 'Tim Olson')
#('TBn' 'Torsten Bergmann')
#('tfei' 'The Fourth Estate, Inc.')
#('tfel' 'Tim Felgentreff')
#('th' 'Torge Husfeldt')
#('tk' 'Ted Kaehler')
#('tlk' 'Tom Koenig')
#('tpr' 'Tim Rowledge')
#('TPR' 'Tim Rowledge')
#('TS' 'Tomás Spognardi')
#('tsl' 'Thiago da Silva Lino')
#('tween' 'Andy Tween')
#('ul' 'Levente Uzonyi')
#('vb' 'Vassili Bykov')
#('VGF' 'Gabriel Fierro')
#('ward' 'Ward Cunningham')
#('wiz' 'Jerome Peace')
#('wod' 'Bill Dargel')
#('yo' 'Yoshiki Ohshima')
#('zz' 'Serge Stinckwich'))! !
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
'From Cuis7.1 [latest update: #6859] on 27 November 2024 at 11:30:36 am'!

!Browser methodsFor: 'refactorings - category' stamp: 'L C 11/19/2024 18:14:33'!
addCategoryAsSubclassResponsibilitySelectors


| methodsOfCategory |

methodsOfCategory := self messageList.

methodsOfCategory do: [ :selectedSelector | selectedSelector ifNotNil:
[(AddAsSubclassResponsibilityApplier on: self for: self selectedClassOrMetaClass>>selectedSelector) value ]
].! !

!Browser methodsFor: 'refactorings - category' stamp: 'L C 11/19/2024 18:24:23'!
pushDownCategorySelectorsToOneSubclass

self messageList do: [ :selectedSelector | selectedSelector ifNotNil:
[(PushDownMethodToOneSubclassApplier on: self for: self selectedClassOrMetaClass>>selectedSelector) value ]
].

self removeMessageCategory.! !

!Browser methodsFor: 'refactorings - category' stamp: 'L C 11/19/2024 18:24:03'!
pushDownCategorySelectorsToSubclasses

self messageList do: [ :selectedSelector | selectedSelector ifNotNil:
[(PushDownMethodToSubclassesApplier on: self for: self selectedClassOrMetaClass>>selectedSelector) value]
].

self removeMessageCategory.
! !

!Browser methodsFor: 'refactorings - category' stamp: 'L C 11/19/2024 18:14:54'!
pushUpCategorySelectors

| methodsOfCategory |

methodsOfCategory := self messageList.

methodsOfCategory do: [:selectedSelector | (PushUpMethodApplier on: self for: self selectedClassOrMetaClass>>selectedSelector) value ].

self removeMessageCategory
! !


!BrowserWindow methodsFor: 'menu & kbd shortcuts' stamp: 'L C 11/27/2024 11:23:31'!
messageCatListMenuSpec
"Spec for the menu and shortcut keys for the method categories list.
See coment at Morph >> #getMenu
"
^#(
#(0 'Message Categories' false)
#(5 'Browse Package (p)' $p window browsePackage packageIcon)
#(6 '-----')
#(10 'File Out (o)' $o model fileOutMessageCategories fileOutIcon)
#(20 '-----')
#(30 'Reorganize (r)' $r model editMessageCategories sendReceiveIcon)
#(40 'Alphabetize (a)' $a model alphabetizeMessageCategories fontXGenericIcon)
#(50 'Remove empty Categories (e)' $e model removeEmptyCategories listRemoveIcon)
#(60 'Categorize all Uncategorized (c)' $c model categorizeAllUncategorizedMethods packageIcon)
#(70 'New Category... (n)' $n model addCategory newIcon)
#(80 'New extension Category... (N)' $N model addExtensionCategory listAddIcon)
#(90 '-----')
#(100 'Refactorings' nil nil 1000 listAddIcon)
#(110 'Rename... (R)' $R model renameCategory saveAsIcon)
#(120 'Remove (x)' $x model removeMessageCategory deleteIcon)
#(130 '-----')
#(140 'Run Tests (t)' $t model runMessageCategoryTests weatherFewCloudsIcon)
" 'Refactorings' SubMenu"
#(1010 'Push Up' nil model pushUpCategorySelectors goTopIcon)
#(1020 'Add in Superclass as subclassResponsibility' nil model addCategoryAsSubclassResponsibilitySelectors goTopIcon)
#(1030 'Push down to subclasses' nil model pushDownCategorySelectorsToSubclasses goBottomIcon)
#(1040 'Push down to one subclass' nil model pushDownCategorySelectorsToOneSubclass goBottomIcon)
)! !

0 comments on commit 1850db3

Please sign in to comment.