SystemOrganization addCategory: #'OB-Inspector-Browser'! SystemOrganization addCategory: #'OB-Inspector-Nodes'! SystemOrganization addCategory: #'OB-Inspector-Actors'! OBNode subclass: #OBInspectorNode instanceVariableNames: 'object' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Nodes'! OBInspectorNode subclass: #OBDerivedInspectorNode instanceVariableNames: 'label value' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Nodes'! !OBDerivedInspectorNode class methodsFor: 'instance creation' stamp: 'lr 3/4/2006 17:18'! on: anObject label: aString ^ (self on: anObject) setLabel: aString; yourself.! ! !OBDerivedInspectorNode methodsFor: 'accessing' stamp: 'lr 3/4/2006 16:34'! label ^ label! ! !OBDerivedInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 16:48'! name ^ '(' , self label , ')'! ! !OBDerivedInspectorNode methodsFor: 'initialization' stamp: 'lr 3/4/2006 16:34'! setLabel: aString label := aString! ! !OBInspectorNode class methodsFor: 'instance creation' stamp: 'lr 3/4/2006 00:08'! on: anObject ^ self new setObject: anObject.! ! !OBInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 18:49'! actions ^ { self action: #inspect withLabel: 'inspect'. self action: #browse withLabel: 'browse'. self action: #browseHierarchically withLabel: 'browse hierarchy'. }! ! !OBInspectorNode methodsFor: 'drag and drop' stamp: 'lr 3/4/2006 17:43'! asDraggableMorph ^ super asDraggableMorph contents: self text; yourself.! ! !OBInspectorNode methodsFor: 'actions' stamp: 'lr 3/4/2006 18:48'! browse OBSystemBrowser openOnClass: self value class! ! !OBInspectorNode methodsFor: 'actions' stamp: 'lr 3/4/2006 18:48'! browseHierarchically OBHierarchyBrowser openOnClass: self value class.! ! !OBInspectorNode methodsFor: 'private' stamp: 'lr 3/4/2006 18:28'! compile: aString ^ self object class compilerClass evaluate: aString for: self object logged: false! ! !OBInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 19:23'! doItReceiver ^ self object! ! !OBInspectorNode methodsFor: 'drag and drop' stamp: 'lr 3/4/2006 17:36'! dropSelector ^ #dropOnInspectorNode:! ! !OBInspectorNode methodsFor: 'navigation' stamp: 'lr 3/4/2006 17:46'! elements ^ [ self value inspectorNodes ] ifError: [ #() ]! ! !OBInspectorNode methodsFor: 'navigation' stamp: 'lr 3/4/2006 17:46'! extras ^ [ self value extraInspectorNodes ] ifError: [ #() ]! ! !OBInspectorNode methodsFor: 'actions' stamp: 'lr 3/4/2006 18:48'! inspect OBInspector openOn: self value! ! !OBInspectorNode methodsFor: 'testing' stamp: 'lr 3/4/2006 15:30'! isWriteable ^ false! ! !OBInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 00:07'! object ^ object! ! !OBInspectorNode methodsFor: 'initialization' stamp: 'lr 3/4/2006 00:06'! setObject: anObject object := anObject! ! !OBInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 17:09'! text ^ self value asString! ! !OBInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 17:05'! value ^ self object! ! OBInspectorNode subclass: #OBWriteableInsepctorNode instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Nodes'! OBWriteableInsepctorNode subclass: #OBBasicInspectorNode instanceVariableNames: 'index' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Nodes'! !OBBasicInspectorNode class methodsFor: 'instance creation' stamp: 'lr 3/4/2006 16:52'! on: anObject index: anInteger ^ (self on: anObject) setIndex: anInteger; yourself.! ! !OBBasicInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 16:22'! index ^ index! ! !OBBasicInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 16:23'! name ^ self index asString! ! !OBBasicInspectorNode methodsFor: 'initialization' stamp: 'lr 3/4/2006 16:22'! setIndex: anInteger index := anInteger! ! !OBBasicInspectorNode methodsFor: 'accessing' stamp: 'lr 3/4/2006 16:23'! value ^ self object basicAt: self index! ! !OBBasicInspectorNode methodsFor: 'accessing' stamp: 'lr 3/4/2006 16:23'! value: anObject self object basicAt: self index put: anObject! ! OBBasicInspectorNode subclass: #OBNamedInspectorNode instanceVariableNames: 'name' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Nodes'! !OBNamedInspectorNode class methodsFor: 'instance creation' stamp: 'lr 3/4/2006 16:53'! on: anObject index: anInteger name: aString ^ (self on: anObject index: anInteger) setName: aString; yourself.! ! !OBNamedInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 00:07'! name ^ name! ! !OBNamedInspectorNode methodsFor: 'initialization' stamp: 'lr 3/4/2006 00:03'! setName: aString name := aString! ! !OBNamedInspectorNode methodsFor: 'accessing' stamp: 'lr 3/4/2006 00:05'! value ^ self object instVarAt: self index! ! !OBNamedInspectorNode methodsFor: 'accessing' stamp: 'lr 3/4/2006 00:06'! value: anObject ^ self object instVarAt: self index put: anObject! ! OBWriteableInsepctorNode subclass: #OBDictionaryInspectorNode instanceVariableNames: 'key' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Nodes'! !OBDictionaryInspectorNode class methodsFor: 'instance creation' stamp: 'lr 3/4/2006 17:55'! on: anObject key: aKey ^ (self on: anObject) setKey: aKey; yourself.! ! !OBDictionaryInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 17:54'! key ^ key! ! !OBDictionaryInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 17:54'! name ^ self key asString! ! !OBDictionaryInspectorNode methodsFor: 'initialization' stamp: 'lr 3/4/2006 17:53'! setKey: anObject key := anObject! ! !OBDictionaryInspectorNode methodsFor: 'accessing' stamp: 'lr 3/4/2006 17:53'! value ^ self object at: self key! ! !OBDictionaryInspectorNode methodsFor: 'accessing' stamp: 'lr 3/4/2006 17:53'! value: anObject self object at: self key put: anObject! ! OBWriteableInsepctorNode subclass: #OBSequenceInspectorNode instanceVariableNames: 'index' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Nodes'! OBSequenceInspectorNode subclass: #OBArrayInspectorNode instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Nodes'! !OBArrayInspectorNode methodsFor: 'private' stamp: 'lr 3/4/2006 18:42'! add: anObject at: anInteger | newObject | newObject := self object class new: self object size + 1. newObject at: anInteger put: anObject; replaceFrom: 1 to: anInteger - 1 with: self object startingAt: 1; replaceFrom: anInteger + 1 to: newObject size with: self object startingAt: anInteger. self object become: newObject! ! !OBArrayInspectorNode methodsFor: 'private' stamp: 'lr 3/4/2006 18:42'! removeAt: anInteger | newObject | newObject := self object class new: self object size - 1. newObject replaceFrom: 1 to: anInteger - 1 with: self object startingAt: 1; replaceFrom: anInteger to: newObject size with: self object startingAt: anInteger + 1. self object become: newObject! ! !OBSequenceInspectorNode class methodsFor: 'instance creation' stamp: 'lr 3/4/2006 16:58'! on: anObject index: anInteger ^ (self on: anObject) setIndex: anInteger; yourself! ! !OBSequenceInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 18:43'! actions ^ super actions , { self action: #add withLabel: 'add...'. self action: #remove withLabel: 'remove' }! ! !OBSequenceInspectorNode methodsFor: 'actions' stamp: 'lr 3/4/2006 18:40'! add | request | request := OBTextRequest prompt: 'Enter expression:' template: ''. request isNil ifFalse: [ self add: (self compile: request) at: self index. self demandSelection ].! ! !OBSequenceInspectorNode methodsFor: 'private' stamp: 'lr 3/4/2006 18:21'! add: anObject at: anInteger self object add: anObject beforeIndex: anInteger! ! !OBSequenceInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 16:58'! index ^ index! ! !OBSequenceInspectorNode methodsFor: 'public' stamp: 'lr 3/4/2006 16:58'! name ^ self index asString! ! !OBSequenceInspectorNode methodsFor: 'actions' stamp: 'lr 3/4/2006 18:23'! remove self removeAt: self index. self demandSelection.! ! !OBSequenceInspectorNode methodsFor: 'private' stamp: 'lr 3/4/2006 18:21'! removeAt: anInteger self object removeAt: anInteger! ! !OBSequenceInspectorNode methodsFor: 'initialization' stamp: 'lr 3/4/2006 16:58'! setIndex: anInteger index := anInteger! ! !OBSequenceInspectorNode methodsFor: 'accessing' stamp: 'lr 3/4/2006 16:57'! value ^ self object at: self index! ! !OBSequenceInspectorNode methodsFor: 'accessing' stamp: 'lr 3/4/2006 16:57'! value: anObject self object at: self index put: anObject! ! !OBWriteableInsepctorNode methodsFor: 'drag and drop' stamp: 'lr 3/4/2006 17:51'! dropOnInspectorNode: aNode aNode value: self value; demandSelection.! ! !OBWriteableInsepctorNode methodsFor: 'testing' stamp: 'lr 3/4/2006 15:31'! isWriteable ^ true! ! !OBWriteableInsepctorNode methodsFor: 'public' stamp: 'lr 3/4/2006 18:27'! text: aText self value: (self compile: aText). self demandSelection. ^ true! ! !Dictionary methodsFor: '*ob-inspector' stamp: 'lr 3/4/2006 17:57'! inspectorNodes ^ Array streamContents: [ :stream | self keysDo: [ :each | stream nextPut: (OBDictionaryInspectorNode on: self key: each) ] ].! ! !Object methodsFor: '*ob-inspector' stamp: 'lr 3/4/2006 16:55'! basicInspectorNodes ^ Array streamContents: [ :stream | self class allInstVarNames withIndexDo: [ :each :index | stream nextPut: (OBNamedInspectorNode on: self index: index name: each) ]. 1 to: self basicSize do: [ :index | stream nextPut: (OBBasicInspectorNode on: self index: index) ] ]! ! !Object methodsFor: '*ob-inspector' stamp: 'lr 3/4/2006 17:20'! extraInspectorNodes ^ OrderedCollection with: (OBDerivedInspectorNode on: self label: 'self')! ! !Object methodsFor: '*ob-inspector' stamp: 'lr 3/4/2006 16:55'! inspectorNodes ^ self basicInspectorNodes! ! OBBrowser subclass: #OBInspector instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Browser'! !OBInspector class methodsFor: 'configuration' stamp: 'lr 3/4/2006 19:29'! defaultMetaNode | element extra | element := OBMetaNode named: 'Element'. extra := OBMetaNode named: 'Extra'. element childAt: #extras put: extra; childAt: #elements labeled: 'elements' put: element; addActor: OBBrowserInspectorActor new; addActor: OBElementInspectorActor new. extra addActor: OBBrowserInspectorActor new; addActor: OBElementInspectorActor new. ^ element! ! !OBInspector class methodsFor: 'instance creation' stamp: 'lr 3/4/2006 17:06'! on: anObject ^ super root: (OBInspectorNode on: anObject)! ! !OBInspector class methodsFor: 'opening' stamp: 'lr 3/3/2006 23:34'! openOn: anObject ^ (self on: anObject) open! ! !OBInspector class methodsFor: 'configuration' stamp: 'lr 3/4/2006 17:33'! paneCount ^ 2! ! !OBInspector class methodsFor: 'configuration' stamp: 'lr 3/3/2006 23:32'! title ^ 'Inspector'! ! !OBInspector methodsFor: 'morphic' stamp: 'lr 3/4/2006 17:33'! initialExtent ^ 350 @ 350! ! !Fraction methodsFor: '*ob-inspector' stamp: 'lr 3/4/2006 17:21'! extraInspectorNodes ^ super extraInspectorNodes add: (OBDerivedInspectorNode on: self asFloat label: 'asFloat'); yourself! ! !OrderedCollection methodsFor: '*ob-inspector' stamp: 'lr 3/4/2006 17:00'! inspectorNodes ^ (1 to: self size) collect: [ :each | OBSequenceInspectorNode on: self index: each ]! ! !Integer methodsFor: '*ob-inspector' stamp: 'lr 3/4/2006 17:21'! extraInspectorNodes ^ super extraInspectorNodes add: (OBDerivedInspectorNode on: (self printStringRadix: 16) label: 'hexadecimal'); add: (OBDerivedInspectorNode on: (self printStringRadix: 8) label: 'octal'); add: (OBDerivedInspectorNode on: (self printStringRadix: 2) label: 'binary'); yourself! ! !ArrayedCollection methodsFor: '*ob-inspector' stamp: 'lr 3/4/2006 17:00'! inspectorNodes ^ (1 to: self size) collect: [ :each | OBArrayInspectorNode on: self index: each ].! ! OBActor subclass: #OBBrowserInspectorActor instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Actors'! !OBBrowserInspectorActor methodsFor: 'public' stamp: 'lr 3/4/2006 19:32'! actionsForNode: aNode ^ Array with: (OBAction label: 'browse full' receiver: self selector: #browseFull: arguments: { aNode } keystroke: $b) with: (OBAction label: 'browse hierarchy' receiver: self selector: #browseHierarchy: arguments: { aNode } keystroke: $h)! ! !OBBrowserInspectorActor methodsFor: 'actions' stamp: 'lr 3/4/2006 18:56'! browseFull: aNode OBSystemBrowser openOnClass: aNode value class! ! !OBBrowserInspectorActor methodsFor: 'actions' stamp: 'lr 3/4/2006 19:13'! browseHierarchy: aNode OBHierarchyBrowser openOnClass: aNode value class! ! OBActor subclass: #OBElementInspectorActor instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OB-Inspector-Actors'! !OBElementInspectorActor methodsFor: 'public' stamp: 'lr 3/4/2006 19:31'! actionsForNode: aNode ^ Array with: (OBAction label: 'inspect' receiver: self selector: #inspect: arguments: { aNode } keystroke: $i) with: (OBAction label: 'inspect references' receiver: self selector: #inspectReferences: arguments: { aNode })! ! !OBElementInspectorActor methodsFor: 'actions' stamp: 'lr 3/4/2006 19:35'! inspectReferences: aNode OBInspector openOn: (Utilities pointersTo: aNode value value except: { aNode })! ! !OBElementInspectorActor methodsFor: 'actions' stamp: 'lr 3/4/2006 19:30'! inspect: aNode OBInspector openOn: aNode value! !