NewInspectorView.st
changeset 1213 6cf7a4c2dfce
parent 811 911e51013604
child 2298 d5467f85544f
equal deleted inserted replaced
1212:a13dafe6f9fe 1213:6cf7a4c2dfce
    12 
    12 
    13 
    13 
    14 
    14 
    15 "{ NameSpace: NewInspector }"
    15 "{ NameSpace: NewInspector }"
    16 
    16 
    17 VariableVerticalPanel subclass:#InspectorView
    17 VariableVerticalPanel subclass:#NewInspectorView
    18 	instanceVariableNames:'inspectorView userSpace workSpace inspectedObject'
    18 	instanceVariableNames:'inspectorView userSpace workSpace inspectedObject'
    19 	classVariableNames:''
    19 	classVariableNames:''
    20 	poolDictionaries:''
    20 	poolDictionaries:''
    21 	category:'Interface-Inspector'
    21 	category:'Interface-NewInspector'
    22 !
    22 !
    23 
    23 
    24 !InspectorView class methodsFor:'documentation'!
    24 !NewInspectorView class methodsFor:'documentation'!
    25 
    25 
    26 copyright
    26 copyright
    27 "
    27 "
    28  COPYRIGHT (c) 1997 by eXept Software AG
    28  COPYRIGHT (c) 1997 by eXept Software AG
    29               All Rights Reserved
    29               All Rights Reserved
    41 
    41 
    42 documentation
    42 documentation
    43 "
    43 "
    44     a new (multipane) inspector;
    44     a new (multipane) inspector;
    45     open with:
    45     open with:
    46         NewInspector::InspectorView inspect:someObject
    46         NewInspector::NewInspectorView inspect:someObject
    47 
    47 
    48     install as standard inspector:
    48     install as standard inspector:
    49         Smalltalk at:#Inspector put:(NewInspector::InspectorView)
    49         Smalltalk at:#Inspector put:(NewInspector::NewInspectorView)
    50 
    50 
    51     [open with:]
    51     [open with:]
    52         NewInspector::InspectorView 
    52         NewInspector::NewInspectorView 
    53                 inspect:(Array with:#hello with:'hello' with:#(1 2 3) asSortedCollection with:Display)
    53                 inspect:(Array with:#hello with:'hello' with:#(1 2 3) asSortedCollection with:Display)
    54 
    54 
    55     [author:]
    55     [author:]
    56         Claus Atzkern
    56         Claus Atzkern
    57 "
    57 "
    64                                                                         [exBegin]
    64                                                                         [exBegin]
    65     |array|
    65     |array|
    66 
    66 
    67     array := Array new:5.
    67     array := Array new:5.
    68     array at:1 put:(Array new:400).
    68     array at:1 put:(Array new:400).
    69     NewInspector::InspectorView inspect:array
    69     NewInspector::NewInspectorView inspect:array
    70                                                                         [exEnd]
    70                                                                         [exEnd]
    71 "
    71 "
    72 ! !
    72 ! !
    73 
    73 
    74 !InspectorView class methodsFor:'instance creation'!
    74 !NewInspectorView class methodsFor:'instance creation'!
    75 
    75 
    76 inspect:anObject
    76 inspect:anObject
    77     "start inspector on an instance
    77     "start inspector on an instance
    78     "
    78     "
    79     ^ self openOn:anObject
    79     ^ self openOn:anObject
    84     "
    84     "
    85 
    85 
    86     |top isp|
    86     |top isp|
    87 
    87 
    88     top := StandardSystemView new extent:600@400.
    88     top := StandardSystemView new extent:600@400.
    89     isp := InspectorView origin:0.0@0.0  corner:1.0@1.0 in:top.
    89     isp := NewInspectorView origin:0.0@0.0  corner:1.0@1.0 in:top.
    90     isp inspect:anObject.
    90     isp inspect:anObject.
    91     top open.
    91     top open.
    92 
    92 
    93     ^ isp.
    93     ^ isp.
    94 ! !
    94 ! !
    95 
    95 
    96 !InspectorView methodsFor:'accessing'!
    96 !NewInspectorView methodsFor:'accessing'!
    97 
    97 
    98 inspect:anInstance
    98 inspect:anInstance
    99 
    99 
   100     inspectedObject := anInstance.
   100     inspectedObject := anInstance.
   101     self topView label:(inspectedObject class name asString).
   101     self topView label:(inspectedObject class name asString).
   102     inspectorView inspect:anInstance.
   102     inspectorView inspect:anInstance.
   103     self updateWorkSpace.
   103     self updateWorkSpace.
   104 
   104 
   105 ! !
   105 ! !
   106 
   106 
   107 !InspectorView methodsFor:'initialization'!
   107 !NewInspectorView methodsFor:'initialization'!
   108 
   108 
   109 initialize
   109 initialize
   110     |view wsHeight|
   110     |view wsHeight|
   111 
   111 
   112     super initialize.
   112     super initialize.
   113 
   113 
   114     view := SimpleView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:self.
   114     view := SimpleView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:self.
   115 
   115 
   116     inspectorView := InspectorPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:view.
   116     inspectorView := NewInspectorPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:view.
   117     workSpace     := Workspace          origin:0.0 @ 1.0 corner:1.0 @ 1.0 in:view.
   117     workSpace     := Workspace          origin:0.0 @ 1.0 corner:1.0 @ 1.0 in:view.
   118     userSpace     := Workspace          origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:self.
   118     userSpace     := Workspace          origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:self.
   119 
   119 
   120     wsHeight := (workSpace preferredExtentForLines:1 cols:10) y.
   120     wsHeight := (workSpace preferredExtentForLines:1 cols:10) y.
   121     workSpace     topInset:wsHeight negated.
   121     workSpace     topInset:wsHeight negated.
   134     ].
   134     ].
   135 
   135 
   136     "Modified: 18.3.1997 / 10:57:34 / cg"
   136     "Modified: 18.3.1997 / 10:57:34 / cg"
   137 ! !
   137 ! !
   138 
   138 
   139 !InspectorView methodsFor:'update'!
   139 !NewInspectorView methodsFor:'update'!
   140 
   140 
   141 updateWorkSpace
   141 updateWorkSpace
   142     "update the workSpace
   142     "update the workSpace
   143     "
   143     "
   144     workSpace list:(Array with:(inspectorView selectedInstanceVar displayString)).
   144     workSpace list:(Array with:(inspectorView selectedInstanceVar displayString)).
   145 ! !
   145 ! !
   146 
   146 
   147 !InspectorView class methodsFor:'documentation'!
   147 !NewInspectorView class methodsFor:'documentation'!
   148 
   148 
   149 version
   149 version
   150     ^ '$Header$'
   150     ^ '$Header$'
   151 ! !
   151 ! !