SelectionInHierarchyView.st
author Claus Gittinger <cg@exept.de>
Sun, 08 May 2016 02:25:46 +0200
changeset 5082 87e1ffeceb8a
parent 3150 e3a55f15ef7e
child 4770 6634b540fea2
child 5160 c946616ee338
permissions -rw-r--r--
#UI_ENHANCEMENT by cg class: DoWhatIMeanSupport changed: #tryCodeCompletionWithSource:nodeInterval:at:mustBeExpression:into:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     1
"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     2
 COPYRIGHT (c) 1994 by AEG Industry Automation
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     3
 COPYRIGHT (c) 1994 by Claus Gittinger
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     4
	      All Rights Reserved
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     5
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     6
 This software is furnished under a license and may be used
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     7
 only in accordance with the terms of that license and with the
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
     9
 be provided or otherwise made available to, or used by, any
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    10
 other person.  No title to or ownership of the software is
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    11
 hereby transferred.
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    12
"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    13
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    14
"{ Package: 'stx:libwidg2' }"
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    15
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
SelectionInListView subclass:#SelectionInHierarchyView
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    17
	instanceVariableNames:'itemList showConnectingLines itemClass indent itemPrintConverter'
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    18
	classVariableNames:''
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    19
	poolDictionaries:''
1233
ba2244433fd4 category change
Claus Gittinger <cg@exept.de>
parents: 443
diff changeset
    20
	category:'Views-Trees'
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    23
!SelectionInHierarchyView class methodsFor:'documentation'!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    25
copyright
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    26
"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    27
 COPYRIGHT (c) 1994 by AEG Industry Automation
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    28
 COPYRIGHT (c) 1994 by Claus Gittinger
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    29
	      All Rights Reserved
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    30
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    31
 This software is furnished under a license and may be used
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    32
 only in accordance with the terms of that license and with the
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    34
 be provided or otherwise made available to, or used by, any
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    35
 other person.  No title to or ownership of the software is
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    36
 hereby transferred.
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    37
"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    38
!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
443
fdff91162cac added obsoleteness warning
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
    42
    [warning:]
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    43
	this class has been more or less obsoleted by
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    44
	the SelectionInTreeView and HierarchicalListView classes.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    45
	SelectionInHierarchyView remains in the system for backward
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    46
	compatibility, but will be no longer maintained.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    47
	New applications should use SelectionInTreeView,
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    48
	or (even better) HierarchicalListView.
443
fdff91162cac added obsoleteness warning
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
    49
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    somewhat like a SelectionInListView; but specialized for hierarchical (i.e. tree-like)
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    51
    lists and adds the functions to show/hide subtrees.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    Requires SelectionInHierarchy as model and HierarchyNode (or compatible) list entries.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    See examples.
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    54
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    55
    [Author:]
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    56
	W. Olberding AEG Factory Automation
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    57
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    58
    [See also:]
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    59
	SelectionInTreeView
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    60
	SelectionInHierarchy HierarchyNode
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    61
	SelectionInListView
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
examples
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    shows the tree of smalltalk classes:
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    68
									[exBegin]
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
      |top hierarchy hierarchyV scroller|
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
      hierarchy := SelectionInHierarchy new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
      hierarchy root:(HierarchyNode newAsTreeFromSmalltalkClass:Object).
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
      hierarchy setHideToChildren:true startingAt:hierarchy root.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
      top := StandardSystemView new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
      top extent:300@300.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
      hierarchyV := SelectionInHierarchyView new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
      hierarchyV model: hierarchy.
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    80
      hierarchyV action:[:nr | Transcript show:'selected:'; showCR:nr].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
      top add:(ScrollableView forView:hierarchyV)
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    83
	  in:((0.0 @ 0.0 ) corner:( 1.0 @ 1.0)).
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
      top open.
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    85
									[exEnd]
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    same, with nice connecting links:
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    88
    (sorry - this works only with some fonts - see comment in #getListFromModel)
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
    89
									[exBegin]
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
      |top hierarchy hierarchyV scroller|
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
      hierarchy := SelectionInHierarchy new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
      hierarchy root:(HierarchyNode newAsTreeFromSmalltalkClass:Object).
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
      hierarchy setHideToChildren:true startingAt:hierarchy root.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
      top := StandardSystemView new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
      top extent:300@300.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
      hierarchyV := SelectionInHierarchyView new.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
      hierarchyV showConnectingLines:true.
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
      hierarchyV model: hierarchy.
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   102
      hierarchyV action:[:nr | Transcript show:'selected:'; showCR:nr].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
      top add:(ScrollableView forView:hierarchyV)
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   105
	  in:((0.0 @ 0.0 ) corner:( 1.0 @ 1.0)).
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
      top open.
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   107
									[exEnd]
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
"
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
! !
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   111
!SelectionInHierarchyView methodsFor:'accessing - selection'!
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   112
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   113
selectElement:anObject
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   114
    "select the element with same printString as the argument, anObject"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   115
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   116
    |index|
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   117
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   118
    index:= 1.
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   119
    list notNil ifTrue:[
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   120
	list do:[:each|
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   121
	  ((each withoutSpaces) = (anObject printString)) ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   122
	      self selection:index.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   123
	      ^ index
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   124
	  ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   125
	  index:= index + 1.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   126
	].
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   127
    ].
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   128
    ^index
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   129
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   130
    "Modified: 10.10.1994 / 16:13:39 / W.Olberding"
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   131
    "Modified: 16.4.1997 / 12:40:05 / cg"
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   132
!
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   133
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   134
selection: anIndex
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   135
	"Pass the selection along to the model."
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   136
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   137
	super selection:  anIndex.
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   138
	model selection:  anIndex.
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   139
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   140
	"Modified: 10.10.94 / 16:13:38 / W.Olberding"!
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   141
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   142
selectionIndex: anIndex
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   143
	"Pass the selection along to the model."
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   144
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   145
	super selection:  anIndex.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   146
	model selection:  anIndex.
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   147
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   148
	"Modified: 10.10.94 / 16:13:38 / W.Olberding"
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   149
! !
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   150
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
!SelectionInHierarchyView methodsFor:'event handling'!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
buttonPress:button x:x y:y
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
    |oldSelection listLineNr|
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    ((button == 1) or:[button == #select]) ifTrue:[
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   157
	enabled ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   158
	    oldSelection := selection.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   159
	    listLineNr := self visibleLineToListLine:(self visibleLineOfY:y).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   160
	    (selectConditionBlock isNil or:[selectConditionBlock value:listLineNr]) ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   161
		listLineNr notNil ifTrue: [
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   162
		    self selectWithoutScroll:listLineNr
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   163
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   164
		((ignoreReselect not and:[selection notNil])
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   165
		 or:[selection ~= oldSelection]) ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   166
		    "actionBlock notNil ifTrue:[actionBlock value:selection]."
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   167
		    "the ST-80 way of doing things"
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   168
		    model notNil ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   169
			model perform:#selectionIndex: with:(selection)
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   170
		    ]
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   171
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   172
		clickLine := listLineNr
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   173
	    ]
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   174
	]
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    ] ifFalse:[
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   176
	super buttonPress:button x:x y:y
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    ]
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   179
	"Modified: 10.10.94 / 17:13:38 / W.Olberding"
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   180
	"Modified: 08.11.94 / 15:38:43 / R.Sailer"
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   181
!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   183
keyPress:key x:x y:y
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   184
    "a key was pressed - handle [-][+][*] here"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   186
    (key == $-)    ifTrue: [^ model collapse].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   187
    (key == $+)    ifTrue: [^ model expand].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   188
    (key == $*)    ifTrue: [^ model expandAll].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   189
    (key == $.)    ifTrue: [^ model collapseAll].
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   190
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   191
    super keyPress:key x:x y:y
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   193
	"Modified: 10.10.94 / 16:13:38 / W.Olberding"! !
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   194
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   195
!SelectionInHierarchyView methodsFor:'initialization'!
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   196
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   197
initialize
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   198
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   199
    super initialize.
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   200
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   201
    showConnectingLines := true.
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   202
    indent := 2.
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   203
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   204
    self  doubleClickAction:
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   205
	  [:selection | model doubleClickSelection: selection ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   206
	  "this will usualy initiate a hide/show operation"
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   207
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   208
    "Modified: 10.10.1994 / 16:13:39 / W.Olberding"
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   209
    "Modified: 16.4.1997 / 12:37:38 / cg"
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   210
!
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   211
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   212
itemPrintConverter:aBlock
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   213
    "set a converter block, which returns a listEntry
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   214
     for a passed node. If left undefined, an indented string
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   215
     based upon the nodes name is generated."
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   216
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   217
    itemPrintConverter := aBlock
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   218
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   219
    "Modified: 16.4.1997 / 13:06:22 / cg"
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   220
!
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   221
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   222
showConnectingLines:aBoolean
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   223
    showConnectingLines := aBoolean
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   224
! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
!SelectionInHierarchyView methodsFor:'model access'!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   228
getListAttributes
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   229
      "get list attributes (selectable, disabled ...) from model)"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   230
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   231
       ^Array new: 0.
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   232
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   233
	"Modified: 10.10.94 / 16:13:38 / W.Olberding"!
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   234
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   235
getListFromModel
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   236
    "Get list entries from model.
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   237
     Answer them as idented Text."
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   238
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   239
    |listOfNodes itemList textLine treeLevels isLastOnLevel oldLevel
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   240
     blockGraphicCharacters|
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   241
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   242
    listOfNodes := model list.
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   243
    listOfNodes isNil ifTrue:[^ #()].
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   244
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   245
    itemPrintConverter notNil ifTrue:[
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   246
	"/ externally provided node-to-listentry converter
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   247
	"/ allows hierarchyNodes to be presented in any
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   248
	"/ programmer defined way ...
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   249
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   250
	itemList := listOfNodes collect:[:aNode |
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   251
	    itemPrintConverter value:aNode
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   252
	].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   253
    ] ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   254
	showConnectingLines ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   255
	    itemList := listOfNodes collect: [ :aNode |
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   256
		textLine := ReadWriteStream on: String new.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   257
		aNode level timesRepeat: [
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   258
		    textLine spaces:indent.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   259
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   260
		textLine nextPutAll: aNode name.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   261
		aNode isExpandable ifTrue: [
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   262
		    textLine nextPutAll: ' ...'.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   263
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   264
		textLine contents.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   265
	    ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   266
	] ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   267
	    "/ claus:
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   268
	    "/ mhmh - the AEG code depends on those blockGraphic
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   269
	    "/        characters being in the font.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   270
	    "/
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   271
	    "/ how can we find out what characters there are ?
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   272
	    "/ (X maps missing chars to a space).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   273
	    "/ we should really rewrite this to use a private bitmap font ...
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   274
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   275
	    blockGraphicCharacters := Array with:$|
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   276
					    with:$+
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   277
					    with:$+
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   278
					    with:$-.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   280
    "/        blockGraphicCharacters := Array with:(Character value:25)
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   281
    "/                                        with:(Character value:14)
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   282
    "/                                        with:(Character value:21)
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   283
    "/                                        with:(Character value:18).
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   284
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   285
	    isLastOnLevel:=Set new.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   286
	    treeLevels:=Set new.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   287
	    oldLevel:=0.
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   288
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   289
	    listOfNodes reverseDo: [ :aNode |
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   290
		(treeLevels includes:(aNode level)) ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   291
		    isLastOnLevel add:aNode.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   292
		    treeLevels add:(aNode level).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   293
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   294
		aNode level < oldLevel ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   295
		    treeLevels remove:oldLevel.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   296
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   297
		oldLevel:=aNode level.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   298
	    ].
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   299
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   300
	    treeLevels:=Set new.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   301
	    oldLevel:=0.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   302
	    itemList := listOfNodes collect: [ :aNode |
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   303
		textLine := ReadWriteStream on: String new.
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   305
		1 to:((aNode level)-1) do: [ :l |
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   306
		    (treeLevels includes:l) ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   307
			textLine space; nextPut:(blockGraphicCharacters at:1); space.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   308
		    ]ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   309
			textLine space; space; space.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   310
		    ]
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   311
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   312
		treeLevels add:(aNode level).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   313
		oldLevel:=aNode level.
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   314
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   315
		(aNode = (listOfNodes first)) ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   316
		    textLine space.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   317
		    (isLastOnLevel includes:aNode)ifTrue:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   318
			 textLine nextPut:(blockGraphicCharacters at:2).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   319
			 treeLevels remove:(aNode level).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   320
		    ] ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   321
			textLine nextPut:(blockGraphicCharacters at:3).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   322
		    ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   323
		    textLine nextPut:(blockGraphicCharacters at:4).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   324
		].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   325
		aNode isExpandable ifTrue: [
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   326
		    textLine nextPutAll: '[+]'.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   327
		] ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   328
		    aNode isCollapsable ifTrue: [
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   329
		       textLine nextPutAll: '[-]'.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   330
		    ] ifFalse:[
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   331
			textLine nextPut:(blockGraphicCharacters at:4).
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   332
		    ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   333
		].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   335
		textLine nextPutAll:' ', aNode name.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   336
		textLine contents.
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   337
	    ].
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   338
	]
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   339
    ].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   341
   ^itemList
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
361
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   343
    "Modified: 10.10.1994 / 16:13:39 / W.Olberding"
207e06f3d47e added an itemConverterBlock, which can generate ListEntries
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   344
    "Modified: 16.4.1997 / 12:43:20 / cg"
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   347
getSelectionFromModel
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   348
      "Get the current list selection from model. "
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   349
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   350
    ^  model selectionIndex
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   351
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   352
	"Modified: 10.10.94 / 16:13:39 / W.Olberding"
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   353
!
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   354
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   355
model:aModel
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   356
    super model:aModel.
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   357
    self setNewList
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   358
! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   360
!SelectionInHierarchyView methodsFor:'private'!
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   361
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   362
setNewList
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   363
	"Build a completely new hierarchy list."
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   364
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   366
       self setList: (self getListFromModel).
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   367
"/       self attributes: (self getListAttributes).
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   368
       self selection: (self getSelectionFromModel).
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   369
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   370
	"Modified: 10.10.94 / 17:13:38 / W.Olberding"
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   371
	"Modified: 08.11.94 / 15:28:03 / R.Sailer"! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
!SelectionInHierarchyView methodsFor:'updating'!
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   375
update: aSymbol with:aParameter from:changedObject
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   376
      "Change my apperance according to the occurred change."
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   378
     aSymbol==#list
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   379
	ifTrue: [^self setNewList].
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   380
     aSymbol==#selection
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   381
	ifTrue: [^self selection: self getSelectionFromModel].
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   382
     aSymbol==#attributes
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   383
	ifTrue: [].
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   385
	"Modified: 10.10.94 / 16:13:38 / W.Olberding"! !
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
259
f930922963ce commentary - mhmh
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   387
!SelectionInHierarchyView class methodsFor:'documentation'!
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
252
4db843d36c46 comment & #selectionIndex:
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   389
version
3150
e3a55f15ef7e package information
Claus Gittinger <cg@exept.de>
parents: 1431
diff changeset
   390
    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInHierarchyView.st,v 1.12 2006-11-13 16:11:31 cg Exp $'
84
4478ea2d40c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
! !