home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / cbmethod.tcl < prev    next >
Encoding:
Text File  |  1996-06-11  |  3.6 KB  |  148 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cadre Technologies Inc.    1996
  4. #
  5. #      File:           @(#)cbmethod.tcl    /main/2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)cbmethod.tcl    /main/2   11 Jun 1996 Copyright 1996 Cadre Technologies Inc.
  10.  
  11. # Start user added include file section
  12. require "cbpropname.tcl"
  13. require "cbparamete.tcl"
  14.  
  15. require "cbpropcomp.tcl"
  16. require "cbproplabe.tcl"
  17. require "cbpropitem.tcl"
  18. # End user added include file section
  19.  
  20. require "cadmethod.tcl"
  21. require "cbcdmcomp.tcl"
  22. require "cbtlentry.tcl"
  23.  
  24. Class CBMethod : {CBCDMComp CADMethod CBTLEntry} {
  25.     method destructor
  26.     constructor
  27.     method createParameter
  28.     method collectClasses
  29.     method collectWorkItems
  30.     method collectPropComps
  31.     method format
  32.     method getFilter
  33. }
  34.  
  35. method CBMethod::destructor {this} {
  36.     # Start destructor user section
  37.     # End destructor user section
  38.     $this CBCDMComp::destructor
  39.     $this CADMethod::destructor
  40.     $this CBTLEntry::destructor
  41. }
  42.  
  43. constructor CBMethod {class this theClass row} {
  44.     set this [CADMethod::constructor $class $this $theClass $row]
  45.     set this [CBTLEntry::constructor $class $this $this]
  46.     set this [CBCDMComp::constructor $class $this $this]
  47.     return $this
  48. }
  49.  
  50. method CBMethod::createParameter {this cell} {
  51.     return [CBParameter new $cell $this]
  52. }
  53.  
  54. method CBMethod::collectClasses {this classList} {
  55.     if {[[$this getClassBrowser] isInFlatViewMode]} {
  56.         $classList append [$this theClass]
  57.     }
  58.  
  59.     $this CBCDMComp::collectClasses $classList
  60.  
  61.     [$this parameterSet] foreach param {
  62.         $param collectClasses $classList
  63.     }
  64. }
  65.  
  66. method CBMethod::collectWorkItems {this workItemList} {
  67.     if {[[$this getClassBrowser] isInFlatViewMode]} {
  68.         [$this theClass] collectWorkItems $workItemList
  69.     }
  70.  
  71.     $this CBCDMComp::collectWorkItems $workItemList
  72.  
  73.     [$this parameterSet] foreach param {
  74.         $param collectWorkItems $workItemList
  75.     }
  76. }
  77.  
  78. method CBMethod::collectPropComps {this propCompList} {
  79.     if {[[$this getClassBrowser] isInFlatViewMode]} {
  80.         [$this theClass] collectPropComps $propCompList
  81.     }
  82.  
  83.     $this CBCDMComp::collectPropComps $propCompList
  84.  
  85.     [$this parameterSet] foreach param {
  86.         $param collectPropComps $propCompList
  87.     }
  88. }
  89.  
  90. method CBMethod::format {this} {
  91.     set prefix ""
  92.     if {[[$this getClassBrowser] isInFlatViewMode]} {
  93.         set prefix "[[$this theClass] name]: "
  94.     }
  95.     if {[$this formattedText] != ""} {
  96.         return $prefix[$this formattedText]
  97.     }
  98.  
  99.     set result ""
  100.  
  101.     set isClassFeature [[$this row] getPropertyValue $COMP_CLASS_ATTR]
  102.     if {$isClassFeature == "1"} {
  103.         set result "${result}\$"
  104.     }
  105.  
  106.     set result "${result}[$this name]"
  107.  
  108.     set nrOfParams [[$this parameterSet] length]
  109.     if {$nrOfParams == 0} {
  110.         if {!([$this name] == "create" && \
  111.             $isClassFeature == "1" && [[$this row] \
  112.                 getPropertyValue $COMP_HAS_PARAMLIST] != "1")} {
  113.             set result "${result}()"
  114.         }
  115.     } else {
  116.         set result "${result}("
  117.         set firstParam 1
  118.         [$this parameterSet] foreach param {
  119.             if {$firstParam} {
  120.                 set firstParam 0
  121.             } else {
  122.                 set result "${result}, "
  123.             }
  124.             set result "${result}[$param format]"
  125.         }
  126.         set result "${result})"
  127.     }
  128.  
  129.     if {[$this type] != ""} {
  130.         set result "${result}: [$this type]"
  131.     }
  132.  
  133.     set isAbstract [[$this row] getPropertyValue $COMP_ABSTRACT]
  134.     if {$isAbstract == "1"} {
  135.         set result "${result} {abstract}"
  136.     }
  137.  
  138.     $this formattedText $result
  139.     return $prefix$result
  140. }
  141.  
  142. method CBMethod::getFilter {this} {
  143.     return ${ClassBrowser::operFilter}
  144. }
  145.  
  146. # Do not delete this line -- regeneration end marker
  147.  
  148.