home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
msimportco.tcl
< prev
next >
Wrap
Text File
|
1997-10-28
|
4KB
|
135 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)msimportco.tcl /main/titanic/5
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)msimportco.tcl /main/titanic/5 28 Oct 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
#require "msrepchoos.tcl"
Class MsImportControl : {MsRepChooser} {
constructor
method destructor
method handleOk
method selectModel
method selectPackage
method modelSelected
attribute modelDict
attribute type
attribute packageDict
}
constructor MsImportControl {class this name userName password i_type} {
set this [MsRepChooser::constructor $class $this $name $userName $password]
$this type $i_type
# Start constructor user section
$this config \
-title "Repository to import from"
$this modelDict [Dictionary new]
$this packageDict [Dictionary new]
# End constructor user section
return $this
}
method MsImportControl::destructor {this} {
# Start destructor user section
# End destructor user section
$this MsRepChooser::destructor
}
method MsImportControl::handleOk {this} {
$this MsRepChooser::handleOk
if {[$this repFound] && [$this hasUml]} {
$this selectModel
}
}
method MsImportControl::selectModel {this} {
set modelDict [$this modelDict]
set models ""
set sv [[ClientContext::global] currentSystem]
set root [$this root]
for {set elNo 1} {$elNo <=[$root getNoOfElements]} {incr elNo} {
set element [$root getElement $elNo]
set elementName [$element property name]
$modelDict set $elementName $elNo
lappend models $elementName
}
set box .main.msSelectModel
if ![isCommand $box] {
ClassMaker::extend ListDialog ModelsListDialog "control sv root"
#cancelPressed {%this delete}
ModelsListDialog new $box \
-modal yes \
-title "UML model selection" \
-message "Select UML Model to import:" \
-rowCount 8 \
-helpPressed {.main helpOnName importMSRep} \
-okPressed {
set control [%this control]
set modelNo [[$control modelDict] set [%this selectedSet]]
$control modelSelected $modelNo
}
}
$box control $this
$box root $root
$box sv $sv
$box entrySet $models
$box popUp
}
method MsImportControl::selectPackage {this model modelNo} {
set packageDict [$this packageDict]
set packages ""
for {set elNo 1} {$elNo <=[$model getNoOfPackages]} {incr elNo} {
set element [$model getPackage $elNo]
set elementName [$element property name]
$packageDict set $elementName $elNo
lappend packages $elementName
}
set box .main.msSelectPackage
if ![isCommand $box] {
ClassMaker::extend ListDialog PackageListDialog "control modelNo"
PackageListDialog new $box \
-modal yes \
-title "UML package selection" \
-message "Select UML Package to import:" \
-rowCount 8 \
-okPressed {
set control [%this control]
set packNo [[$control packageDict] set [lindex [%this selectedSet] 0]]
$control modelSelected [%this modelNo] $packNo
}
}
$box modelNo $modelNo
$box control $this
$box entrySet $packages
$box popUp
}
method MsImportControl::modelSelected {this modelNo {packNo ""}} {
set tmpFile [args_file {}]
if {[$this type] == "RT"} {
set otprintScr "[m4_path_name bin otsh$EXE_EXT] -f "
} else {
set otprintScr "[m4_path_name bin otprint$EXE_EXT] "
}
set otprintScr "$otprintScr \
\"[m4_path_name tcl msumlimport.tcl]\" -- \
$tmpFile $modelNo [$this repName] $packNo "
.main startCommand mtool $otprintScr "" \
"Importing from MS Repository" {1 0} 0
$this delete
}
# Do not delete this line -- regeneration end marker