--- a/BrowserView.st Thu Nov 23 18:53:39 1995 +0100
+++ b/BrowserView.st Fri Nov 24 11:31:36 1995 +0100
@@ -12,12 +12,12 @@
StandardSystemView subclass:#BrowserView
instanceVariableNames:'classCategoryListView classListView methodCategoryListView
- methodListView classMethodListView codeView classToggle
- instanceToggle currentClassCategory currentClassHierarchy
- currentClass currentMethodCategory currentMethod currentSelector
- showInstance actualClass fullClass lastMethodCategory aspect
- variableListView fullProtocol lockUpdates autoSearch myLabel
- acceptClass'
+ methodListView classMethodListView codeView classToggle
+ instanceToggle currentClassCategory currentClassHierarchy
+ currentClass currentMethodCategory currentMethod currentSelector
+ showInstance actualClass fullClass lastMethodCategory aspect
+ variableListView fullProtocol lockUpdates autoSearch myLabel
+ acceptClass'
classVariableNames:'CheckForInstancesWhenRemovingClasses RememberAspect DefaultIcon'
poolDictionaries:''
category:'Interface-Browsers'
@@ -199,7 +199,7 @@
"compare the source codes"
currentMethod notNil ifTrue:[
changedMethod source = codeView contents ifFalse:[
- self warnLabel:'the code shown may not up to date'.
+ self warnLabel:'method has changed - the code shown may be obsolete'.
]
].
^ self
@@ -276,21 +276,21 @@
classCategoryCheckinEach
self withWaitCursorDo:[
- |logMessage|
-
- logMessage := Dialog
- request:'enter a log message (used for all):'
- initialAnswer:''
- onCancel:nil.
-
- logMessage notNil ifTrue:[
- Smalltalk allClassesInCategory:currentClassCategory do:[:aClass |
- self busyLabel:'checking in %1' with:aClass name.
- SourceCodeManager checkinClass:aClass logMessage:logMessage.
- self normalLabel.
- ]
- ].
- self normalLabel.
+ |logMessage|
+
+ logMessage := Dialog
+ request:'enter a log message (used for all):'
+ initialAnswer:''
+ onCancel:nil.
+
+ logMessage notNil ifTrue:[
+ Smalltalk allClassesInCategory:currentClassCategory do:[:aClass |
+ self busyLabel:'checking in %1' with:aClass name.
+ SourceCodeManager checkinClass:aClass logMessage:logMessage.
+ self normalLabel.
+ ]
+ ].
+ self normalLabel.
]
"Created: 23.11.1995 / 11:41:38 / cg"
@@ -406,77 +406,77 @@
(device ctrlDown
and:[currentClassCategory notNil]) ifTrue:[
- labels := #(
- 'checkin each'
- ).
- selectors := #(
- classCategoryCheckinEach
- ).
+ labels := #(
+ 'checkin each'
+ ).
+ selectors := #(
+ classCategoryCheckinEach
+ ).
] ifFalse:[
- currentClassCategory isNil ifTrue:[
- labels := #(
- 'spawn full class'
- '-'
- 'update'
- 'find class ...'
- 'find method ...'
- '-'
- 'new class category ...'
- ).
- selectors := #(
- classCategorySpawnFullClass
- nil
- classCategoryUpdate
- classCategoryFindClass
- classCategoryFindMethod
- nil
- classCategoryNewCategory
- ).
- ] ifFalse:[
- labels := #(
- 'fileOut'
- 'fileOut each'
+ currentClassCategory isNil ifTrue:[
+ labels := #(
+ 'spawn full class'
+ '-'
+ 'update'
+ 'find class ...'
+ 'find method ...'
+ '-'
+ 'new class category ...'
+ ).
+ selectors := #(
+ classCategorySpawnFullClass
+ nil
+ classCategoryUpdate
+ classCategoryFindClass
+ classCategoryFindMethod
+ nil
+ classCategoryNewCategory
+ ).
+ ] ifFalse:[
+ labels := #(
+ 'fileOut'
+ 'fileOut each'
"/
"/ 'fileOut binary'
"/
- 'printOut'
- 'printOut protocol'
- '-'
- 'clone'
- 'SPAWN_CATEGORY'
- 'spawn full class'
- '-'
- 'update'
- 'find class ...'
- 'find method ...'
- '-'
- 'new class category ...'
- 'rename ...'
- 'remove'
- ).
- selectors := #(
- classCategoryFileOut
- classCategoryFileOutEach
- classCategoryPrintOut
- classCategoryPrintOutProtocol
- nil
- classCategoryClone
- classCategorySpawn
- classCategorySpawnFullClass
- nil
- classCategoryUpdate
- classCategoryFindClass
- classCategoryFindMethod
- nil
- classCategoryNewCategory
- classCategoryRename
- classCategoryRemove
- ).
- ].
+ 'printOut'
+ 'printOut protocol'
+ '-'
+ 'clone'
+ 'SPAWN_CATEGORY'
+ 'spawn full class'
+ '-'
+ 'update'
+ 'find class ...'
+ 'find method ...'
+ '-'
+ 'new class category ...'
+ 'rename ...'
+ 'remove'
+ ).
+ selectors := #(
+ classCategoryFileOut
+ classCategoryFileOutEach
+ classCategoryPrintOut
+ classCategoryPrintOutProtocol
+ nil
+ classCategoryClone
+ classCategorySpawn
+ classCategorySpawnFullClass
+ nil
+ classCategoryUpdate
+ classCategoryFindClass
+ classCategoryFindMethod
+ nil
+ classCategoryNewCategory
+ classCategoryRename
+ classCategoryRemove
+ ).
+ ].
].
^ PopUpMenu labels:(resources array:labels)
- selectors:selectors
+ selectors:selectors
"Created: 14.9.1995 / 10:50:17 / claus"
"Modified: 23.11.1995 / 18:37:06 / cg"
@@ -1350,9 +1350,9 @@
classRefs
self doClassMenu:[:currentClass |
- self withSearchCursorDo:[
- SystemBrowser browseReferendsOf:currentClass name asSymbol
- ]
+ self withSearchCursorDo:[
+ SystemBrowser browseReferendsOf:currentClass name asSymbol
+ ]
]
"Created: 23.11.1995 / 14:11:43 / cg"
@@ -1557,9 +1557,9 @@
and shows a list of uses - try it and like it"
self doClassMenu:[:currentClass |
- self withSearchCursorDo:[
- SystemBrowser browseUsesOf:currentClass
- ]
+ self withSearchCursorDo:[
+ SystemBrowser browseUsesOf:currentClass
+ ]
]
"Created: 23.11.1995 / 14:11:47 / cg"
@@ -1624,20 +1624,20 @@
"check a class into the source repository"
self doClassMenu:[:currentClass |
- |logMessage|
-
- logMessage := Dialog
- request:'enter a log message:'
- initialAnswer:''
- onCancel:nil.
- logMessage notNil ifTrue:[
- self busyLabel:'checking in %1' with:currentClass name.
- SourceCodeManager checkinClass:currentClass logMessage:logMessage.
- aspect == #revisionInfo ifTrue:[
- self classListUpdate
- ].
- self normalLabel.
- ]
+ |logMessage|
+
+ logMessage := Dialog
+ request:'enter a log message:'
+ initialAnswer:''
+ onCancel:nil.
+ logMessage notNil ifTrue:[
+ self busyLabel:'checking in %1' with:currentClass name.
+ SourceCodeManager checkinClass:currentClass logMessage:logMessage.
+ aspect == #revisionInfo ifTrue:[
+ self classListUpdate
+ ].
+ self normalLabel.
+ ]
]
"Created: 23.11.1995 / 11:41:38 / cg"
@@ -1689,44 +1689,44 @@
"show current classes revision info in codeView"
self doClassMenu:[:currentClass |
- |aStream info info2 s|
-
- aStream := WriteStream on:(String new:200).
- currentClass notNil ifTrue:[
- info := currentClass revisionInfo.
- info notNil ifTrue:[
- s := info at:#repositoryPath ifAbsent:nil.
- s notNil ifTrue:[
- aStream nextPut:'Source repository : ' , s; cr
- ].
- aStream nextPutAll:'Filename ........ : ' , (info at:#fileName ifAbsent:'?'); cr.
- aStream nextPutAll:'Revision ........ : ' , (info at:#revision ifAbsent:'?'); cr.
- aStream nextPutAll:'Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?'); cr.
- aStream nextPutAll:'Checkin user .... : ' , (info at:#user ifAbsent:'?'); cr.
-
- (info2 := currentClass sourceCodeInfo) notNil ifTrue:[
- aStream nextPutAll:'Repository: ..... : ' , (info2 at:#module ifAbsent:'?'); cr.
- aStream nextPutAll:'Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'); cr.
- ].
- aStream nextPutAll:'Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'); cr.
- aStream cr.
-
- SourceCodeManager notNil ifTrue:[
- aStream nextPutAll:'Repository revisions:'; cr; cr.
- SourceCodeManager writeRevisionLogOf:currentClass to:aStream.
- ]
- ]
- ].
- codeView contents:(aStream contents).
-
- codeView modified:false.
- codeView acceptAction:nil.
- codeView explainAction:nil.
- methodListView notNil ifTrue:[
- methodListView deselect
- ].
- aspect := #revisionInfo.
- self normalLabel
+ |aStream info info2 s|
+
+ aStream := WriteStream on:(String new:200).
+ currentClass notNil ifTrue:[
+ info := currentClass revisionInfo.
+ info notNil ifTrue:[
+ s := info at:#repositoryPath ifAbsent:nil.
+ s notNil ifTrue:[
+ aStream nextPut:'Source repository : ' , s; cr
+ ].
+ aStream nextPutAll:'Filename ........ : ' , (info at:#fileName ifAbsent:'?'); cr.
+ aStream nextPutAll:'Revision ........ : ' , (info at:#revision ifAbsent:'?'); cr.
+ aStream nextPutAll:'Checkin date .... : ' , (info at:#date ifAbsent:'?') , ' ' , (info at:#time ifAbsent:'?'); cr.
+ aStream nextPutAll:'Checkin user .... : ' , (info at:#user ifAbsent:'?'); cr.
+
+ (info2 := currentClass sourceCodeInfo) notNil ifTrue:[
+ aStream nextPutAll:'Repository: ..... : ' , (info2 at:#module ifAbsent:'?'); cr.
+ aStream nextPutAll:'Directory: ...... : ' , (info2 at:#directory ifAbsent:'?'); cr.
+ ].
+ aStream nextPutAll:'Container ....... : ' , (info at:#repositoryPathName ifAbsent:'?'); cr.
+ aStream cr.
+
+ SourceCodeManager notNil ifTrue:[
+ aStream nextPutAll:'Repository revisions:'; cr; cr.
+ SourceCodeManager writeRevisionLogOf:currentClass to:aStream.
+ ]
+ ]
+ ].
+ codeView contents:(aStream contents).
+
+ codeView modified:false.
+ codeView acceptAction:nil.
+ codeView explainAction:nil.
+ methodListView notNil ifTrue:[
+ methodListView deselect
+ ].
+ aspect := #revisionInfo.
+ self normalLabel
]
"Created: 14.11.1995 / 16:43:15 / cg"
@@ -1784,27 +1784,27 @@
classListUpdate
RememberAspect ifTrue:[
- aspect == #hierarchy ifTrue:[
- ^ self classHierarchy
- ].
- aspect == #classInstVars ifTrue:[
- ^ self classClassInstVars
- ].
- aspect == #comment ifTrue:[
- ^ self classComment
- ].
- aspect == #primitiveDefinitions ifTrue:[
- ^ self classPrimitiveDefinitions
- ].
- aspect == #primitiveFunctions ifTrue:[
- ^ self classPrimitiveFunctions
- ].
- aspect == #primitiveVariables ifTrue:[
- ^ self classPrimitiveVariables
- ].
- aspect == #revisionInfo ifTrue:[
- ^ self classRevisionInfo
- ].
+ aspect == #hierarchy ifTrue:[
+ ^ self classHierarchy
+ ].
+ aspect == #classInstVars ifTrue:[
+ ^ self classClassInstVars
+ ].
+ aspect == #comment ifTrue:[
+ ^ self classComment
+ ].
+ aspect == #primitiveDefinitions ifTrue:[
+ ^ self classPrimitiveDefinitions
+ ].
+ aspect == #primitiveFunctions ifTrue:[
+ ^ self classPrimitiveFunctions
+ ].
+ aspect == #primitiveVariables ifTrue:[
+ ^ self classPrimitiveVariables
+ ].
+ aspect == #revisionInfo ifTrue:[
+ ^ self classRevisionInfo
+ ].
].
self classDefinition
@@ -1838,67 +1838,67 @@
|oldMethodCategory oldMethod oldSelector|
self withWaitCursorDo:[
- oldMethodCategory := currentMethodCategory.
- oldMethod := currentMethod.
- oldSelector := currentSelector.
-
- showInstance ifTrue:[
- actualClass := acceptClass := currentClass
- ] ifFalse:[
- actualClass := acceptClass := currentClass class
- ].
- currentMethodCategory := nil.
- currentMethod := nil.
- currentSelector := nil.
-
- self updateVariableList.
- self updateMethodCategoryList.
-
- oldMethodCategory notNil ifTrue:[
- methodCategoryListView selectElement:oldMethodCategory.
- methodCategoryListView hasSelection ifTrue:[
- currentMethodCategory := oldMethodCategory.
- self methodCategorySelectionChanged
- ]
- ].
- self updateMethodList.
- self updateCodeView.
-
- fullClass ifTrue:[
- codeView acceptAction:[:theCode |
- codeView cursor:Cursor execute.
- Object abortSignal catch:[
- self compileCode:theCode asString.
- codeView modified:false.
- ].
- codeView cursor:Cursor normal.
- ].
- ] ifFalse:[
+ oldMethodCategory := currentMethodCategory.
+ oldMethod := currentMethod.
+ oldSelector := currentSelector.
+
+ showInstance ifTrue:[
+ actualClass := acceptClass := currentClass
+ ] ifFalse:[
+ actualClass := acceptClass := currentClass class
+ ].
+ currentMethodCategory := nil.
+ currentMethod := nil.
+ currentSelector := nil.
+
+ self updateVariableList.
+ self updateMethodCategoryList.
+
+ oldMethodCategory notNil ifTrue:[
+ methodCategoryListView selectElement:oldMethodCategory.
+ methodCategoryListView hasSelection ifTrue:[
+ currentMethodCategory := oldMethodCategory.
+ self methodCategorySelectionChanged
+ ]
+ ].
+ self updateMethodList.
+ self updateCodeView.
+
+ fullClass ifTrue:[
+ codeView acceptAction:[:theCode |
+ codeView cursor:Cursor execute.
+ Object abortSignal catch:[
+ self compileCode:theCode asString.
+ codeView modified:false.
+ ].
+ codeView cursor:Cursor normal.
+ ].
+ ] ifFalse:[
"/ self classDefinition.
self classListUpdate.
- codeView acceptAction:[:theCode |
- codeView cursor:Cursor execute.
- Object abortSignal catch:[
- (Compiler evaluate:theCode asString notifying:codeView compile:false)
- isBehavior ifTrue:[
- self classCategoryUpdate.
- self updateClassListWithScroll:false.
- codeView modified:false.
- ].
- ].
- codeView cursor:Cursor normal.
- ].
- ].
- codeView explainAction:nil.
-
- classCategoryListView notNil ifTrue:[
- (currentClassCategory = currentClass category) ifFalse:[
- currentClassCategory := currentClass category.
- classCategoryListView selectElement:currentClassCategory
- ]
- ].
-
- self setDoitActionForClass
+ codeView acceptAction:[:theCode |
+ codeView cursor:Cursor execute.
+ Object abortSignal catch:[
+ (Compiler evaluate:theCode asString notifying:codeView compile:false)
+ isBehavior ifTrue:[
+ self classCategoryUpdate.
+ self updateClassListWithScroll:false.
+ codeView modified:false.
+ ].
+ ].
+ codeView cursor:Cursor normal.
+ ].
+ ].
+ codeView explainAction:nil.
+
+ classCategoryListView notNil ifTrue:[
+ (currentClassCategory = currentClass category) ifFalse:[
+ currentClassCategory := currentClass category.
+ classCategoryListView selectElement:currentClassCategory
+ ]
+ ].
+
+ self setDoitActionForClass
]
"Created: 23.11.1995 / 11:32:03 / cg"
@@ -3585,8 +3585,8 @@
"if there is only one method, show it right away"
methodListView list size == 1 ifTrue:[
- methodListView selection:1.
- self methodSelection:1
+ methodListView selection:1.
+ self methodSelection:1
"/ ] ifFalse:[
"/ oldSelector notNil ifTrue:[
"/ methodListView selectElement:oldSelector.
@@ -3603,17 +3603,17 @@
"method category selection has changed - update dependent views"
self withWaitCursorDo:[
- currentMethod := currentSelector := nil.
-
- self updateMethodList.
- self updateCodeView.
-
- currentMethodCategory notNil ifTrue:[
- methodCategoryListView selectElement:currentMethodCategory
- ].
-
- self setAcceptAndExplainActionsForMethod.
- self hilightMethodsInMethodCategoryList:false inMethodList:true.
+ currentMethod := currentSelector := nil.
+
+ self updateMethodList.
+ self updateCodeView.
+
+ currentMethodCategory notNil ifTrue:[
+ methodCategoryListView selectElement:currentMethodCategory
+ ].
+
+ self setAcceptAndExplainActionsForMethod.
+ self hilightMethodsInMethodCategoryList:false inMethodList:true.
]
"Created: 23.11.1995 / 14:17:38 / cg"
@@ -3845,7 +3845,7 @@
self checkClassSelected ifFalse:[^ self].
self withSearchCursorDo:[
- SystemBrowser browseSuperCallsUnder:currentClass
+ SystemBrowser browseSuperCallsUnder:currentClass
]
"Created: 23.11.1995 / 12:03:57 / cg"
@@ -3886,240 +3886,240 @@
localSearchLabels localSearchSelectors|
device ctrlDown ifTrue:[
- "/ 'secret' developpers menu
-
- currentMethod isNil ifTrue:[
- methodListView flash.
- ^ nil
- ].
- labels := #(
- 'inspect method'
- 'compile to machine code'
- 'decompile'
- '-'
- 'make private'
- 'make protected'
- 'make public'
- ).
- selectors := #(
- methodInspect
- methodSTCCompile
- methodDecompile
- nil
- methodMakePrivate
- methodMakeProtected
- methodMakePublic
- )
+ "/ 'secret' developpers menu
+
+ currentMethod isNil ifTrue:[
+ methodListView flash.
+ ^ nil
+ ].
+ labels := #(
+ 'inspect method'
+ 'compile to machine code'
+ 'decompile'
+ '-'
+ 'make private'
+ 'make protected'
+ 'make public'
+ ).
+ selectors := #(
+ methodInspect
+ methodSTCCompile
+ methodDecompile
+ nil
+ methodMakePrivate
+ methodMakeProtected
+ methodMakePublic
+ )
] ifFalse:[
- sepLocalLabels := sepLocalSelectors := #().
-
- searchLabels := #(
- 'senders ...'
- 'implementors ...'
- 'globals ...'
- 'string search ...'
- 'apropos ...'
- ).
- searchSelectors := #(
- methodSenders
- methodImplementors
- methodGlobalReferends
- methodStringSearch
- methodAproposSearch
- ).
-
- currentClass notNil ifTrue:[
- localSearchLabels := #(
- '-'
- 'local senders ...'
- 'local implementors ...'
- 'local super sends ...'
- 'local string search ...'
- 'local apropos ...'
- ).
- localSearchSelectors := #(
- nil
- methodLocalSenders
- methodLocalImplementors
- methodLocalSuperSends
- methodLocalStringSearch
- methodLocalAproposSearch
- ).
- ] ifFalse:[
- localSearchLabels := localSearchSelectors := #()
- ].
-
- currentMethodCategory notNil ifTrue:[
- sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
-
- newLabels := #(
- 'new method'
- ).
-
- newSelectors := #(
- methodNewMethod
- ).
- ] ifFalse:[
- newLabels := newSelectors := #()
- ].
-
- currentMethod notNil ifTrue:[
- fileLabels := #(
- 'fileOut'
- 'printOut'
- '-'
- 'SPAWN_METHOD'
- '-'
- ).
-
- fileSelectors := #(
- methodFileOut
- methodPrintOut
- nil
- methodSpawn
- nil
- ).
-
- sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
-
- mthdLabels := #(
- 'change category ...'
- 'remove'
- ).
-
- mthdSelectors := #(
- methodChangeCategory
- methodRemove
- ).
-
- currentMethod isWrapped ifTrue:[
- brkLabels := #(
- 'remove break/trace'
- '-'
- ).
-
- brkSelectors := #(
- methodRemoveBreakOrTrace
- nil
- )
- ] ifFalse:[
- brkLabels := #(
- 'breakpoint'
- 'trace'
- 'trace sender'
- '-'
- ).
-
- brkSelectors := #(
- methodBreakPoint
- methodTrace
- methodTraceSender
- nil
- )
- ]
- ] ifFalse:[
- fileLabels := fileSelectors := #().
- brkLabels := brkSelectors := #().
- mthdLabels := mthdSelectors := #().
- ].
-
-
-
- labels :=
- fileLabels ,
- searchLabels ,
- localSearchLabels ,
- sepLocalLabels ,
- brkLabels ,
- newLabels ,
- mthdLabels.
-
- selectors :=
- fileSelectors ,
- searchSelectors ,
- localSearchSelectors ,
- sepLocalSelectors ,
- brkSelectors ,
- newSelectors ,
- mthdSelectors.
+ sepLocalLabels := sepLocalSelectors := #().
+
+ searchLabels := #(
+ 'senders ...'
+ 'implementors ...'
+ 'globals ...'
+ 'string search ...'
+ 'apropos ...'
+ ).
+ searchSelectors := #(
+ methodSenders
+ methodImplementors
+ methodGlobalReferends
+ methodStringSearch
+ methodAproposSearch
+ ).
+
+ currentClass notNil ifTrue:[
+ localSearchLabels := #(
+ '-'
+ 'local senders ...'
+ 'local implementors ...'
+ 'local super sends ...'
+ 'local string search ...'
+ 'local apropos ...'
+ ).
+ localSearchSelectors := #(
+ nil
+ methodLocalSenders
+ methodLocalImplementors
+ methodLocalSuperSends
+ methodLocalStringSearch
+ methodLocalAproposSearch
+ ).
+ ] ifFalse:[
+ localSearchLabels := localSearchSelectors := #()
+ ].
+
+ currentMethodCategory notNil ifTrue:[
+ sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
+
+ newLabels := #(
+ 'new method'
+ ).
+
+ newSelectors := #(
+ methodNewMethod
+ ).
+ ] ifFalse:[
+ newLabels := newSelectors := #()
+ ].
+
+ currentMethod notNil ifTrue:[
+ fileLabels := #(
+ 'fileOut'
+ 'printOut'
+ '-'
+ 'SPAWN_METHOD'
+ '-'
+ ).
+
+ fileSelectors := #(
+ methodFileOut
+ methodPrintOut
+ nil
+ methodSpawn
+ nil
+ ).
+
+ sepLocalLabels := #('-'). sepLocalSelectors := #(nil).
+
+ mthdLabels := #(
+ 'change category ...'
+ 'remove'
+ ).
+
+ mthdSelectors := #(
+ methodChangeCategory
+ methodRemove
+ ).
+
+ currentMethod isWrapped ifTrue:[
+ brkLabels := #(
+ 'remove break/trace'
+ '-'
+ ).
+
+ brkSelectors := #(
+ methodRemoveBreakOrTrace
+ nil
+ )
+ ] ifFalse:[
+ brkLabels := #(
+ 'breakpoint'
+ 'trace'
+ 'trace sender'
+ '-'
+ ).
+
+ brkSelectors := #(
+ methodBreakPoint
+ methodTrace
+ methodTraceSender
+ nil
+ )
+ ]
+ ] ifFalse:[
+ fileLabels := fileSelectors := #().
+ brkLabels := brkSelectors := #().
+ mthdLabels := mthdSelectors := #().
+ ].
+
+
+
+ labels :=
+ fileLabels ,
+ searchLabels ,
+ localSearchLabels ,
+ sepLocalLabels ,
+ brkLabels ,
+ newLabels ,
+ mthdLabels.
+
+ selectors :=
+ fileSelectors ,
+ searchSelectors ,
+ localSearchSelectors ,
+ sepLocalSelectors ,
+ brkSelectors ,
+ newSelectors ,
+ mthdSelectors.
"
- labels := #(
- 'fileOut'
- 'printOut'
- '-'
- 'SPAWN_METHOD'
- '-'
- 'senders ...'
- 'implementors ...'
- 'globals ...'
- 'string search ...'
- 'apropos ...'
- '-'
- 'local senders ...'
- 'local implementors ...'
- 'local string search ...'
- 'local apropos ...'
- '-'
- 'breakpoint'
- 'trace'
- 'trace sender'
- '-'
- 'new method'
- 'change category ...'
- 'remove'
- ).
- selectors := #(
- methodFileOut
- methodPrintOut
- nil
- methodSpawn
- nil
- methodSenders
- methodImplementors
- methodGlobalReferends
- methodStringSearch
- methodAproposSearch
- nil
- methodLocalSenders
- methodLocalImplementors
- methodLocalStringSearch
- methodLocalAproposSearch
- nil
- methodBreakPoint
- methodTrace
- methodTraceSender
- nil
- methodNewMethod
- methodChangeCategory
- methodRemove
- )
+ labels := #(
+ 'fileOut'
+ 'printOut'
+ '-'
+ 'SPAWN_METHOD'
+ '-'
+ 'senders ...'
+ 'implementors ...'
+ 'globals ...'
+ 'string search ...'
+ 'apropos ...'
+ '-'
+ 'local senders ...'
+ 'local implementors ...'
+ 'local string search ...'
+ 'local apropos ...'
+ '-'
+ 'breakpoint'
+ 'trace'
+ 'trace sender'
+ '-'
+ 'new method'
+ 'change category ...'
+ 'remove'
+ ).
+ selectors := #(
+ methodFileOut
+ methodPrintOut
+ nil
+ methodSpawn
+ nil
+ methodSenders
+ methodImplementors
+ methodGlobalReferends
+ methodStringSearch
+ methodAproposSearch
+ nil
+ methodLocalSenders
+ methodLocalImplementors
+ methodLocalStringSearch
+ methodLocalAproposSearch
+ nil
+ methodBreakPoint
+ methodTrace
+ methodTraceSender
+ nil
+ methodNewMethod
+ methodChangeCategory
+ methodRemove
+ )
"
].
m := PopUpMenu
- labels:(resources array:labels)
- selectors:selectors.
+ labels:(resources array:labels)
+ selectors:selectors.
currentMethod notNil ifTrue:[
- currentMethod isPrivate ifTrue:[
- m disable:#methodMakePrivate
- ].
- currentMethod isProtected ifTrue:[
- m disable:#methodMakeProtected
- ].
- currentMethod isPublic ifTrue:[
- m disable:#methodMakePublic
- ].
+ currentMethod isPrivate ifTrue:[
+ m disable:#methodMakePrivate
+ ].
+ currentMethod isProtected ifTrue:[
+ m disable:#methodMakeProtected
+ ].
+ currentMethod isPublic ifTrue:[
+ m disable:#methodMakePublic
+ ].
].
currentMethod notNil ifTrue:[
- (currentMethod code notNil
- or:[Compiler canCreateMachineCode not]) ifTrue:[
- m disable:#methodSTCCompile
- ].
- currentMethod byteCode isNil ifTrue:[
- m disable:#methodDecompile
- ].
+ (currentMethod code notNil
+ or:[Compiler canCreateMachineCode not]) ifTrue:[
+ m disable:#methodSTCCompile
+ ].
+ currentMethod byteCode isNil ifTrue:[
+ m disable:#methodDecompile
+ ].
].
^ m
@@ -4441,43 +4441,43 @@
"method selection has changed - update dependent views"
self withWaitCursorDo:[
- |index cls|
-
- self updateCodeView.
- aspect := nil.
- self setAcceptAndExplainActionsForMethod.
-
- "
- if there is any autoSearch string, do the search
- "
- autoSearch notNil ifTrue:[
- codeView searchFwd:autoSearch startingAtLine:1 col:0 ifAbsent:[]
- ].
-
- fullProtocol ifTrue:[
- "
- remove any bold attribute from classList
- "
- 1 to:classListView list size do:[:i |
- classListView attributeAt:i remove:#bold.
- ].
- "
- boldify the class where this method is implemented
- "
- currentMethod notNil ifTrue:[
- cls := currentMethod who at:1.
- index := classListView list indexOf:(cls name).
- (index == 0
- and:[cls isMeta
- and:[cls name endsWith:'class']]) ifTrue:[
- index := classListView list indexOf:(cls name copyWithoutLast:5).
- ].
- index ~~ 0 ifTrue:[
- classListView attributeAt:index add:#bold.
- ].
- currentClass := acceptClass := cls.
- ]
- ].
+ |index cls|
+
+ self updateCodeView.
+ aspect := nil.
+ self setAcceptAndExplainActionsForMethod.
+
+ "
+ if there is any autoSearch string, do the search
+ "
+ autoSearch notNil ifTrue:[
+ codeView searchFwd:autoSearch startingAtLine:1 col:0 ifAbsent:[]
+ ].
+
+ fullProtocol ifTrue:[
+ "
+ remove any bold attribute from classList
+ "
+ 1 to:classListView list size do:[:i |
+ classListView attributeAt:i remove:#bold.
+ ].
+ "
+ boldify the class where this method is implemented
+ "
+ currentMethod notNil ifTrue:[
+ cls := currentMethod who at:1.
+ index := classListView list indexOf:(cls name).
+ (index == 0
+ and:[cls isMeta
+ and:[cls name endsWith:'class']]) ifTrue:[
+ index := classListView list indexOf:(cls name copyWithoutLast:5).
+ ].
+ index ~~ 0 ifTrue:[
+ classListView attributeAt:index add:#bold.
+ ].
+ currentClass := acceptClass := cls.
+ ]
+ ].
]
"Created: 23.11.1995 / 14:17:44 / cg"
@@ -4692,20 +4692,20 @@
|code|
fullClass ifTrue:[
- currentClass notNil ifTrue:[
- code := currentClass source.
- ]
+ currentClass notNil ifTrue:[
+ code := currentClass source.
+ ]
] ifFalse:[
- currentMethod notNil ifTrue:[
- (codeView acceptAction isNil
- and:[actualClass notNil
- and:[currentMethodCategory notNil]]) ifTrue:[
- self setAcceptAndExplainActionsForMethod.
- ].
-
- code := currentMethod source.
-
- ]
+ currentMethod notNil ifTrue:[
+ (codeView acceptAction isNil
+ and:[actualClass notNil
+ and:[currentMethodCategory notNil]]) ifTrue:[
+ self setAcceptAndExplainActionsForMethod.
+ ].
+
+ code := currentMethod source.
+
+ ]
].
codeView contents:code.
codeView modified:false.
@@ -4775,9 +4775,9 @@
string := self askForSelectorTitle:title.
string notNil ifTrue:[
- self withSearchCursorDo:[
- SystemBrowser perform:selector with:string
- ]
+ self withSearchCursorDo:[
+ SystemBrowser perform:selector with:string
+ ]
].
"Created: 23.11.1995 / 14:11:34 / cg"
@@ -4791,9 +4791,9 @@
string := self askForSelectorTitle:title.
string notNil ifTrue:[
- self withSearchCursorDo:[
- SystemBrowser perform:selector with:string with:arg
- ]
+ self withSearchCursorDo:[
+ SystemBrowser perform:selector with:string with:arg
+ ]
].
"Created: 23.11.1995 / 14:11:38 / cg"
@@ -4805,27 +4805,67 @@
self label:('System Browser - ' , (resources string:what with:someArgument))
!
-checkSelectionChangeAllowed
+checkSelectionChangeAllowedWithCompare:compareOffered
"return true, if selection change is ok;
its not ok, if code has been changed.
in this case, return the result of a user query"
- |action|
+ |action labels values|
codeView modified ifFalse:[
^ true
].
+
+ compareOffered ifTrue:[
+ labels := #('abort' 'compare' 'accept' 'continue').
+ values := #(false #compare #accept true).
+ ] ifFalse:[
+ labels := #('abort' 'accept' 'continue').
+ values := #(false #accept true).
+ ].
+
action := OptionBox
request:(resources at:'text has not been accepted.\\Your modifications will be lost when continuing.') withCRs
label:(resources string:'Attention')
form:(WarningBox iconBitmap)
- buttonLabels:(resources array:#('abort' 'accept' 'continue'))
- values:#(false #accept true)
+ buttonLabels:(resources array:labels)
+ values:values
default:true.
action ~~ #accept ifTrue:[
^ action
].
- codeView accept. ^ true
+ codeView accept.
+ ^ true
+
+ "Created: 24.11.1995 / 10:54:46 / cg"
+!
+
+checkSelectionChangeAllowed
+ "return true, if selection change is ok;
+ its not ok, if code has been changed.
+ in this case, return the result of a user query"
+
+ |what m src v|
+
+ currentMethod notNil ifTrue:[
+ m := actualClass compiledMethodAt:currentSelector.
+ (src := m source) = codeView contents ifFalse:[
+ what := self checkSelectionChangeAllowedWithCompare:true.
+ what == #compare ifTrue:[
+ v := DiffTextView
+ openOn:codeView contents label:'code here (to be accepted ?)'
+ and:src label:'methods actual code'.
+ v label:'comparing method versions'.
+ ^ false
+ ].
+ ^ what
+ ]
+ ].
+
+ ^ self checkSelectionChangeAllowedWithCompare:false
+
+ "Created: 24.11.1995 / 11:03:33 / cg"
+ "Modified: 24.11.1995 / 11:05:49 / cg"
!
classHierarchyDo:aBlock
@@ -5291,30 +5331,30 @@
"show an enterbox for instVar to search for"
self doClassMenu:[:currentClass |
- |box|
-
- box := self enterBoxForVariableSearch:title.
- box action:[:aVariableName |
- |homeClass|
-
- aVariableName isEmpty ifFalse:[
- self withSearchCursorDo:[
- homeClass := self findClassOfVariable:aVariableName accessWith:access.
- access == #classVarNames ifTrue:[
- SystemBrowser
- browseClassRefsTo:aVariableName
- under:homeClass
- modificationsOnly:modifications
- ] ifFalse:[
- SystemBrowser
- browseInstRefsTo:aVariableName
- under:homeClass
- modificationsOnly:modifications
- ]
- ]
- ]
- ].
- box showAtPointer
+ |box|
+
+ box := self enterBoxForVariableSearch:title.
+ box action:[:aVariableName |
+ |homeClass|
+
+ aVariableName isEmpty ifFalse:[
+ self withSearchCursorDo:[
+ homeClass := self findClassOfVariable:aVariableName accessWith:access.
+ access == #classVarNames ifTrue:[
+ SystemBrowser
+ browseClassRefsTo:aVariableName
+ under:homeClass
+ modificationsOnly:modifications
+ ] ifFalse:[
+ SystemBrowser
+ browseInstRefsTo:aVariableName
+ under:homeClass
+ modificationsOnly:modifications
+ ]
+ ]
+ ]
+ ].
+ box showAtPointer
]
"Created: 23.11.1995 / 14:13:24 / cg"
@@ -5370,20 +5410,20 @@
"show an enterbox for classVar to search for"
self doClassMenu:[:currentClass |
- |box|
-
- box := self enterBoxForVariableSearch:title.
- box action:[:aString |
- aString notEmpty ifTrue:[
- self withSearchCursorDo:[
- SystemBrowser
- browseClassRefsTo:aString
- in:(Array with:currentClass)
- modificationsOnly:mods
- ]
- ]
- ].
- box showAtPointer
+ |box|
+
+ box := self enterBoxForVariableSearch:title.
+ box action:[:aString |
+ aString notEmpty ifTrue:[
+ self withSearchCursorDo:[
+ SystemBrowser
+ browseClassRefsTo:aString
+ in:(Array with:currentClass)
+ modificationsOnly:mods
+ ]
+ ]
+ ].
+ box showAtPointer
]
"Created: 23.11.1995 / 14:12:56 / cg"
@@ -5423,20 +5463,20 @@
"show an enterbox for instvar to search for"
self doClassMenu:[:currentClass |
- |box|
-
- box := self enterBoxForVariableSearch:title.
- box action:[:aString |
- aString notEmpty ifTrue:[
- self withSearchCursorDo:[
- SystemBrowser
- browseInstRefsTo:aString
- in:(Array with:currentClass)
- modificationsOnly:mods
- ]
- ]
- ].
- box showAtPointer
+ |box|
+
+ box := self enterBoxForVariableSearch:title.
+ box action:[:aString |
+ aString notEmpty ifTrue:[
+ self withSearchCursorDo:[
+ SystemBrowser
+ browseInstRefsTo:aString
+ in:(Array with:currentClass)
+ modificationsOnly:mods
+ ]
+ ]
+ ].
+ box showAtPointer
]
"Created: 23.11.1995 / 14:12:40 / cg"
@@ -5657,73 +5697,73 @@
name isNil ifTrue:[^ self].
self withSearchCursorDo:[
- |classes filter any|
-
- classes := Array with:actualClass.
- currentClassHierarchy notNil ifTrue:[
- classes := classes , actualClass allSuperclasses.
- redefinedSelectors := IdentitySet new.
- ].
-
- filter := SystemBrowser filterToSearchRefsTo:name classVars:showInstance not modificationsOnly:false.
-
- any := false.
- "
- highlight the method that ref this variable
- "
- classes do:[:someClass |
- (fullProtocol
- and:[classListView valueIsInSelection:(someClass name)]) ifFalse:[
- someClass methodArray with:someClass selectorArray
- do:[:method :selector |
-
- (inCat
- or:[methodListView list notNil
- and:[methodListView list includes:selector]])
- ifTrue:[
- (redefinedSelectors isNil
- or:[(redefinedSelectors includes:selector) not])
- ifTrue:[
- (filter value:someClass value:method value:selector) ifTrue:[
- |idx cat|
-
- (inCat
- and:[methodCategoryListView notNil
- and:[methodCategoryListView list notNil]]) ifTrue:[
- cat := method category.
- "
- highlight the methodCategory
- "
- idx := methodCategoryListView list indexOf:cat.
- idx ~~ 0 ifTrue:[
- methodCategoryListView attributeAt:idx put:#bold.
- ].
- ].
-
- (inMethods
- and:[methodListView notNil
- and:[methodListView list notNil]]) ifTrue:[
- "
- highlight the method
- "
- idx := methodListView list indexOf:selector.
- idx ~~ 0 ifTrue:[
- methodListView attributeAt:idx put:#bold.
- ].
- any := true
- ].
- ].
- redefinedSelectors notNil ifTrue:[
- redefinedSelectors add:selector
- ]
- ]
- ]
- ]
- ]
- ].
- any ifTrue:[
- self setSearchPattern:name
- ]
+ |classes filter any|
+
+ classes := Array with:actualClass.
+ currentClassHierarchy notNil ifTrue:[
+ classes := classes , actualClass allSuperclasses.
+ redefinedSelectors := IdentitySet new.
+ ].
+
+ filter := SystemBrowser filterToSearchRefsTo:name classVars:showInstance not modificationsOnly:false.
+
+ any := false.
+ "
+ highlight the method that ref this variable
+ "
+ classes do:[:someClass |
+ (fullProtocol
+ and:[classListView valueIsInSelection:(someClass name)]) ifFalse:[
+ someClass methodArray with:someClass selectorArray
+ do:[:method :selector |
+
+ (inCat
+ or:[methodListView list notNil
+ and:[methodListView list includes:selector]])
+ ifTrue:[
+ (redefinedSelectors isNil
+ or:[(redefinedSelectors includes:selector) not])
+ ifTrue:[
+ (filter value:someClass value:method value:selector) ifTrue:[
+ |idx cat|
+
+ (inCat
+ and:[methodCategoryListView notNil
+ and:[methodCategoryListView list notNil]]) ifTrue:[
+ cat := method category.
+ "
+ highlight the methodCategory
+ "
+ idx := methodCategoryListView list indexOf:cat.
+ idx ~~ 0 ifTrue:[
+ methodCategoryListView attributeAt:idx put:#bold.
+ ].
+ ].
+
+ (inMethods
+ and:[methodListView notNil
+ and:[methodListView list notNil]]) ifTrue:[
+ "
+ highlight the method
+ "
+ idx := methodListView list indexOf:selector.
+ idx ~~ 0 ifTrue:[
+ methodListView attributeAt:idx put:#bold.
+ ].
+ any := true
+ ].
+ ].
+ redefinedSelectors notNil ifTrue:[
+ redefinedSelectors add:selector
+ ]
+ ]
+ ]
+ ]
+ ]
+ ].
+ any ifTrue:[
+ self setSearchPattern:name
+ ]
]
"Created: 23.11.1995 / 14:12:08 / cg"
@@ -5820,5 +5860,5 @@
!BrowserView class methodsFor:'documentation'!
version
-^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.48 1995-11-23 17:50:00 cg Exp $'! !
+^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.49 1995-11-24 10:30:53 cg Exp $'! !
BrowserView initialize!