NewInspectorList.st
changeset 1213 6cf7a4c2dfce
parent 1022 afd2ac9d1b55
child 2621 285fa261cbcb
equal deleted inserted replaced
1212:a13dafe6f9fe 1213:6cf7a4c2dfce
    11 "
    11 "
    12 
    12 
    13 
    13 
    14 "{ NameSpace: NewInspector }"
    14 "{ NameSpace: NewInspector }"
    15 
    15 
    16 Object subclass:#InspectorList
    16 Object subclass:#NewInspectorList
    17 	instanceVariableNames:'inspectedObject instanceNames instanceTypes selection'
    17 	instanceVariableNames:'inspectedObject instanceNames instanceTypes selection'
    18 	classVariableNames:''
    18 	classVariableNames:''
    19 	poolDictionaries:''
    19 	poolDictionaries:''
    20 	category:'Interface-Inspector'
    20 	category:'Interface-NewInspector'
    21 !
    21 !
    22 
    22 
    23 !InspectorList class methodsFor:'documentation'!
    23 !NewInspectorList class methodsFor:'documentation'!
    24 
    24 
    25 copyright
    25 copyright
    26 "
    26 "
    27  COPYRIGHT (c) 1997 by eXept Software AG
    27  COPYRIGHT (c) 1997 by eXept Software AG
    28               All Rights Reserved
    28               All Rights Reserved
    35  hereby transferred.
    35  hereby transferred.
    36 "
    36 "
    37 
    37 
    38 ! !
    38 ! !
    39 
    39 
    40 !InspectorList class methodsFor:'instance creation'!
    40 !NewInspectorList class methodsFor:'instance creation'!
    41 
    41 
    42 for:anObject
    42 for:anObject
    43     "create a new list for an instance
    43     "create a new list for an instance
    44     "
    44     "
    45     ^ self new inspect:anObject
    45     ^ self new inspect:anObject
    52     "
    52     "
    53     ^ self basicNew initialize.
    53     ^ self basicNew initialize.
    54 
    54 
    55 ! !
    55 ! !
    56 
    56 
    57 !InspectorList class methodsFor:'helpers'!
    57 !NewInspectorList class methodsFor:'helpers'!
    58 
    58 
    59 asString:aCollection
    59 asString:aCollection
    60     "converts any collection to a string seperated by spaces. If
    60     "converts any collection to a string seperated by spaces. If
    61      the collection is empty or nil, nil is returned otherwise a
    61      the collection is empty or nil, nil is returned otherwise a
    62      string.
    62      string.
    81     ^ nil
    81     ^ nil
    82 
    82 
    83 
    83 
    84 ! !
    84 ! !
    85 
    85 
    86 !InspectorList class methodsFor:'testing'!
    86 !NewInspectorList class methodsFor:'testing'!
    87 
    87 
    88 isDirectory:anInstance
    88 isDirectory:anInstance
    89     "returns true if the instance is a directory
    89     "returns true if the instance is a directory
    90     "
    90     "
    91     |cls|
    91     |cls|
   127     ].
   127     ].
   128     ^ false.
   128     ^ false.
   129 
   129 
   130 ! !
   130 ! !
   131 
   131 
   132 !InspectorList methodsFor:'accessing'!
   132 !NewInspectorList methodsFor:'accessing'!
   133 
   133 
   134 includesSelf:aBoolean
   134 includesSelf:aBoolean
   135     "includes 'self' dependant on the boolean
   135     "includes 'self' dependant on the boolean
   136     "
   136     "
   137     (self includesSelf) ~~ aBoolean ifTrue:[
   137     (self includesSelf) ~~ aBoolean ifTrue:[
   192     ]
   192     ]
   193 
   193 
   194     "Modified: / 4.2.1999 / 20:00:38 / cg"
   194     "Modified: / 4.2.1999 / 20:00:38 / cg"
   195 ! !
   195 ! !
   196 
   196 
   197 !InspectorList methodsFor:'accessing contents'!
   197 !NewInspectorList methodsFor:'accessing contents'!
   198 
   198 
   199 inspectedObject
   199 inspectedObject
   200     "returns current inspected object
   200     "returns current inspected object
   201     "
   201     "
   202     ^ inspectedObject
   202     ^ inspectedObject
   251     ^ nil
   251     ^ nil
   252 
   252 
   253 
   253 
   254 ! !
   254 ! !
   255 
   255 
   256 !InspectorList methodsFor:'initialization'!
   256 !NewInspectorList methodsFor:'initialization'!
   257 
   257 
   258 initialize
   258 initialize
   259     "initialize instance attributes
   259     "initialize instance attributes
   260     "
   260     "
   261     super initialize.
   261     super initialize.
   263     instanceNames := OrderedCollection new.
   263     instanceNames := OrderedCollection new.
   264     instanceTypes := OrderedCollection new.
   264     instanceTypes := OrderedCollection new.
   265 
   265 
   266 ! !
   266 ! !
   267 
   267 
   268 !InspectorList methodsFor:'private'!
   268 !NewInspectorList methodsFor:'private'!
   269 
   269 
   270 resizeTo:aNumber
   270 resizeTo:aNumber
   271     "resize list to minimum aNumber
   271     "resize list to minimum aNumber
   272     "
   272     "
   273     |lstVarId basicSize newLastId obj instSize|
   273     |lstVarId basicSize newLastId obj instSize|
   314         instanceNames add:'..'.
   314         instanceNames add:'..'.
   315         instanceTypes add:#grow
   315         instanceTypes add:#grow
   316     ].
   316     ].
   317 ! !
   317 ! !
   318 
   318 
   319 !InspectorList methodsFor:'selections'!
   319 !NewInspectorList methodsFor:'selections'!
   320 
   320 
   321 selectedInstanceType
   321 selectedInstanceType
   322     "returns type assigned to the selected list entry (#directory #normal #self #grow).
   322     "returns type assigned to the selected list entry (#directory #normal #self #grow).
   323      In case of no selection nil is returned.
   323      In case of no selection nil is returned.
   324     "
   324     "
   355             selection := nil
   355             selection := nil
   356         ]
   356         ]
   357     ]    
   357     ]    
   358 ! !
   358 ! !
   359 
   359 
   360 !InspectorList methodsFor:'testing'!
   360 !NewInspectorList methodsFor:'testing'!
   361 
   361 
   362 includesSelf
   362 includesSelf
   363     "returns true if 'self' is included in the list
   363     "returns true if 'self' is included in the list
   364     "
   364     "
   365     ^ (instanceTypes notEmpty and:[instanceTypes first == #self])
   365     ^ (instanceTypes notEmpty and:[instanceTypes first == #self])
   379     "
   379     "
   380     ^ instanceNames notEmpty
   380     ^ instanceNames notEmpty
   381 
   381 
   382 ! !
   382 ! !
   383 
   383 
   384 !InspectorList methodsFor:'user interaction'!
   384 !NewInspectorList methodsFor:'user interaction'!
   385 
   385 
   386 accept:aText notifying:aView
   386 accept:aText notifying:aView
   387     "evaluating aText on the selected instance var; if an error occurs #Error
   387     "evaluating aText on the selected instance var; if an error occurs #Error
   388      is returned otherwise the inspected object instance. On success the list
   388      is returned otherwise the inspected object instance. On success the list
   389      will be updated.
   389      will be updated.
   486         ]
   486         ]
   487     ].
   487     ].
   488     self update
   488     self update
   489 ! !
   489 ! !
   490 
   490 
   491 !InspectorList class methodsFor:'documentation'!
   491 !NewInspectorList class methodsFor:'documentation'!
   492 
   492 
   493 version
   493 version
   494     ^ '$Header$'
   494     ^ '$Header$'
   495 ! !
   495 ! !