home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
msimportco.tcl
< prev
next >
Wrap
Text File
|
1997-06-03
|
5KB
|
133 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)msimportco.tcl /main/hindenburg/7
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)msimportco.tcl /main/hindenburg/7 3 Jun 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 packageDict
}
constructor MsImportControl {class this name userName password} {
set this [MsRepChooser::constructor $class $this $name $userName $password]
# 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 {}]
set pathName [path_name concat [m4_var get M4_home] \
[path_name concat contrib \
[path_name concat ObjectTeamMsRepUml \
[path_name concat tcl msumlimport.tcl]]]]
set otprintScr "[m4_path_name bin otprint$EXE_EXT] \
$pathName -- $tmpFile $modelNo [$this repName] $packNo;\
[m4_path_name bin otsh$EXE_EXT] -f $tmpFile"
.main startCommand xtool $otprintScr "" \
"Importing from MS Repository" {0 0} 0
$this delete
}
# Do not delete this line -- regeneration end marker