Tools__ViewTreeItem.st
author Claus Gittinger <cg@exept.de>
Wed, 29 Jul 2009 20:02:02 +0200
changeset 2570 4e663bc64364
parent 2456 3d8a5dd293ba
permissions -rw-r--r--
changed #requestPackage
     1 "{ Package: 'stx:libtool2' }"
     2 
     3 "{ NameSpace: Tools }"
     4 
     5 HierarchicalItem subclass:#ViewTreeItem
     6 	instanceVariableNames:'widget isDrawnShown exists xOffsetAdditionalName'
     7 	classVariableNames:'HandleExtent'
     8 	poolDictionaries:''
     9 	category:'A-Views-Support'
    10 !
    11 
    12 !ViewTreeItem class methodsFor:'documentation'!
    13 
    14 documentation
    15 "
    16     ViewTreeItems represants a pickable object within a ViewTreeModel.
    17     The class is used to build up the hierarchical tree.
    18 
    19     [Instance variables:]
    20         widget        <View>            the widget represented by the item
    21         spec          <UISpecification> the UISpecification or nil
    22 
    23     [Class variables:]
    24         HandleExtent  <Point>           keeps the extent of a handle
    25 
    26 
    27     [author:]
    28         Claus Atzkern
    29 
    30     [see also:]
    31         HierarchicalItem
    32         ViewTreeModel
    33 "
    34 ! !
    35 
    36 !ViewTreeItem class methodsFor:'initialization'!
    37 
    38 initialize
    39     "set the extent of the Handle
    40     "
    41     HandleExtent := 6@6.
    42 ! !
    43 
    44 !ViewTreeItem class methodsFor:'instance creation'!
    45 
    46 forView:aView
    47     |item|
    48 
    49     item := self basicNew initialize.
    50     item forView:aView.
    51   ^ item
    52 !
    53 
    54 new
    55     self error:'not allowed'.
    56   ^ nil
    57 !
    58 
    59 on:aView withSpec:aSpec
    60     |item|
    61 
    62     item := self basicNew initialize.
    63     item on:aView withSpec:aSpec.
    64   ^ item
    65 ! !
    66 
    67 !ViewTreeItem class methodsFor:'building'!
    68 
    69 buildViewsFrom:aView
    70     "build the items starting from a source view;
    71      returns the anhor.
    72     "
    73     |item subViews subItems|
    74 
    75     aView isNil ifTrue:[^ nil].
    76 
    77     item     := self forView:aView.
    78     subViews := aView subViews.
    79 
    80     subViews notEmptyOrNil ifTrue:[
    81         subItems := OrderedCollection new.
    82         subViews do:[:aSubView|
    83             subItems add:(self buildViewsFrom:aSubView).
    84         ].
    85         item children:subItems.
    86     ].
    87     ^ item
    88 ! !
    89 
    90 !ViewTreeItem methodsFor:'accessing'!
    91 
    92 applicationClass
    93     |appl|
    94 
    95     widget notNil ifTrue:[
    96         appl := widget application.
    97         appl notNil ifTrue:[^ appl class ].
    98     ].
    99     ^ nil
   100 !
   101 
   102 isDrawnShown
   103     "returns true if the last display operations was done during the widget was shown
   104     "
   105     ^ isDrawnShown
   106 !
   107 
   108 isDrawnShown:aBoolean
   109     isDrawnShown := aBoolean.
   110 !
   111 
   112 rootView
   113     "returns the widget assigned to the root or nil
   114     "
   115     ^ parent rootView
   116 !
   117 
   118 specClass
   119     "returns the spec-class assigned to the item
   120     "
   121     ^ widget specClass
   122 !
   123 
   124 treeModel
   125     "returns the assigned treeModel, an instance of ViewTreeModel
   126     "
   127     ^ parent treeModel
   128 !
   129 
   130 widget
   131     "returns the widget assigned to the item
   132     "
   133     ^ widget
   134 ! !
   135 
   136 !ViewTreeItem methodsFor:'accessing layout'!
   137 
   138 boundsRelativeToRoot
   139     "returns the bounds relative to the root widget
   140     "
   141     ^ self originRelativeToRoot extent:(widget extent)
   142 !
   143 
   144 cornerRelativeToRoot
   145     "returns the corner relative to the root widget
   146     "
   147     ^ self originRelativeToRoot + (widget extent)
   148 !
   149 
   150 extent
   151     "returns the extent of the widget
   152     "
   153     ^ widget extent
   154 !
   155 
   156 layoutType
   157     "returns the type of layout assigned to the wiget; nil if the
   158      superView cannot resize its sub widgets
   159     "
   160     |layout specClass superView|
   161 
   162     (superView := widget superView) isNil ifTrue:[
   163         ^ #Extent
   164     ].
   165         
   166     specClass := superView specClass.
   167 
   168     (specClass notNil and:[specClass isLayoutContainer]) ifTrue:[
   169         ^ specClass canResizeSubComponents ifTrue:[#Extent] ifFalse:[nil]
   170     ].
   171 
   172     (layout := widget geometryLayout) isNil ifTrue:[
   173         ^ #Extent
   174     ].
   175 
   176     layout isLayout ifTrue:[
   177         layout isLayoutFrame        ifTrue:[ ^ #LayoutFrame ].
   178         layout isAlignmentOrigin    ifTrue:[ ^ #AlignmentOrigin ].
   179         layout isLayoutOrigin       ifTrue:[ ^ #LayoutOrigin ].
   180     ] ifFalse:[
   181         layout isRectangle          ifTrue:[ ^ #Rectangle ].
   182         layout isPoint              ifTrue:[ ^ #Point ].
   183 
   184     ].
   185     Transcript showCR:'UNSUPPORTRD LAYOUT: ', layout printString.
   186   ^ nil
   187 !
   188 
   189 originRelativeToRoot
   190     "returns the origin relative to the root widget
   191     "
   192     ^ widget originRelativeTo:(self rootView)
   193 ! !
   194 
   195 !ViewTreeItem methodsFor:'accessing optimize'!
   196 
   197 children
   198     "redefined: optimize
   199     "
   200     ^ children
   201 !
   202 
   203 hasChildren
   204     |subViews list item|
   205 
   206     children size ~~ 0 ifTrue:[
   207         ^ true
   208     ].
   209     isExpanded := false.
   210     subViews   := widget subViews.
   211 
   212     subViews size == 0 ifTrue:[^ false].
   213 
   214     list := OrderedCollection new.
   215 
   216     subViews do:[:aSubView|
   217         item := self class buildViewsFrom:aSubView.
   218         item parent:self.
   219         list add:item.
   220     ].
   221     children := list.
   222     ^ true
   223 !
   224 
   225 size
   226     "redefined: returns list of children
   227     "
   228     ^ children size
   229 ! !
   230 
   231 !ViewTreeItem methodsFor:'displaying'!
   232 
   233 additionalLabelForItem:anItem
   234     "answer an additional item for an Item or nil"
   235 
   236     parent notNil ifTrue:[
   237         ^ parent additionalLabelForItem:anItem
   238     ].
   239     ^ nil
   240 !
   241 
   242 displayIcon:anIcon atX:x y:y on:aGC
   243     |x0 y0 y1 w|
   244 
   245     super displayIcon:anIcon atX:x y:y on:aGC.
   246 
   247     self exists ifFalse:[
   248         aGC paint:(Color red).
   249 
   250         y0 := y + 1.
   251         y1 := y + anIcon height - 2.
   252 
   253         x0 := x - 1.
   254         w  := anIcon width.
   255 
   256         2 timesRepeat:[
   257             aGC displayLineFromX:x0 y:y0 toX:(x0 + w) y:y1.
   258             aGC displayLineFromX:x0 y:y1 toX:(x0 + w) y:y0.
   259             x0 := x0 + 1.
   260         ].
   261     ].
   262 !
   263 
   264 displayOn:aGC x:x y:y h:h
   265     |labelHeight additionalName label isValidAndShown|
   266 
   267     label := self label.
   268     label isEmptyOrNil ifTrue:[^ self].
   269 
   270     widget id isNil ifTrue:[
   271         isDrawnShown := false.
   272 
   273         self exists ifFalse:[
   274             xOffsetAdditionalName := nil.
   275         ].
   276         isValidAndShown := false.
   277     ] ifFalse:[
   278         isValidAndShown := widget shown.
   279     ].
   280     isValidAndShown ifFalse:[
   281         label := Text string:label emphasis:#italic
   282     ].
   283 
   284     labelHeight := self heightOn:aGC.
   285     self displayLabel:label h:labelHeight on:aGC x:x y:y h:h.
   286 
   287     xOffsetAdditionalName notNil ifTrue:[
   288         additionalName := self additionalLabelForItem:self.
   289 
   290         additionalName notNil ifTrue:[
   291             self displayLabel:additionalName
   292                             h:labelHeight on:aGC
   293                             x:(x + xOffsetAdditionalName)
   294                             y:y
   295                             h:h.
   296         ] ifFalse:[
   297             xOffsetAdditionalName := nil.
   298         ].
   299     ].
   300 !
   301 
   302 recursiveAdditionalNameBehaviourChanged
   303     width := xOffsetAdditionalName := nil.
   304 
   305     children notNil ifTrue:[
   306         children do:[:each| each recursiveAdditionalNameBehaviourChanged ]
   307     ].
   308 !
   309 
   310 widthOn:aGC
   311     "return the width of the receiver, if it is to be displayed on aGC
   312     "
   313     |additionalName|
   314 
   315     width isNil ifTrue:[
   316         width := self widthOf:(self label) on:aGC.
   317         width := width + 2.
   318 
   319         additionalName := self additionalLabelForItem:self.
   320 
   321         additionalName notNil ifTrue:[
   322             xOffsetAdditionalName := width + 10.
   323             width := xOffsetAdditionalName + (self widthOf:additionalName on:aGC).
   324             width := width + 2.
   325         ] ifFalse:[
   326             xOffsetAdditionalName := nil.
   327         ].
   328     ].
   329     ^ width
   330 ! !
   331 
   332 !ViewTreeItem methodsFor:'enumerating'!
   333 
   334 handlesDo:aTwoArgAction
   335     "evaluate the two arg block on each handle; the arguments to the block is
   336      the rectangle relative to the rootView and the handle type which is
   337      set to nil if not resizeable.
   338 
   339      TYPES:     type    position( X - Y )
   340                 -------------------------        
   341                 #LT     Left   - Top
   342                 #LC     Left   - Center
   343                 #LB     Left   - Bottom
   344                 #CT     Center - Top
   345                 #CB     Center - Bottom
   346                 #RT     Right  - Top
   347                 #RC     Right  - Center
   348                 #RB     Right  - Bottom
   349 
   350                 nil     ** handle not pickable **
   351     "
   352     |type relOrg relCrn maxExt rootView w h
   353      xL    "{ Class:SmallInteger }"
   354      xC    "{ Class:SmallInteger }"
   355      xR    "{ Class:SmallInteger }"
   356      yT    "{ Class:SmallInteger }"
   357      yC    "{ Class:SmallInteger }"
   358      yB    "{ Class:SmallInteger }"
   359     |
   360     rootView := self rootView.
   361     relOrg   := widget originRelativeTo:rootView.
   362     relOrg isNil ifTrue:[ ^ self ].    "/ widget destroyed
   363 
   364     relOrg   := relOrg - (HandleExtent // 2).
   365     relCrn   := relOrg + widget extent.
   366     maxExt   := rootView extent - HandleExtent.
   367 
   368     xL := relOrg x max:0.
   369     xR := relCrn x min:(maxExt x).
   370     xC := xR + xL // 2.
   371 
   372     yT := relOrg y max:0.
   373     yB := relCrn y min:(maxExt y).
   374     yC := yB + yT // 2.
   375 
   376     type := self layoutType.
   377     w   := HandleExtent x.
   378     h   := HandleExtent y.
   379 
   380     (type == #LayoutFrame or:[type == #Rectangle]) ifTrue:[
   381         aTwoArgAction value:(Rectangle left:xL top:yT width:w height:h) value:#LT.
   382         aTwoArgAction value:(Rectangle left:xL top:yC width:w height:h) value:#LC.
   383         aTwoArgAction value:(Rectangle left:xL top:yB width:w height:h) value:#LB.
   384         aTwoArgAction value:(Rectangle left:xC top:yT width:w height:h) value:#CT.
   385         aTwoArgAction value:(Rectangle left:xC top:yB width:w height:h) value:#CB.
   386         aTwoArgAction value:(Rectangle left:xR top:yT width:w height:h) value:#RT.
   387         aTwoArgAction value:(Rectangle left:xR top:yC width:w height:h) value:#RC.
   388         aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:#RB.
   389       ^ self
   390     ].
   391 
   392     aTwoArgAction value:(Rectangle left:xL top:yT width:w height:h) value:nil.
   393     aTwoArgAction value:(Rectangle left:xL top:yB width:w height:h) value:nil.
   394     aTwoArgAction value:(Rectangle left:xR top:yT width:w height:h) value:nil.
   395 
   396     type == #Extent ifTrue:[
   397         aTwoArgAction value:(Rectangle left:xC top:yB width:w height:h) value:#CB.
   398         aTwoArgAction value:(Rectangle left:xR top:yC width:w height:h) value:#RC.
   399         aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:#RB.
   400       ^ self
   401     ].
   402     aTwoArgAction value:(Rectangle left:xR top:yB width:w height:h) value:nil.
   403 !
   404 
   405 recursiveEachVisibleItemDo:anOneArgBlock
   406     "recursive evaluate the block on each child which is visible
   407     "
   408     (isExpanded and:[children size > 0]) ifTrue:[
   409         children do:[:aChild|
   410             anOneArgBlock value:aChild.
   411             aChild recursiveEachVisibleItemDo:anOneArgBlock.
   412         ]
   413     ].
   414 !
   415 
   416 subViewsDo:aOneArgBlock
   417     "evaluate aBlock for all subviews other than InputView's   
   418     "
   419     |subViews|
   420 
   421     subViews := widget subViews.
   422 
   423     subViews notNil ifTrue:[
   424         subViews do:aOneArgBlock
   425     ].
   426 ! !
   427 
   428 !ViewTreeItem methodsFor:'initialization'!
   429 
   430 forView:aView
   431     widget := aView.
   432 !
   433 
   434 initialize
   435     "setup default attributes
   436     "
   437     super initialize.
   438     isDrawnShown := false.
   439     isExpanded   := false.
   440     children     := OrderedCollection new.
   441 ! !
   442 
   443 !ViewTreeItem methodsFor:'operations delete'!
   444 
   445 delete
   446     "delete self and all contained items; the assigned views are destroyed
   447      in case of rootView, only the children are deleted
   448     "
   449     parent isHierarchicalItem ifTrue:[
   450         self criticalDo:[
   451             parent remove:self.
   452             widget destroy.
   453         ]
   454     ] ifFalse:[
   455         self deleteAll
   456     ].
   457 !
   458 
   459 deleteAll
   460     "delete all contained items; the assigned views are destroyed
   461     "
   462     children size == 0 ifTrue:[^ self].
   463 
   464     self criticalDo:[
   465         self nonCriticalDo:[:el| el widget destroy ].
   466         self removeAll
   467     ].
   468 ! !
   469 
   470 !ViewTreeItem methodsFor:'operations layout'!
   471 
   472 asLayoutFrame
   473     "convert the layout of the widget to a LayoutFrame;
   474     "
   475     |extent layout newLyt lftFrc lftOff topFrc topOff|
   476 
   477     layout := widget geometryLayout.
   478 
   479     layout isNil ifTrue:[
   480         ^ widget bounds asLayout
   481     ].
   482 
   483     layout isLayout ifFalse:[
   484         layout isRectangle ifTrue:[
   485             ^ LayoutFrame leftOffset:(layout left) rightOffset:(layout right)
   486                            topOffset:(layout top) bottomOffset:(layout bottom)
   487         ].
   488         layout isPoint ifTrue:[
   489             extent := widget extent.
   490           ^ LayoutFrame leftOffset:(layout x)  rightOffset:(layout x + extent x)
   491                          topOffset:(layout y) bottomOffset:(layout y + extent y)
   492         ].
   493 
   494         Transcript showCR:'UNSUPPORTRD LAYOUT: ', layout printString.
   495       ^ nil
   496     ].
   497 
   498     layout isLayoutFrame ifTrue:[ ^ layout copy ].    
   499 
   500     lftFrc := layout leftFraction.
   501     lftOff := layout leftOffset.
   502     topFrc := layout topFraction.
   503     topOff := layout topOffset.
   504     extent := widget extent.
   505 
   506     newLyt := LayoutFrame leftFraction:lftFrc offset:lftOff
   507                          rightFraction:lftFrc offset:(lftOff + extent x)
   508                            topFraction:topFrc offset:topOff
   509                         bottomFraction:topFrc offset:(topOff + extent y).
   510 
   511     (      layout isAlignmentOrigin
   512      and:[(layout leftAlignmentFraction ~= 0 or:[layout topAlignmentFraction ~= 0])]
   513     ) ifTrue:[
   514         |svRc prBd dlta|
   515 
   516         svRc := widget superView viewRectangle.
   517         prBd := widget preferredBounds.
   518 
   519         dlta := (  ((layout rectangleRelativeTo:svRc preferred:prBd) corner)
   520                  - ((newLyt rectangleRelativeTo:svRc preferred:prBd) corner)
   521                 ) rounded.
   522 
   523         newLyt   leftOffset:(lftOff + dlta x).
   524         newLyt  rightOffset:(lftOff + extent x + dlta x).
   525         newLyt    topOffset:(topOff + dlta y).
   526         newLyt bottomOffset:(topOff + extent y + dlta y).
   527     ].
   528     ^ newLyt
   529 !
   530 
   531 moveLeft:l top:t
   532     "move the widget n pixele left and right
   533     "
   534     |layout|
   535 
   536     self isMoveable ifFalse:[ ^ self ].
   537 
   538     (layout := widget geometryLayout) isNil ifTrue:[
   539         "Extent"
   540         widget origin:(widget origin + (l@t)).
   541       ^ self
   542     ].
   543 
   544     layout := layout copy.
   545 
   546     layout isLayout ifTrue:[
   547         layout leftOffset:(layout leftOffset + l)
   548                 topOffset:(layout topOffset  + t).
   549 
   550         layout isLayoutFrame ifTrue:[
   551             layout  rightOffset:(layout rightOffset  + l).
   552             layout bottomOffset:(layout bottomOffset + t).
   553         ]
   554 
   555     ] ifFalse:[
   556         layout isRectangle ifTrue:[
   557             layout setLeft:(layout left + l).
   558             layout  setTop:(layout top  + t).
   559         ] ifFalse:[
   560             layout isPoint ifFalse:[^ self].
   561             layout x:(layout x + l) y:(layout y + t).
   562         ]
   563     ].
   564     widget geometryLayout:layout.
   565 !
   566 
   567 resizeLeft:l top:t right:r bottom:b
   568     "resize the widget measured in pixels
   569     "
   570     |layout|
   571 
   572     self isResizeable ifFalse:[
   573         ^ self
   574     ].
   575 
   576     (layout := widget geometryLayout) isNil ifTrue:[
   577         "Extent"
   578         (r == l and:[b == t]) ifFalse:[
   579             widget extent:(widget computeExtent + ((r-l) @ (b-t))).
   580         ].
   581         ^ self
   582     ].
   583 
   584     layout isLayout ifTrue:[
   585         layout := layout copy.
   586 
   587         layout leftOffset:(layout leftOffset + l)
   588                 topOffset:(layout topOffset  + t).
   589 
   590         layout isLayoutFrame ifTrue:[
   591             layout bottomOffset:(layout bottomOffset + b).
   592             layout  rightOffset:(layout rightOffset  + r).
   593         ]
   594     ] ifFalse:[
   595         layout isRectangle ifFalse:[^ self].
   596         layout := layout copy.
   597 
   598         layout left:(layout left   + l)
   599               right:(layout right  + r)
   600                 top:(layout top    + t)
   601              bottom:(layout bottom + b).
   602     ].
   603     widget geometryLayout:layout.
   604 ! !
   605 
   606 !ViewTreeItem methodsFor:'operations update'!
   607 
   608 updateChildren
   609     |list|
   610 
   611     self do:[:el|
   612         el exists ifTrue:[
   613             el updateChildren.
   614         ] ifFalse:[
   615             list isNil ifTrue:[list := OrderedCollection new].
   616             list add:el.
   617         ]
   618     ].
   619     list notNil ifTrue:[
   620         list do:[:el| self remove:el ].
   621     ].
   622 !
   623 
   624 updateFromChildren:mergedList
   625     "update my children against the list of items derived from
   626      the merged list.
   627     "
   628 
   629     mergedList size == 0 ifTrue:[ ^ self removeAll ].
   630     children   size == 0 ifTrue:[ ^ self addAll:mergedList ].
   631 
   632     self criticalDo:[
   633         self nonCriticalDo:[:el| |wdg|
   634             wdg := el widget.
   635             mergedList detect:[:e2| e2 widget == wdg ] ifNone:[ self remove:el ].
   636         ].
   637 
   638         mergedList keysAndValuesDo:[:i :el| |wdg e2|
   639             wdg := el widget.
   640 
   641             e2  := self at:i ifAbsent:nil.
   642 
   643             (e2 isNil or:[e2 widget ~~ wdg]) ifTrue:[
   644                 self add:el beforeIndex:i
   645             ]
   646         ]
   647     ].
   648 ! !
   649 
   650 !ViewTreeItem methodsFor:'printing & storing'!
   651 
   652 icon
   653     "get the icon used for presentation
   654     "
   655     |specClass model|
   656 
   657     specClass := self specClass.
   658     specClass isNil ifTrue:[^ nil].
   659 
   660     model := self treeModel.
   661 
   662     model notNil ifTrue:[
   663         ^ model iconAt:specClass ifNonePut:[specClass icon]
   664     ].
   665     ^ specClass icon
   666 !
   667 
   668 label
   669     "get the label used for presentation
   670     "
   671     ^ self string
   672 !
   673 
   674 printOn:aStream
   675     "append a a printed representation of the item to aStream
   676     "
   677     aStream nextPutAll:(self string)
   678 !
   679 
   680 string
   681     "get the string
   682     "
   683     ^ widget class name.
   684 ! !
   685 
   686 !ViewTreeItem methodsFor:'queries'!
   687 
   688 canChangeLayout
   689     "returns true if the layout of the widget can be changed and the
   690      layout is not organized by its superView
   691     "
   692     ^ self isResizeable
   693 !
   694 
   695 canResizeSubComponents
   696     "returns true if the widget can resize its sub components
   697     "
   698     |specClass|
   699 
   700     specClass := self specClass.
   701 
   702     specClass notNil ifTrue:[
   703         ^ specClass canResizeSubComponents
   704     ].
   705     ^ false
   706 !
   707 
   708 exists
   709     widget id notNil ifTrue:[^ true ].
   710 
   711     exists ~~ false ifTrue:[
   712         exists := false.
   713 
   714         widget superView notNil ifTrue:[
   715             (parent isHierarchicalItem and:[parent exists]) ifTrue:[
   716                 exists := (parent widget subViews includesIdentical:widget).
   717             ].
   718         ].
   719     ].
   720     ^ exists
   721 !
   722 
   723 isApplicationClass
   724     |cls|
   725 
   726     cls := widget class.
   727 
   728     ^ (    cls == ApplicationSubView
   729         or:[cls == ApplicationWindow
   730         or:[cls == SubCanvas]]
   731       ) 
   732 !
   733 
   734 isSelected
   735     |model|
   736 
   737     model := self treeModel.
   738     model notNil ifTrue:[^ model isSelected:self].
   739     ^ false
   740 !
   741 
   742 supportsSubComponents
   743     "returns true if the widget supports sub components
   744     "
   745     |specClass|
   746 
   747     widget isScrollWrapper ifTrue:[
   748         ^ false
   749     ].
   750     specClass := self specClass.
   751 
   752     specClass notNil ifTrue:[
   753         ^ specClass supportsSubComponents
   754     ].
   755     ^ false
   756 ! !
   757 
   758 !ViewTreeItem methodsFor:'testing'!
   759 
   760 isInLayoutContainer
   761     "returns true if the widget is in a layout container
   762     "
   763     |sv specClass|
   764 
   765     sv := widget superView.
   766 
   767     sv notNil ifTrue:[
   768         specClass := sv specClass.
   769 
   770         specClass notNil ifTrue:[
   771             ^ specClass isLayoutContainer
   772         ].
   773     ].
   774     ^ false
   775 !
   776 
   777 isLayoutContainer
   778     "answer whether corresponding view instances of the spec class can contain
   779      (and arrange) other view
   780     "
   781     |specClass|
   782 
   783     specClass := self specClass.
   784 
   785     specClass notNil ifTrue:[
   786         ^ specClass isLayoutContainer
   787     ].
   788     ^ false
   789 !
   790 
   791 isMoveable
   792     "returns true if the widget is not in a layout container
   793     "
   794     self isInLayoutContainer ifFalse:[
   795         ^ widget superView notNil
   796     ].
   797     ^ false
   798 !
   799 
   800 isResizeable
   801     "returns true if the widget is resizeable
   802     "
   803     |sv specClass|
   804 
   805     sv := widget superView.
   806 
   807     sv notNil ifTrue:[
   808         specClass := sv specClass.
   809 
   810         specClass notNil ifTrue:[
   811             ^ specClass canResizeSubComponents
   812         ].
   813     ].
   814     ^ false
   815 ! !
   816 
   817 !ViewTreeItem class methodsFor:'documentation'!
   818 
   819 version
   820     ^ '$Header$'
   821 ! !
   822 
   823 ViewTreeItem initialize!