NewInspectorView.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 14 Nov 2018 12:07:51 +0100
branchjv
changeset 3630 5e718e0a754e
parent 2621 285fa261cbcb
permissions -rw-r--r--
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present

- All source *.st files are now Unicode UTF8 without BOM
Files are in two groups (fileOut works this way in Smalltalk/X):
- containing a unicode character have "{ Encoding: utf8 }" at the header
- ASCII only are without the header
     1 "
     2  COPYRIGHT (c) 1997 by eXept Software AG
     3 	      All Rights Reserved
     4 
     5  This software is furnished under a license and may be used
     6  only in accordance with the terms of that license and with the
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    11 "
    12 "{ Package: 'stx:libtool2' }"
    13 
    14 "{ NameSpace: Tools }"
    15 
    16 VariableVerticalPanel subclass:#NewInspectorView
    17 	instanceVariableNames:'inspectorView userSpace workSpace inspectedObject'
    18 	classVariableNames:''
    19 	poolDictionaries:''
    20 	category:'Interface-NewInspector'
    21 !
    22 
    23 !NewInspectorView class methodsFor:'documentation'!
    24 
    25 copyright
    26 "
    27  COPYRIGHT (c) 1997 by eXept Software AG
    28 	      All Rights Reserved
    29 
    30  This software is furnished under a license and may be used
    31  only in accordance with the terms of that license and with the
    32  inclusion of the above copyright notice.   This software may not
    33  be provided or otherwise made available to, or used by, any
    34  other person.  No title to or ownership of the software is
    35  hereby transferred.
    36 "
    37 
    38 
    39 !
    40 
    41 documentation
    42 "
    43     a new (multipane) inspector;
    44     open with:
    45 	Tools::NewInspectorView inspect:Object
    46 
    47     install as standard inspector:
    48 	Smalltalk at:#Inspector put:(Tools::NewInspectorView)
    49 
    50     [open with:]
    51 	Tools::NewInspectorView
    52 		inspect:(Array with:#hello with:'hello' with:#(1 2 3) asSortedCollection with:Display)
    53 
    54     [author:]
    55 	Claus Atzkern
    56 "
    57 !
    58 
    59 examples
    60 
    61 "
    62     open an inspector on an array
    63 									[exBegin]
    64     |array|
    65 
    66     array := Array new:5.
    67     array at:1 put:(Array new:400).
    68     Tools::NewInspectorView inspect:array
    69 									[exEnd]
    70 "
    71 ! !
    72 
    73 !NewInspectorView class methodsFor:'instance creation'!
    74 
    75 inspect:anObject
    76     "start inspector on an instance
    77     "
    78     ^ self openOn:anObject
    79 !
    80 
    81 openOn:anObject
    82     "start an inspector on some object
    83     "
    84 
    85     |top isp|
    86 
    87     top := StandardSystemView new extent:600@400.
    88     isp := NewInspectorView origin:0.0@0.0  corner:1.0@1.0 in:top.
    89     isp inspect:anObject.
    90     top open.
    91 
    92     ^ isp.
    93 ! !
    94 
    95 !NewInspectorView methodsFor:'accessing'!
    96 
    97 inspect:anInstance
    98 
    99     inspectedObject := anInstance.
   100     self topView label:(inspectedObject class name asString).
   101     inspectorView inspect:anInstance.
   102     self updateWorkSpace.
   103 
   104 ! !
   105 
   106 !NewInspectorView methodsFor:'initialization'!
   107 
   108 initialize
   109     |view wsHeight|
   110 
   111     super initialize.
   112 
   113     view := SimpleView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:self.
   114 
   115     inspectorView := NewInspectorPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:view.
   116     workSpace     := Workspace          origin:0.0 @ 1.0 corner:1.0 @ 1.0 in:view.
   117     userSpace     := Workspace          origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:self.
   118 
   119     wsHeight := (workSpace preferredExtentForLines:1 cols:10) y.
   120     workSpace     topInset:wsHeight negated.
   121     inspectorView bottomInset:wsHeight.
   122 
   123     userSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace].
   124     workSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace].
   125 
   126     userSpace   doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace].
   127     workSpace   doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace].
   128 
   129     inspectorView action:[:el|self updateWorkSpace].
   130 
   131     inspectorView valueChangedAction:[:el||lbl|
   132 	workSpace list:(Array with:(el displayString)).
   133     ].
   134 
   135     "Modified: 18.3.1997 / 10:57:34 / cg"
   136 ! !
   137 
   138 !NewInspectorView methodsFor:'update'!
   139 
   140 updateWorkSpace
   141     "update the workSpace
   142     "
   143     workSpace list:(Array with:(inspectorView selectedInstanceVar displayString)).
   144 ! !
   145 
   146 !NewInspectorView class methodsFor:'documentation'!
   147 
   148 version
   149     ^ '$Header$'
   150 ! !