tools/JavaSetInspectorView.st
author vranyj1
Mon, 03 Dec 2012 22:09:19 +0000
branchdevelopment
changeset 1859 4d42d0099c74
parent 1818 2e5ed72e7dfd
child 1879 7d232ff32dde
permissions -rw-r--r--
Ignore tests in MemberVisibilityTests (package-private methods not yet supported)

"{ Package: 'stx:libjava/tools' }"

SetInspectorView subclass:#JavaSetInspectorView
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Java-Tools-Inspectors'
!


!JavaSetInspectorView methodsFor:'private'!

baseInspectedObjectClass

    | cls |
    cls := inspectedObject class.
    [ cls name startsWith: 'java/util/' ] whileFalse:[
        cls := cls superclass.
    ].
    ^cls.

    "Created: / 04-12-2011 / 17:02:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

indexList 
    "return a list of indexes to show in the selectionList.
     Set hasMore to true, if a '...' entry should be added."

    | coll iterator | 

    coll := OrderedCollection new.
    iterator := inspectedObject perform: #'iterator()Ljava/util/Iterator;'.
    [ ( iterator perform: #'hasNext()Z' ) == 1 ] whileTrue:[
        coll add: ( iterator perform: #'next()Ljava/lang/Object;' ).
        coll size >= nShown ifTrue:[ 
            hasMore := true.
            ^ coll asSortedCollection:[:a :b | a displayString < b displayString].
        ].
    ].
    ^coll asSortedCollection:[:a :b | a displayString < b displayString].

    "Created: / 04-12-2011 / 17:57:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!JavaSetInspectorView class methodsFor:'documentation'!

version_SVN
    ^ '$Id$'
! !