home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
mtitemkeep.tcl
< prev
next >
Wrap
Text File
|
1997-11-20
|
3KB
|
118 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)mtitemkeep.tcl /main/titanic/5
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)mtitemkeep.tcl /main/titanic/5 20 Nov 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require mtitem.tcl
# End user added include file section
Class MTItemKeeper : {Object} {
constructor
method destructor
method createConflictingItemObjects
}
constructor MTItemKeeper {class this name} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method MTItemKeeper::destructor {this} {
# Start destructor user section
# End destructor user section
}
method MTItemKeeper::createConflictingItemObjects {this} {
if {![isCommand [$this toRepObj]]} {
# no conflict this object is not present in the 'to' version
return
}
global classCount
set name [.main infoView]
set from [$this fromRepObj]
set to [$this toRepObj]
set base [$this baseRepObj]
if [.main import] {
set scope(scopePhaseRef) phaseRef
set scope(scopePhaseDef) phaseDef
} else {
set scope(scopePhaseRef) phase
set scope(scopePhaseDef) phase
}
set scope(scopeSystem) system
set scope(scopeFile) file
# show the itemConflicts (scope)
foreach fromItem [$from definedItems] {
if {"[$fromItem status]" == "reused"} continue
set item [$fromItem item]
set toItem [$to findDeclaration $item [.main toConfig]]
if {[$toItem isNil]} {
set toItem ""
} else {
set fromScope $scope([$fromItem scope])
set toScope $scope([$toItem scope])
if {$toScope == $fromScope} {
continue
}
}
set obj $name.$classCount
incr classCount
MTItem new $obj $fromItem $toItem
$this addChild $obj
}
# search for the item property conflicts
set diffsList [$to itemPropertyDiffs $from $base]
foreach diffs $diffsList {
set workItem [lindex $diffs 0]
set propertyDiffsList [lrange $diffs 1 end]
foreach propertyDiffs $propertyDiffsList {
set fromPropValue [lindex $propertyDiffs 0]
set toPropValue [lindex $propertyDiffs 1]
set basePropValue [lindex $propertyDiffs 2]
foreach propVal "$fromPropValue $toPropValue" {
if {$propVal == "" || [$propVal isNil]} {
continue
}
MTItemPropRepObj promote $propVal
$propVal setInfo PropertyName [$propVal name]
$propVal setInfo Name [$workItem getInfo Name]
$propVal setInfo Type [$workItem getInfo Type]
$propVal item $workItem
}
if {$fromPropValue == "" || [$fromPropValue isNil]} {
continue
}
if {$toPropValue == "" || [$toPropValue isNil]} {
set toPropValue ""
}
set obj $name.$classCount
incr classCount
MTProperty new $obj $fromPropValue $toPropValue
$obj baseValue $basePropValue
$this addChild $obj
}
}
}
# Do not delete this line -- regeneration end marker