OCInspView.st
author claus
Sat, 08 Jan 1994 18:30:44 +0100
changeset 18 850295468cac
child 23 3363884b8e9f
permissions -rw-r--r--
Initial revision

"
 COPYRIGHT (c) 1989 by Claus Gittinger
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

InspectorView subclass:#OrderedCollectionInspectorView
	 instanceVariableNames:''
	 classVariableNames:''
	 poolDictionaries:''
	 category:'Interface-Inspector'
!

!OrderedCollectionInspectorView methodsFor:'user interaction'!

showSelection:lineNr
    "user clicked on an instvar - show value in workspace"

    |val string|

    workspace contents:nil.
    lineNr == 1 ifTrue:[
        val := inspectedObject
    ] ifFalse:[
        val := inspectedObject at:(lineNr - 1)
    ].
    string := val displayString.
    workspace show:string.
    selectedLine := lineNr
! !

!OrderedCollectionInspectorView methodsFor:'accessing'!

listOfNames
    "return a list of names to show in the selectionList"

    |aList n cut|

    aList := Text new.
    aList add:'self'.
    n := inspectedObject size.
    (n > nShown) ifTrue:[
        n := nShown.
        cut := true.
        listView setMiddleButtonMenu:menu2.
    ] ifFalse:[
        cut := false.
        listView setMiddleButtonMenu:menu1.
    ].
    1 to:n do:[:index |
        aList add:(index printString)
    ].
    cut ifTrue:[
        aList add:' ... '
    ].
    ^ aList
! !