tools/JavaSetInspectorView.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 16 Sep 2013 14:09:52 +0100
branchdevelopment
changeset 2734 f56049613ff3
parent 2731 13f5be2bf83b
child 3231 1ce74dc95339
permissions -rw-r--r--
Initial support for live code checker / lint. JavaLintService parses the code as you type and displays all errors and other problems. This is done by running compiler in check mode in background. This also removes the necessity for JavaCompilerProblemRegistry.

"{ 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_CVS
    ^ '$Header: /cvs/stx/stx/libjava/tools/JavaSetInspectorView.st,v 1.3 2013-09-06 00:45:28 vrany Exp $'
!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_SVN
    ^ 'Id'
! !