From VisualWorks®, 7.6 of February 8, 2008 on March 3, 2008 at 9:43:41 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>MultiBrowserNavigator</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.BrowserNavigator</super> <private>false</private> none environmentDictionary environmentList <imports></imports> <category>Browser-Navigator</category> <attributes> <package>Browser-SmalllintUI</package> </attributes> </class> <comment> Refactory.Browser.MultiBrowserNavigator
MultiBrowserNavigator is a special navigator for browsing certain Smalllint results (e.g., methods defined in all subclasses but not in superclass). These results normally have a description string and the list of method for that description, instead of just a list of methods. Instance Variables: environmentDictionary <MultiEnvironment> the environment for this navigator environmentList <SelectionInList> the keys of the multi-environment
</comment> <class> <name>Smalllint</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.BrowserApplicationModel</super> <private>false</private> none percentDone checkerProcess environmentEditor menuHolder ruleHolder checker <imports></imports> <category>Browser-Lint</category> <attributes> <package>Browser-SmalllintUI</package> </attributes> </class> <comment> Refactory.Browser.Smalllint
Smalllint was the primary UI for running lint rules. However, it has been superceded by the Smalllint code tool. It is now only used for running a lint rule without opening a browser. Instance Variables: checker <SmalllintChecker> the object that is used to run the individual rules checkerProcess <Process> the process that is checking all rules environmentEditor <EnvironmentEditor> the editor UI that allows the user to pick which classes that are to be run over menuHolder <ValueModel> the menu of available lint rules percentDone <ValueModel> percent done of the lint rule checking process ruleHolder <ValueModel> the selected lint rule
</comment> <class> <name>SmalllintResultEditor</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.BrowserApplicationModel</super> <private>false</private> none label results resultsList <imports></imports> <category>Browser-Lint</category> <attributes> <package>Browser-SmalllintUI</package> </attributes> </class> <comment> Refactory.Browser.SmalllintResultEditor
SmalllintResultEditor is a UI for displaying a list of Smalllint rule failures. Instance Variables: label <String> the label of the window results <Collection> the collection of lint rules that have failures resultsList <SelectionInList> the selection in list of rules that have failures.
</comment> <class> <name>SmalllintCodeTool</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.CodeTool</super> <private>false</private> none lintRuleList transformationList percentDoneHolder actionHolder checkerProcess isTransformationRule <imports></imports> <category>Browser-Code Tools</category> <attributes> <package>Browser-SmalllintUI</package> </attributes> </class> <comment> Refactory.Browser.SmalllintCodeTool
SmalllintCodeTool is a code tool for Smalllint.. Instance Variables: actionHolder <ValueModel> a description of what it is doing checkerProcess <Process> the process that is running the lint checks isTransformationRule <Boolean> are we showing the transformation rules or lint rules lintRuleList <MultiSelectionInTree> the list of lint rules percentDoneHolder <ValueModel> percent done for the lint rule transformationList <SelectionInList> the list of tranformation lint rules
</comment> <class> <name>RewriteCodeTool</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.SmalllintCodeTool</super> <private>false</private> none originalCode newCode method <imports></imports> <category>Browser-Code Tools</category> <attributes> <package>Browser-SmalllintUI</package> </attributes> </class> <comment> Refactory.Browser.RewriteCodeTool
RewriteCodeTool integrates the rewrite tool into the RB. It allows one to perform rewrites on the selected objects. Instance Variables: method <ValueModel> should we treat the search and replace expressions as methods newCode <ValueModel> the replace expression originalCode <ValueModel> the search expression rewriteRuleEditor <RewriteRuleEditor> the rewrite rule editor UI
</comment> <name>RuleSelectionBlock</name> <environment>Refactory.Browser.Smalllint</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>Browser-SmalllintUI</package> </attributes> <methods> Refactory.Browser.MultiBrowserNavigator <category>accessing</category>
environment: aBrowserEnvironment environmentDictionary := aBrowserEnvironment. environment := SelectorEnvironment new
</methods> <methods> Refactory.Browser.MultiBrowserNavigator <category>aspects</category>
environmentList "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^environmentList isNil ifTrue: [environmentList := SelectionInList new] ifFalse: [environmentList]
</methods> <methods> Refactory.Browser.MultiBrowserNavigator <category>interface opening</category>
postBuildWith: aBuilder self environmentList list: ((environmentDictionary environments asList) sortWith: [:a :b | a displayString < b displayString]; yourself). super postBuildWith: aBuilder
</methods> <methods> Refactory.Browser.MultiBrowserNavigator <category>accessing-browser</category>
spec ^self replace: #navigatorSpec with: self windowSpecSymbol in: self class HorizontalWindowSpec
</methods> <methods> Refactory.Browser.MultiBrowserNavigator <category>changing</category>
changedEnvironment environment := environmentDictionary environmentNamed: self environmentList selection. self updateWithState: self navigatorStateClass new
</methods> <methods> Refactory.Browser.MultiBrowserNavigator class <category>accessing</category>
navigatorTypes ^#()
</methods> <methods> Refactory.Browser.MultiBrowserNavigator class <category>private-interface building</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> Refactory.Browser.Smalllint <category>actions</category>
abort checkerProcess isNil ifTrue: [^self]. checkerProcess terminate. checkerProcess := nil. self resetButtons. self percentDone: 0.0
clearFilters BasicLintRule filterDictionary: Dictionary new
emptyCache checker := SmalllintChecker newWithContext. "We must set the current menu choice to nil before setting the menu -- bug in the MenuButtonView update:..." self ruleHolder value: nil. menuHolder value: self computeMenu
loadFilters | file fileStream | file := self request: (#EnterNameOfIgnoresFile << #browser >> 'Enter name of ignores file:') initialAnswer: 'Smalllint.ig'. file isEmpty ifTrue: [^self]. fileStream := file asFilename readStream. [self class compilerClass evaluate: fileStream contents] ensure: [fileStream close]
run checkerProcess notNil ifTrue: [^self]. self disableAll: #(#run #ruleHolder #emptyCache #results). self enable: #abort. checkerProcess := [[self runChecker] ensure: [self enableAll: #(#run #ruleHolder #emptyCache). (self ruleHolder value isNil or: [self ruleHolder value isEmpty]) ifFalse: [self enable: #results]. self disable: #abort. checkerProcess := nil]] fork
runAbortInterface checkerProcess notNil ifTrue: [^self]. self disableAll: #(#run #emptyCache #results). self enable: #abort. checkerProcess := [[self runChecker] ensure: [checkerProcess := nil. self closeRequest]] fork
saveFilters | file fileStream | file := self request: (#EnterFileToSaveIgnoresTo << #browser >> 'Enter the file to save ignores to:') initialAnswer: 'Smalllint.ig'. file isEmpty ifTrue: [^self]. fileStream := file asFilename writeStream. [BasicLintRule storeFiltersOn: fileStream] ensure: [fileStream close]
viewResults self currentRule openEditor
</methods> <methods> Refactory.Browser.Smalllint <category>private</category>
changedRule (self currentRule isKindOf: LintRule) & checkerProcess isNil ifTrue: [self currentRule isEmpty ifTrue: [self disable: #results] ifFalse: [self enable: #results]. self enable: #run] ifFalse: [self disableAll: #(#run #results)]. self percentDone: 0
computeMenu | mb | mb := MenuBuilder new. self menuFor: self class rules builder: mb. ^mb menu
menuFor: aCompositeLintRule builder: aMenuBuilder aCompositeLintRule hasConflicts ifFalse: [aMenuBuilder add: ((#x1sRunAll << #browser >> '<1s> - Run all') expandMacrosWith: aCompositeLintRule name) -> aCompositeLintRule. aMenuBuilder line]. aCompositeLintRule rules do: [:each | each isComposite ifTrue: [aMenuBuilder beginSubMenuLabeled: each name. self menuFor: each builder: aMenuBuilder. aMenuBuilder endSubMenu] ifFalse: [aMenuBuilder add: each name -> each]]
resetButtons self enableAll: #(#run #emptyCache). (self currentRule isNil or: [self currentRule isEmpty]) ifTrue: [self disable: #results] ifFalse: [self enable: #results]. self disable: #abort. checkerProcess := nil
runChecker | numberSelectors searched | searched := 0. numberSelectors := environmentEditor selectedEnvironment numberSelectors. environmentEditor selectedEnvironment isEmpty ifTrue: [^self warn: (#YouHaventSelectedClasses << #browser >> 'You haven''t selected any classes.<n>All selected items will have a check by them.') expandMacros]. checker rule: self currentRule; environment: environmentEditor selectedEnvironment; methodBlock: [searched := searched + 1. self percentDone: searched / numberSelectors. Processor yield]; run. self currentRule isEmpty ifTrue: [self warn: (#Nobody << #browser >> 'Nobody')]. self currentRule openEditor
</methods> <methods> Refactory.Browser.Smalllint <category>accessing</category>
currentRule ^self ruleHolder value
environmentEditor environmentEditor isNil ifTrue: [environmentEditor := EnvironmentEditor new. environmentEditor selectedEnvironment: ClassEnvironment new]. ^environmentEditor
percentDone: aValue self percentDone value: aValue
</methods> <methods> Refactory.Browser.Smalllint <category>initialize-release</category>
initialize super initialize. self ruleHolder onChangeSend: #changedRule to: self. percentDone := 0.0 asValue
release self abort. self environmentEditor release. checker release. super release
</methods> <methods> Refactory.Browser.Smalllint <category>menu</category>
filterMenu | menu | menu := Menu new. menu addItem: ((MenuItem labeled: (#_LoadFiltersFromFile << #browser >> '&Load Filters from File...')) value: #loadFilters); addItem: ((MenuItem labeled: (#_SaveFiltersToFile << #browser >> '&Save Filters to File...')) value: #saveFilters); addItem: ((MenuItem labeled: (#_ClearFilters << #browser >> '&Clear Filters')) value: #clearFilters). ^menu
menu | menu | menu := Menu new. environmentEditor windowMenuItems do: [:each | menu addItem: ((MenuItem labeled: each key) submenu: each value)]. menu addItem: ((MenuItem labeled: (#_Filters << #browser >> '&Filters')) submenu: self filterMenu). ^menu
ruleMenu menuHolder isNil ifTrue: [menuHolder := self computeMenu asValue]. ^menuHolder
</methods> <methods> Refactory.Browser.Smalllint <category>events</category>
noticeOfWindowClose: aWidget self release. super noticeOfWindowClose: aWidget
</methods> <methods> Refactory.Browser.Smalllint <category>aspects</category>
percentDone "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^percentDone isNil ifTrue: [percentDone := 0 asValue] ifFalse: [percentDone]
ruleHolder "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^ruleHolder isNil ifTrue: [ruleHolder := nil asValue] ifFalse: [ruleHolder]
</methods> <methods> Refactory.Browser.Smalllint <category>interface opening</category>
postBuildWith: aBuilder super postBuildWith: aBuilder. checker := (builder componentAt: #ruleHolder) isNil ifTrue: [SmalllintChecker new] ifFalse: [SmalllintChecker newWithContext]
</methods> <methods> Refactory.Browser.Smalllint class <category>loaded actions</category>
addFiltersToMenus | menu | menu := BrowserNavigator menuNamed: #classMenu. (menu someMenuItemLabeled: self classFilterMenuItem label ifNone: [nil]) isNil ifTrue: [menu addItemGroup: (Array with: self classFilterMenuItem)]. menu := BrowserNavigator menuNamed: #selectorMenu. (menu someMenuItemLabeled: self selectorFilterMenuItem label ifNone: [nil]) isNil ifTrue: [menu addItemGroup: (Array with: self selectorFilterMenuItem)]
classFilterMenuItem ^(MenuItem labeled: (#AddFilter << #browser >> 'Add Filter')) value: #action:; nameKey: 'Smalllint Filter Class'; enablementSelector: #canFilterClasses; yourself
loaded (BrowserNavigator dependents includes: self) ifFalse: [BrowserNavigator addDependent: self]. self addFiltersToMenus
removeFiltersFromMenus | item menu | menu := BrowserNavigator menuNamed: #classMenu. item := menu someMenuItemLabeled: self classFilterMenuItem label ifNone: [nil]. item notNil ifTrue: [menu removeItem: item]. menu := BrowserNavigator menuNamed: #selectorMenu. item := menu someMenuItemLabeled: self selectorFilterMenuItem label ifNone: [nil]. item notNil ifTrue: [menu removeItem: item]
selectorFilterMenuItem ^(MenuItem labeled: (#AddFilter << #browser >> 'Add Filter')) value: #action:; nameKey: 'Smalllint Filter Selector'; enablementSelector: #canFilterSelectors; yourself
</methods> <methods> Refactory.Browser.Smalllint class <category>accessing</category>
rules ^RuleSelectionBlock isNil ifTrue: [CompositeLintRule allRules] ifFalse: [RuleSelectionBlock value]
ruleSelectionBlock: aBlock RuleSelectionBlock := aBlock
runRule: rule onEnvironment: browserEnvironment | lint | lint := self new. lint openInterface: #abortWindowSpec. lint environmentEditor selectedEnvironment: browserEnvironment. lint ruleHolder value: rule. lint runAbortInterface
</methods> <methods> Refactory.Browser.Smalllint class <category>updating</category>
update: anAspectSymbol with: aParameter from: aSender (aSender = BrowserNavigator and: [anAspectSymbol = #menus]) ifTrue: [^self addFiltersToMenus]. ^super update: anAspectSymbol with: aParameter from: aSender
</methods> <methods> Refactory.Browser.Smalllint class <category>private-interface building</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> Refactory.Browser.SmalllintResultEditor <category>changing</category>
changedResult (self selectedResult isNil or: [self selectedResult isComposite]) ifTrue: [self disableAll: #(#openResult #remove)] ifFalse: [self enableAll: #(#openResult #remove)]
</methods> <methods> Refactory.Browser.SmalllintResultEditor <category>initialize-release</category>
label: aLabel label := aLabel
rule: aCompositeLintRule results := self flattenResults: aCompositeLintRule
</methods> <methods> Refactory.Browser.SmalllintResultEditor <category>events</category>
noticeOfWindowClose: aWindow self release. super noticeOfWindowClose: aWindow
</methods> <methods> Refactory.Browser.SmalllintResultEditor <category>actions</category>
openResult self selectedResult openEditor
remove results := self removeCurrentResultFrom: results. self resultsList list: results asList. self changedResult
</methods> <methods> Refactory.Browser.SmalllintResultEditor <category>interface opening</category>
postBuildResultsList self visualBlockFor: #resultsList is: [:view :index | | each name | each := view sequence at: index. name := each displayName asText. each isComposite ifTrue: [name := name allBold]. Label with: name attributes: view textStyle offset: ((self indentionLevelFor: each at: index) * 10) @ 0]
postBuildWith: aBuilder super postBuildWith: aBuilder. self resultsList list: results asList. self postBuildResultsList
postOpenWith: aBuilder super postOpenWith: aBuilder. label notNil ifTrue: [self setLabel: ((#SmalllintResultsDash1s << #browser >> 'Smalllint Results -- <1s>') expandMacrosWith: label)]. self changedResult
</methods> <methods> Refactory.Browser.SmalllintResultEditor <category>private</category>
flattenResults: aCompositeLintRule | flattenedResults | flattenedResults := OrderedCollection new. aCompositeLintRule rules do: [:each | each notEmpty ifTrue: [each isComposite ifTrue: [flattenedResults add: each; addAll: (self flattenResults: each)] ifFalse: [flattenedResults add: each]]]. ^flattenedResults
indentionLevelFor: aRule at: anIndex | current level | current := aRule. level := 0. anIndex to: 1 by: -1 do: [:i | | each | each := results at: i. (each isComposite and: [each rules includes: current]) ifTrue: [current := each. level := level + 1]]. ^level
removeCurrentResultFrom: displayedResults | currentResult last newList | currentResult := self selectedResult. displayedResults remove: currentResult ifAbsent: []. newList := displayedResults copy. last := nil. displayedResults reverseDo: [:each | (each isComposite and: [(each rules includes: last) not]) ifTrue: [newList remove: each ifAbsent: []] ifFalse: [last := each]]. ^newList
selectedResult ^self resultsList selection
</methods> <methods> Refactory.Browser.SmalllintResultEditor <category>aspects</category>
resultsList "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^resultsList isNil ifTrue: [resultsList := SelectionInList new] ifFalse: [resultsList]
</methods> <methods> Refactory.Browser.SmalllintResultEditor class <category>interface opening</category>
openOn: aCompositeLintRule ^self openOn: aCompositeLintRule label: nil
openOn: aCompositeLintRule label: aLabel aCompositeLintRule isEmpty ifTrue: [Dialog warn: (#Nobody << #browser >> 'Nobody')]. (self new) rule: aCompositeLintRule; label: aLabel; open
</methods> <methods> Refactory.Browser.SmalllintResultEditor class <category>private-interface building</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> Refactory.Browser.SmalllintCodeTool <category>private</category>
allLintChecks ^CompositeLintRule lintChecks
distinctRules | components | components := OrderedCollection withAll: self lintRuleList selections. components isEmpty ifTrue: [components := OrderedCollection with: self allLintChecks]. components copy do: [:each | each allRules do: [:rule | components remove: rule ifAbsent: []]]. ^components
emptyLabel ^''
label: aString self actionHolder value: aString
percentDone: aNumber self percentDoneHolder value: aNumber
runChecker: aLintRule | numberSelectors searched environment count | searched := 0. environment := self selectedEnvironment. numberSelectors := environment numberSelectors. (SmalllintChecker new) rule: aLintRule; environment: environment; methodBlock: [searched := searched + 1. self percentDone: searched / numberSelectors. Processor yield]; run. count := aLintRule problemCount. self label: (count = 0 ifTrue: [(#NoResultsFound << #browser >> 'No results found.')] ifFalse: [(#ResultsFoundColon1p << #browser >> 'Results found: <1p>.') expandMacrosWith: count]). count = 0 ifTrue: [^self]. aLintRule openEditor
runRule: aLintRule checkerProcess notNil ifTrue: [^self]. self label: (#RunningDots << #browser >> 'Running...') asString. self percentDone: 0. checkerProcess := [self updateRunning. [[self runChecker: aLintRule] ifCurtailed: [self label: (#Aborted << #browser >> 'Aborted') asString]] ensure: [checkerProcess := nil. self updateRunning]] fork
selectedRule isTransformationRule ifTrue: [self transformationList selection isNil ifTrue: [^CompositeLintRule new]. ^CompositeLintRule rules: (Array with: self transformationList selection)] ifFalse: [| allRules | allRules := self distinctRules. ^CompositeLintRule rules: allRules]
toggleTransformations isTransformationRule := isTransformationRule not. self updateLists
</methods> <methods> Refactory.Browser.SmalllintCodeTool <category>aspects</category>
actionHolder "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^actionHolder isNil ifTrue: [actionHolder := String new asValue] ifFalse: [actionHolder]
lintRuleList "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^lintRuleList isNil ifTrue: [lintRuleList := MultiSelectionInTree new] ifFalse: [lintRuleList]
percentDoneHolder "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^percentDoneHolder isNil ifTrue: [percentDoneHolder := 0.5 asValue] ifFalse: [percentDoneHolder]
transformationList "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^transformationList isNil ifTrue: [transformationList := SelectionInList new] ifFalse: [transformationList]
</methods> <methods> Refactory.Browser.SmalllintCodeTool <category>interface opening</category>
postBuildWith: aBuilder super postBuildWith: aBuilder. self updateRunning; updateLists; updateLabel
</methods> <methods> Refactory.Browser.SmalllintCodeTool <category>initialize-release</category>
initialize super initialize. isTransformationRule := false. self lintRuleList treeHolder value: (TreeModel on: self allLintChecks displayRoot: true childrenWith: [:each | each rules]). self lintRuleList treeHolder value expand: 1. self lintRuleList selectionIndex: 1. self transformationList list: CompositeLintRule transformations rules asList
</methods> <methods> Refactory.Browser.SmalllintCodeTool <category>updating</category>
updateContents super updateContents. self updateLabel
updateLabel self label: self emptyLabel
updateLists isTransformationRule ifTrue: [self hide: #lintRuleList; show: #transformationList] ifFalse: [self hide: #transformationList; show: #lintRuleList]
updateRequest super updateRequest ifFalse: [^false]. self isRunning ifTrue: [Dialog warn: (#ARuleIsCurrentlyRunning << #browser >> 'A rule is currently running.'). ^false]. ^true
updateRunning checkerProcess notNil ifTrue: [self show: #percentDone; enable: #abort; disable: #run] ifFalse: [self hide: #percentDone; enable: #run; disable: #abort]
</methods> <methods> Refactory.Browser.SmalllintCodeTool <category>actions</category>
abort checkerProcess isNil ifTrue: [^self]. checkerProcess terminate
clearFilters BasicLintRule filterDictionary: Dictionary new
loadFilters | file fileStream | file := Dialog requestFileName: (#EnterNameOfIgnoresFile << #browser >> 'Enter name of ignores file:') default: '*.ig'. file isEmpty ifTrue: [^self]. fileStream := file asFilename readStream. [self class compilerClass evaluate: fileStream contents] ensure: [fileStream close]
run | rule | rule := self selectedRule. rule rules isEmpty ifTrue: [^self]. self runRule: rule
saveFilters | file fileStream | file := Dialog requestNewFileName: (#EnterFileToSaveIgnoresTo << #browser >> 'Enter the file to save ignores to:') default: '*.ig'. file isEmpty ifTrue: [^self]. fileStream := file asFilename writeStream. [BasicLintRule storeFiltersOn: fileStream] ensure: [fileStream close]
</methods> <methods> Refactory.Browser.SmalllintCodeTool <category>menu accessing</category>
ruleActions | actions | actions := OrderedCollection new. actions add: ((isTransformationRule ifTrue: [RBCommand] ifFalse: [RBCheckedCommand]) named: (#_CodeCriticRules << #browser >> '&Code Critic Rules') asString description: (#LintRules << #browser >> 'Lint Rules') asString action: [isTransformationRule ifTrue: [self toggleTransformations]] receiver: #yourself); add: ((isTransformationRule ifTrue: [RBCheckedCommand] ifFalse: [RBCommand]) named: (#_TransformationRules << #browser >> '&Transformation Rules') asString description: (#TransformationRules << #browser >> 'Transformation Rules') asString action: [isTransformationRule ifFalse: [self toggleTransformations]] receiver: #yourself). ^actions
</methods> <methods> Refactory.Browser.SmalllintCodeTool <category>testing</category>
isRunning ^checkerProcess notNil
</methods> <methods> Refactory.Browser.SmalllintCodeTool <category>help</category>
helpTopic ^'Code Critic'
</methods> <methods> Refactory.Browser.SmalllintCodeTool <category>tab APIs</category>
isActive ^self mostSpecificSelection notNil
tabName ^#CodeCritic << #browser >> 'Code Critic'
</methods> <methods> Refactory.Browser.SmalllintCodeTool class <category>private-interface building</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> Refactory.Browser.RewriteCodeTool <category>actions</category>
find (self verify: #originalCode) ifFalse: [^self]. self runRule: (ParseTreeLintRule createParseTreeRule: (Array with: self searchText) method: self isMethod name: ((#SearchFor1s << #browser >> 'Search for: <1s>') expandMacrosWith: self searchText))
replace ((self verify: #originalCode) and: [self verify: #newCode]) ifFalse: [^self]. self runRule: (ParseTreeTransformationRule rewrite: (Array with: (Array with: self searchText with: self replaceText)) methods: self isMethod name: ('<1s> -%> <2s>' expandMacrosWith: self searchText with: self replaceText))
verify: aSymbol | widget symbol controller | widget := builder componentAt: aSymbol. widget isNil ifTrue: [^false]. controller := widget widget controller. symbol := self isMethod ifTrue: [#parseRewriteMethod:onError:] ifFalse: [#parseRewriteExpression:onError:]. RBParser perform: symbol with: controller text with: [:aString :position | controller insertAndSelect: ((#x1s << #browser >> '<1s> -%>') expandMacrosWith: aString) at: position. ^false]. ^true
</methods> <methods> Refactory.Browser.RewriteCodeTool <category>aspects</category>
method "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^method isNil ifTrue: [method := false asValue] ifFalse: [method]
newCode "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^newCode isNil ifTrue: [newCode := String new asValue] ifFalse: [newCode]
originalCode "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^originalCode isNil ifTrue: [originalCode := String new asValue] ifFalse: [originalCode]
</methods> <methods> Refactory.Browser.RewriteCodeTool <category>accessing</category>
isMethod ^self method value
replaceText ^newCode value asString
searchText ^originalCode value asString
</methods> <methods> Refactory.Browser.RewriteCodeTool <category>updating</category>
updateRunning super updateRunning. checkerProcess notNil ifTrue: [self disable: #replace] ifFalse: [self enable: #replace]
</methods> <methods> Refactory.Browser.RewriteCodeTool <category>help</category>
helpTopic ^'Code Rewrite Editor'
</methods> <methods> Refactory.Browser.RewriteCodeTool <category>tab APIs</category>
tabName ^#Rewrite << #browser
</methods> <methods> Refactory.Browser.RewriteCodeTool class <category>private-interface building</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> Refactory.Browser.ParseTreeEnvironment <category>accessing</category>
selectionIntervalFor: aString | parseTree node | matcher isNil ifTrue: [^super selectionIntervalFor: aString]. parseTree := RBParser parseMethod: aString onError: [:error :position | ^super selectionIntervalFor: aString]. node := matcher executeTree: parseTree initialAnswer: nil. ^node isNil ifTrue: [super selectionIntervalFor: aString] ifFalse: [node sourceInterval]
</methods> <methods> Refactory.Browser.BrowserNavigator <category>Smalllint</category>
addFilterForClass self changeRequest ifFalse: [^self]. self selectedClasses do: [:each | self environment addFilterForClass: each]. self refreshLists
addFilterForSelector self changeRequest ifFalse: [^self]. self definitions do: [:each | self environment addFilterForClass: each implementingClass andSelector: each selector]. self refreshLists
canFilterClasses ^self environment isForSmalllint
canFilterSelectors ^self environment isForSmalllint and: [self environment canFilterSelectors]
</methods> <methods> Refactory.Browser.CompositeLintRule <category>private</category>
viewResults rules do: [:each | each viewResults]
</methods> <methods> Refactory.Browser.BasicLintRule <category>private</category>
openWithFilters ^self filteredResult openEditor
openWithoutFilters ^self result openEditor
viewResults ^self perform: openSymbol
</methods> <methods> Refactory.Browser.LintRule <category>accessing</category>
openEditor | rules | rules := self failedRules. rules isEmpty ifTrue: [^self]. rules size == 1 ifTrue: [^rules first viewResults]. SmalllintResultEditor openOn: self label: name
run ^Smalllint runRule: self
runOnEnvironment: anEnvironment ^Smalllint runRule: self onEnvironment: anEnvironment
</methods> <methods> Refactory.Browser.LintRule <category>private</category>
viewResults self subclassResponsibility
</methods> <methods> Refactory.Browser.MultiEnvironment <category>accessing</category>
navigatorClass ^MultiBrowserNavigator
</methods> <methods> Refactory.Browser.MultiBrowserNavigator class <category>interface specs</category>
HorizontalWindowSpec "UIPainter new openOnClass: self andSelector: #HorizontalWindowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #UnlabeledCanvas #defaultString: 'Unlabeled Canvas' #catalogID: #browser) #bounds: #(#{Graphics.Rectangle} 771 500 1411 700 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.SequenceViewSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 0 0 -2 0.333333 0 1 ) #name: #environmentList #model: #environmentList #callbacksSpec: #(#{UI.UIEventCallbackSubSpec} #valueChangeSelector: #changedEnvironment #requestValueChangeSelector: #changeRequest ) #useModifierKeys: true #selectionType: #highlight ) #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} 2 0.333333 0 0 0 1 0 1 ) #name: #navigator #flags: 0 #minorKey: #navigatorSpec ) #(#{UI.ResizingSplitterSpec} #layout: #(#{Graphics.LayoutFrame} -2 0.333333 0 0 2 0.333333 0 1 ) #horizontal: false #minAboveSize: 30 #minBelowSize: 60 #aboveWidgets: 'environmentList' #belowWidgets: 'navigator' ) ) ) )
</methods> <methods> Refactory.Browser.Smalllint class <category>interface specs</category>
abortWindowSpec "UIPainter new openOnClass: self andSelector: #abortWindowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #CodeCritic #defaultString: 'Code Critic' #catalogID: #browser) #min: #(#{Core.Point} 40 20 ) #bounds: #(#{Graphics.Rectangle} 659 549 941 652 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.ProgressWidgetSpec} #layout: #(#{Graphics.LayoutFrame} 5 0 30 0 -5 1 -35 1 ) #isOpaque: true #colors: #(#{UI.LookPreferences} #setForegroundColor: #(#ColorValue #blue ) #setBackgroundColor: #(#ColorValue #white ) ) #model: #percentDone #direction: #horizontal #position: #topLeft #area: true #reverse: false ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -30 0.5 -30 1 30 0.5 -2 1 ) #name: #abort #flags: 40 #model: #abort #label: #(#{Kernel.UserMessage} #key: #Abort #defaultString: 'Abort' #catalogID: #browser) ) #(#{UI.LabelSpec} #layout: #(#{UI.AlignmentOrigin} 0 0.5 5 0 0.5 0 ) #label: #(#{Kernel.UserMessage} #key: #RunningRuleDots #defaultString: 'Running rule...' #catalogID: #browser) ) ) ) )
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #Smalllint #defaultString: 'Smalllint' #catalogID: #browser) #min: #(#{Core.Point} 40 20) #bounds: #(#{Graphics.Rectangle} 241 271 783 497) #flags: 4 #menu: #menu) #component: #(#{UI.SpecCollection} #collection: #(#(#{UI.MenuButtonSpec} #layout: #(#{Graphics.LayoutFrame} 2 0 2 0 -1 0.666666 30 0) #name: #ruleHolder #model: #ruleHolder #menu: #ruleMenu) #(#{UI.ProgressWidgetSpec} #layout: #(#{Graphics.LayoutFrame} 2 0.666666 2 0 -1 1 30 0) #isOpaque: true #colors: #(#{UI.LookPreferences} #setForegroundColor: #(#ColorValue #blue) #setBackgroundColor: #(#ColorValue #white)) #model: #percentDone #direction: #horizontal #position: #topLeft #area: true #reverse: false) #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 62 0 0 1 0 1) #name: #environmentEditor #flags: 0 #majorKey: #{Refactory.Browser.EnvironmentEditor} #minorKey: #classWindowSpec #clientKey: #environmentEditor) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -45 0.2 32 0 45 0.2 60 0) #name: #run #flags: 40 #model: #run #label: #(#{Kernel.UserMessage} #key: #Run #defaultString: 'Run' #catalogID: #browser)) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -45 0.4 32 0 45 0.4 60 0) #name: #abort #flags: 40 #model: #abort #label: #(#{Kernel.UserMessage} #key: #Abort #defaultString: 'Abort' #catalogID: #browser)) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -45 0.8 32 0 45 0.8 60 0) #name: #emptyCache #model: #emptyCache #label: #(#{Kernel.UserMessage} #key: #EmptyCache #defaultString: 'Empty cache' #catalogID: #browser)) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -45 0.6 32 0 45 0.6 60 0) #name: #results #flags: 40 #model: #viewResults #label: #(#{Kernel.UserMessage} #key: #Results #defaultString: 'Results' #catalogID: #browser)))))
</methods> <methods> Refactory.Browser.SmalllintResultEditor class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #CodeCriticResults #defaultString: 'Code Critic Results' #catalogID: #browser) #min: #(#{Core.Point} 40 20 ) #bounds: #(#{Graphics.Rectangle} 800 600 1373 855 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.SequenceViewSpec} #layout: #(#{Graphics.LayoutFrame} 2 0 2 0 -2 1 -39 1 ) #name: #resultsList #model: #resultsList #callbacksSpec: #(#{UI.UIEventCallbackSubSpec} #valueChangeSelector: #changedResult ) #useModifierKeys: true #selectionType: #highlight ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -40 0.333333 -35 1 40 0.333333 -5 1 ) #name: #openResult #flags: 40 #model: #openResult #label: #(#{Kernel.UserMessage} #key: #BrowseDots #defaultString: 'Browse...' #catalogID: #browser) #isDefault: true ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -40 0.666666 -35 1 40 0.666666 -5 1 ) #name: #remove #model: #remove #label: #(#{Kernel.UserMessage} #key: #Remove #defaultString: 'Remove' #catalogID: #browser) ) ) ) )
</methods> <methods> Refactory.Browser.SmalllintCodeTool class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #UnlabeledCanvas #defaultString: 'Unlabeled Canvas' #catalogID: #browser) #bounds: #(#{Graphics.Rectangle} 800 600 1204 880 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.TreeViewSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 0 0 0 1 -30 1 ) #name: #lintRuleList #model: #lintRuleList #multipleSelections: true #useModifierKeys: true #selectionType: #highlight ) #(#{UI.SequenceViewSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 0 0 0 1 -30 1 ) #name: #transformationList #model: #transformationList #useModifierKeys: true #selectionType: #highlight ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} 2 0 -25 1 66 0 -2 1 ) #name: #run #model: #run #label: #(#{Kernel.UserMessage} #key: #CheckDots #defaultString: 'Check...' #catalogID: #browser) ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} 72 0 -25 1 136 0 -2 1 ) #name: #abort #flags: 40 #model: #abort #label: #(#{Kernel.UserMessage} #key: #Abort #defaultString: 'Abort' #catalogID: #browser) ) #(#{UI.ProgressWidgetSpec} #layout: #(#{Graphics.LayoutFrame} -125 1 -25 1 -2 1 -2 1 ) #name: #percentDone #isOpaque: true #colors: #(#{UI.LookPreferences} #setForegroundColor: #(#{Graphics.ColorValue} #blue ) #setBackgroundColor: #(#{Graphics.ColorValue} #white ) ) #model: #percentDoneHolder #direction: #horizontal #position: #topLeft #area: true #reverse: false ) #(#{UI.TextEditorSpec} #layout: #(#{Graphics.LayoutFrame} 142 0 -25 1 -127 1 -2 1 ) #name: #action #flags: 4 #model: #actionHolder #isReadOnly: true #tabRequiresControl: true ) ) ) )
</methods> <methods> Refactory.Browser.SmalllintCodeTool class <category>resources</category>
mainMenu "MenuEditor new openOnClass: self andSelector: #mainMenu" <resource: #menu> ^#(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #View #defaultString: 'View' #catalogID: #browser) #nameKey: #View #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #ViewSubmenu #defaultString: 'View submenu' #catalogID: #browser) #nameKey: #'Smalllint Rule Type List' #value: #dynamicMenu ) ) #(1 ) nil ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #ClearFilters #defaultString: 'Clear Filters' #catalogID: #browser) #nameKey: #'Smalllint Clear Filters' #value: #action: ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #LoadFiltersDots #defaultString: 'Load Filters...' #catalogID: #browser) #nameKey: #'Smalllint Load Filters' #value: #action: ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #SaveFiltersDots #defaultString: 'Save Filters...' #catalogID: #browser) #nameKey: #'Smalllint Save Filters' #value: #action: ) ) #(1 3 ) nil ) decodeAsLiteralArray
</methods> <methods> Refactory.Browser.RewriteCodeTool class <category>resources</category>
mainMenu "MenuEditor new openOnClass: self andSelector: #mainMenu" <resource: #menu> ^#(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #SearchDots #defaultString: 'Search...' #catalogID: #browser) #nameKey: #'Rewriter Search' #value: #action: ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #ReplaceDots #defaultString: 'Replace...' #catalogID: #browser) #nameKey: #'Rewriter Replace' #value: #action: ) ) #(2 ) nil ) decodeAsLiteralArray
</methods> <methods> Refactory.Browser.RewriteCodeTool class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #UnlabeledCanvas #defaultString: 'Unlabeled Canvas' #catalogID: #browser) #bounds: #(#{Graphics.Rectangle} 512 384 940 681 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.TextEditorSpec} #layout: #(#{Graphics.LayoutFrame} 2 0 25 0 -95 1 -16 0.5 ) #name: #originalCode #model: #originalCode #tabRequiresControl: true ) #(#{UI.TextEditorSpec} #layout: #(#{Graphics.LayoutFrame} 2 0 7 0.5 -95 1 -27 1 ) #name: #newCode #model: #newCode #tabRequiresControl: true ) #(#{UI.LabelSpec} #layout: #(#{Graphics.LayoutOrigin} -93 1 72 0 ) #name: #Label1 #label: #(#{Kernel.UserMessage} #key: #RewriteToolQuickHelpLiteral #defaultString: '# = literal' #catalogID: #browser) ) #(#{UI.LabelSpec} #layout: #(#{Graphics.LayoutOrigin} -93 1 54 0 ) #name: #Label2 #label: #(#{Kernel.UserMessage} #key: #RewriteToolQuickHelpStatement #defaultString: '. = statement' #catalogID: #browser) ) #(#{UI.LabelSpec} #layout: #(#{Graphics.LayoutOrigin} -93 1 34 0 ) #name: #Label3 #label: #(#{Kernel.UserMessage} #key: #RewriteToolQuickHelpRecurseInto #defaultString: '` = recurse into' #catalogID: #browser) ) #(#{UI.LabelSpec} #layout: #(#{Graphics.LayoutOrigin} -93 1 18 0 ) #name: #Label4 #label: #(#{Kernel.UserMessage} #key: #RewriteToolQuickHelpList #defaultString: '@ = list' #catalogID: #browser) ) #(#{UI.LabelSpec} #layout: #(#{Graphics.LayoutOrigin} -93 1 0 0 ) #name: #Label5 #label: #(#{Kernel.UserMessage} #key: #RewriteToolQuickHelpMetaVar #defaultString: '` = meta var' #catalogID: #browser) ) #(#{UI.LabelSpec} #layout: #(#{Graphics.LayoutOrigin} 2 0 -15 0.5 ) #name: #Label6 #label: #(#{Kernel.UserMessage} #key: #ReplaceWithC #defaultString: 'Replace with:' #catalogID: #browser) ) #(#{UI.LabelSpec} #layout: #(#{Core.Point} 2 2 ) #name: #Label7 #label: #(#{Kernel.UserMessage} #key: #SearchForC #defaultString: 'Search for:' #catalogID: #browser) ) #(#{UI.CheckBoxSpec} #layout: #(#{Graphics.LayoutOrigin} -93 1 -126 1 ) #name: #method #model: #method #label: #(#{Kernel.UserMessage} #key: #Method #defaultString: 'Method' #catalogID: #browser) ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -93 1 -106 1 -2 1 -83 1 ) #name: #run #model: #find #label: #(#{Kernel.UserMessage} #key: #SearchDots #defaultString: 'Search...' #catalogID: #browser) ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -93 1 -78 1 -2 1 -55 1 ) #name: #replace #model: #replace #label: #(#{Kernel.UserMessage} #key: #ReplaceDots #defaultString: 'Replace...' #catalogID: #browser) ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} -93 1 -50 1 -2 1 -27 1 ) #name: #abort #flags: 40 #model: #abort #label: #(#{Kernel.UserMessage} #key: #Abort #defaultString: 'Abort' #catalogID: #browser) ) #(#{UI.InputFieldSpec} #layout: #(#{Graphics.LayoutFrame} 2 0 -25 1 -127 1 -2 1 ) #name: #action #flags: 0 #model: #actionHolder ) #(#{UI.ProgressWidgetSpec} #layout: #(#{Graphics.LayoutFrame} -125 1 -25 1 -2 1 -2 1 ) #name: #percentDone #isOpaque: true #colors: #(#{UI.LookPreferences} #setForegroundColor: #(#{Graphics.ColorValue} #blue ) #setBackgroundColor: #(#{Graphics.ColorValue} #white ) ) #model: #percentDoneHolder #direction: #horizontal #position: #topLeft #area: true #reverse: false ) ) ) )
</methods> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>BrowserApplicationModel</name> <environment>Refactory.Browser</environment> <super>UI.ApplicationModel</super> <private>false</private> none menus <imports></imports> <category>Browser-RB UI</category> <attributes> <package>Browser-BaseUI</package> </attributes> </class> <class> <name>ParseTreeEnvironment</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.SelectorEnvironment</super> <private>false</private> none matcher <imports></imports> <category>Browser-Lint</category> <attributes> <package>Browser-Smalllint</package> </attributes> </class> <class> <name>LintRule</name> <environment>Refactory.Browser</environment> <super>Core.Object</super> <private>false</private> none name <imports></imports> <category>Browser-Lint</category> <attributes> <package>Browser-Smalllint</package> </attributes> </class> <class> <name>CompositeLintRule</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.LintRule</super> <private>false</private> none rules <imports></imports> <category>Browser-Lint</category> <attributes> <package>Browser-Smalllint</package> </attributes> </class> <class> <name>BasicLintRule</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.LintRule</super> <private>false</private> none result openSymbol <imports></imports> <category>Browser-Lint</category> <attributes> <package>Browser-Smalllint</package> </attributes> </class> <class> <name>CodeTool</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.BrowserApplicationModel</super> <private>false</private> none codeModel menu <imports></imports> <category>Browser-Code Tools</category> <attributes> <package>Browser-BrowserUI</package> </attributes> </class> <class> <name>MultiEnvironment</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.BrowserEnvironmentWrapper</super> <private>false</private> none environmentDictionaries <imports></imports> <category>Browser-Environments</category> <attributes> <package>Browser-Smalllint</package> </attributes> </class> <class> <name>BrowserNavigator</name> <environment>Refactory.Browser</environment> <super>Refactory.Browser.Navigator</super> <private>false</private> none navigatorType cachedSelectors windowLabel navigatorSpecBlocks dependents <imports> Store.* </imports> <category>Browser-Navigator</category> <attributes> <package>Browser-BrowserUI</package> </attributes> </class>