home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)opendefeda.tcl /main/hindenburg/1
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)opendefeda.tcl /main/hindenburg/1 29 Aug 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
-
- require "searchstgd.tcl"
- require "crfilestgd.tcl"
- require "crsysstgde.tcl"
- require "userstgdef.tcl"
- require "groupstgde.tcl"
-
- global stgAbbr
-
- set stgAbbr(search) Search
- set stgAbbr(createFile) CrFile
- set stgAbbr(createSystemAndFile) CrSys
- set stgAbbr(userDefined) User
- set stgAbbr(group) Group
-
- # End user added include file section
-
- require "custdefsar.tcl"
-
- Class OpenDefEdArea : {CustDefsArea} {
- constructor
- method destructor
- method read
- method deleteObjects
- method newObject
- method createSearch
- method createCrFile
- method createCrSys
- method createUser
- method createGroup
- method createObject
- method clearArea
- method getStrategy
- method setStrategy
- method removeStrategy
- attribute searchDefiner
- attribute crFileDefiner
- attribute crSysDefiner
- attribute userDefiner
- attribute groupDefiner
- attribute strategy
- }
-
- constructor OpenDefEdArea {class this name} {
- set this [CustDefsArea::constructor $class $this $name]
- $this strategy [Dictionary new]
- # Start constructor user section
- $this rowCount 12
- $this columnCount 65
- $this font "[m4_var get M4_font -context uce]"
- $this destinationSet "OPENSTGDEF dropEvent"
- $this mode DETAIL
- BrowsHeader new $this.name -label Strategy -width 25
- BrowsHeader new $this.type -label Type -width 20
- BrowsHeader new $this.level -label Level -width 15
- # End constructor user section
- return $this
- }
-
- method OpenDefEdArea::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this CustDefsArea::destructor
- }
-
- method OpenDefEdArea::read {this object type} {
- global stgAbbr
- set defFileName [$this _curName]
- set defFileType [$this _curType]
- foreach defLine [$this readConfig $object $defFileName $defFileType] {
- $this create$stgAbbr([lindex $defLine 1]) $defLine $type
- }
- }
-
- method OpenDefEdArea::deleteObjects {this objs} {
- foreach stg $objs {
- $this removeStrategy [$stg name]
- }
- $this CustDefsArea::deleteObjects $objs
- }
-
- method OpenDefEdArea::newObject {this type name {edit 0}} {
- $this isChanged 1
-
- set obj [$this createObject "name \"$name\"
- type \"$type\"
- specLevel \"[$this _level]\"" \
- $type [$this _level]]
-
- $this sortArea
-
- if $edit {
- $obj open
- }
- }
-
- method OpenDefEdArea::createSearch {this defs level} {
- $this createObject "name \"[lindex $defs 0]\"
- type \"[lindex $defs 1]\"
- flags \"[lindex $defs 2]\"
- fileTypes \"[lindex $defs 3]\"" \
- [lindex $defs 1] $level
- }
-
- method OpenDefEdArea::createCrFile {this defs level} {
- $this createObject "name \"[lindex $defs 0]\"
- type \"[lindex $defs 1]\"
- fileQualifier \"[lindex $defs 2]\"
- fileName \"[lindex $defs 3]\"
- fileType \"[lindex $defs 4]\"" \
- [lindex $defs 1] $level
- }
-
- method OpenDefEdArea::createCrSys {this defs level} {
- $this createObject "name \"[lindex $defs 0]\"
- type \"[lindex $defs 1]\"
- systemName \"[lindex $defs 2]\"
- fileQualifier \"[lindex $defs 3]\"
- fileName \"[lindex $defs 4]\"
- fileType \"[lindex $defs 5]\"" \
- [lindex $defs 1] $level
- }
-
- method OpenDefEdArea::createUser {this defs level} {
- $this createObject "name \"[lindex $defs 0]\"
- type \"[lindex $defs 1]\"
- procedure \"[lindex $defs 2]\"" \
- [lindex $defs 1] $level
- }
-
- method OpenDefEdArea::createGroup {this defs level} {
- $this createObject "name \"[lindex $defs 0]\"
- type \"[lindex $defs 1]\"
- members \"[lindex $defs 2]\"" \
- [lindex $defs 1] $level
- }
-
- method OpenDefEdArea::createObject {this objSpec type level} {
- global stgAbbr
- global classCount
- set newIndex [llength [$this objectSet]]
- set object [$stgAbbr($type)StgDef new $this.Object$classCount $objSpec]
- $this setStrategy [$object name] $object
- $object index $newIndex
- incr classCount
-
- $this adjustCreatedObject $object $level
-
- # update the object-details in the view
- $object updateView
-
- return $object
- }
-
- method OpenDefEdArea::clearArea {this} {
- $this CustDefsArea::clearArea
- foreach stg [[$this strategy] names] {
- $this removeStrategy $stg
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
- method OpenDefEdArea::getStrategy {this name} {
- return [[$this strategy] set $name]
- }
-
- method OpenDefEdArea::setStrategy {this name newStrategy} {
- [$this strategy] set $name $newStrategy
- }
-
- method OpenDefEdArea::removeStrategy {this name} {
- [$this strategy] unset $name
- }
-
-