home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)opencdmdlg.tcl /main/titanic/9
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)opencdmdlg.tcl /main/titanic/9 27 Nov 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "browsviewd.tcl"
-
- Class OpenCdmDlg : {BrowsViewDialog} {
- constructor
- method destructor
- method open
- method popUp
- attribute editable
- attribute cdm
- attribute levelPath
- }
-
- constructor OpenCdmDlg {class this name} {
- set this [BrowsViewDialog::constructor $class $this $name]
- # Start constructor user section
-
- $this config \
- -message "Select Class Diagram to open" \
- -headerSpecList {
- {Name 25 ascii {increasing 2}}
- {System 20 ascii {increasing 1}}
- {Version 20 ascii {increasing 3}}
- {Status 14 ascii {increasing 4}}
- } \
- -cancelPressed {%this delete} \
- -okPressed {
- %this open [[lindex [[%this view] selectedSet] 0] object]
- %this delete
- }
- [$this view] selectionPolicy BROWSE
-
- # End constructor user section
- return $this
- }
-
- method OpenCdmDlg::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this BrowsViewDialog::destructor
- }
-
- method OpenCdmDlg::open {this cad} {
- if {[$this editable] == 0 || [$cad getInfo "In Corporate"] == "Yes" ||
- [$cad getInfo Status] != "working"} {
- set action showFile
- } else {
- set action editFile
- }
- set cc [ClientContext::global]
- set decSys [$cad system]
- set phaseV [$cc currentPhase]
- set decSysV [$phaseV findSystemVersion -bySystem $decSys]
-
- if {[string compare [$cc currentSystem] $decSysV] == 0} {
- # systems equal
- $cad $action [[$this levelPath] asString]
- } else {
- # systems not equal
- set lvlPath [LevelPath new [$cc currentLevelIdString]]
- $lvlPath changeTail [$decSysV identity]
- $cad $action [$lvlPath asString]
- }
- }
-
- method OpenCdmDlg::popUp {this} {
- set cdm [$this cdm]
- if {[[$this levelPath] depth] == "None"} {
- set cc [ClientContext::global]
- set cv [$cc currentConfig]
- set sv [$cc currentSystem]
- } else {
- set cv [ConfigVersion new [[$this levelPath] nameAt Config]]
- set sv [SystemVersion new [[$this levelPath] nameAt System]]
- }
-
- set item [[$cdm file] item]
- $sv getDecompositions \
- $item $cv decompComponents cad decompSystems decompFiles
- set nrOfFiles [llength $decompFiles]
-
- if {$nrOfFiles == 0} {
- return [list 0 "No Class Diagrams's exist in which class '[$item name]' occurs"]
- }
-
- set typeSpec [getObjectSpec [.main objectHdlr] Graph cad]
- if {"$typeSpec" != ""} {
- set icon [$typeSpec smallIcon]
- } else {
- set icon ""
- }
- set objectSpecList ""
- foreach decompFile $decompFiles {
- lappend objectSpecList [list $icon \
- [[$decompFile file] qualifiedName :] \
- [[$decompFile system] name] \
- [$decompFile versionName] \
- [$decompFile status] \
- ]
- }
- if [$this editable] {
- set title "Edit"
- } else {
- set title "Show"
- }
- append title " CDM"
- $this config \
- -title $title \
- -objectSpecList $objectSpecList \
- -objectList $decompFiles
- $this BrowsViewDialog::popUp
- return 1
- }
-
- # Do not delete this line -- regeneration end marker
-
-