home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)hcustfuiob.tcl /main/titanic/14
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)hcustfuiob.tcl /main/titanic/14 17 Oct 1997 Copyright 1996 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "browsuiobj.tcl"
-
- Class HCustFUiObj : {BrowsUiObj} {
- constructor
- method destructor
- method externalFiles
- method files
- method initializeInfo
- method moduleFiles
- method printObjects
- method removeObjects
- }
-
- global HCustFUiObj::uiClass
- set HCustFUiObj::uiClass "CustomFiles"
-
-
- constructor HCustFUiObj {class this name} {
- set this [BrowsUiObj::constructor $class $this $name]
- # Start constructor user section
-
- $this uiName "<customization files>"
- $this uiText "customization files"
-
- # End constructor user section
- return $this
- }
-
- method HCustFUiObj::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this BrowsUiObj::destructor
- }
-
- proc HCustFUiObj::associations {} {
- set associations {externalFiles}
-
- # Only show module files when it is visible within the view spec
- if [catch {
- set viewSpec [[.main viewHdlr] getViewSpec \
- "${HCustFUiObj::uiClass}" "" "[[.main infoView] currentViewName]"]
- }] {
- resetErrorVars
- lappend associations moduleFiles
- } elseif {[isCommand $viewSpec] &&
- [lsearch -exact "[$viewSpec associations]" moduleFiles] != -1} {
- lappend associations moduleFiles
- }
-
- return $associations
- }
-
- proc HCustFUiObj::childTypes {assoc} {
- if {[lsearch -exact "[HCustFUiObj::associations]" "$assoc"] == -1} {
- return ""
- }
- set childTypes [BrowserProcs::childTypes $assoc]
- case "$childTypes" in {
- {ExternalFile} {
- return {ExternalDirectory ExternalFile}
- }
- {ModuleFile} {
- return ExternalDirectory
- }
- {default} {
- return "$childTypes"
- }
- }
- }
-
- proc HCustFUiObj::externalEtcFileNames {} {
- set externalEtcFileNames {
- cad.mnu cad.pnl ccd.mnu ccd.pnl checkconfig.checkconfig
- class.mnu cod.mnu cod.pnl desk.mnu desk.vie
- dfd.mnu dfd.pnl diagram.mnu etd.mnu etd.pnl m4env.m4env mgd.mnu mgd.pnl
- objtype.objtype opendefs.opendefs openlocs.openlocs propdefs.propdefs
- proplocs.proplocs roundtrip.roundtrip std.mnu std.pnl ucd.mnu ucd.pnl
- }
- if {! [[[.main currentObj] browsUiObj] inModule]} {
- lappend externalEtcFileNames modules.modules
- }
- return $externalEtcFileNames
- }
-
- proc HCustFUiObj::externalFileNames {} {
- set currentObj [[.main currentObj] browsUiObj]
- if {"$currentObj" == ""} {
- return ""
- }
- for {set parent $currentObj} \
- {"$parent" != ""} \
- {set parent [$parent parent]} {
- if {! [$parent isA ExtFUiObj]} break
- if {"[$parent getInfo Type]" != "ExternalDirectory"} continue
- if {"[$parent getInfo Name]" == "tcl"} {
- return [HCustFUiObj::externalTclFileNames]
- }
- if {"[$parent getInfo Name]" == "etc"} {
- return [HCustFUiObj::externalEtcFileNames]
- }
- }
- return ""
- }
-
- method HCustFUiObj::externalFiles {this} {
- set directory [m4_var get M4_home]
- set triples [list [list etc $directory 0] [list tcl $directory 0]]
- return [$this files $triples]
- }
-
- proc HCustFUiObj::externalTclFileNames {} {
- if [[[.main currentObj] browsUiObj] inModule] {
- return {
- clbrowse.tcl d_desk.tcl docbatch.tcl mtool.tcl s_desk.tcl uce.tcl
- ude.tcl
- }
- }
- return {
- u_clbrowse.tcl u_desk.tcl u_docbatch.tcl u_mtool.tcl u_uce.tcl
- u_ude.tcl
- }
- }
-
- method HCustFUiObj::files {this triples} {
- set externalFiles ""
- foreach triple $triples {
- set file [lindex $triple 0]
- set directory [lindex $triple 1]
- set inModule [lindex $triple 2]
- regsub -all " |\\." "$file" "_" fileId
- set externalFile $this.${ExtFUiObj::uiClass}:$fileId
- if {! [isCommand $externalFile]} {
- ExtFUiObj new $externalFile \
- -parent $this \
- -uiName "$file" \
- -directory $directory \
- -isDirectory 1 \
- -inModule $inModule
- }
- lappend externalFiles $externalFile
- }
- return "$externalFiles"
- }
-
- proc HCustFUiObj::infoProperties {} {
- return [BrowserProcs::infoProperties]
- }
-
- method HCustFUiObj::initializeInfo {this dummy} {
- $this BrowsUiObj::initializeInfo $dummy
- $this setInfo Text "[$this uiText] of [[$this parent] getInfo Text]"
- }
-
- method HCustFUiObj::moduleFiles {this} {
- set triples ""
- if {[.main customLevelVersion] == [$this parent]} {
- foreach module [[.main moduleHdlr] moduleSpecSet] {
- set path [$module path]
- set directory [path_name directory $path]
- set file [path_name file $path]
- lappend triples [list $file $directory 1]
- }
- }
- return [$this files [lsort $triples]]
- }
-
- method HCustFUiObj::printObjects {this} {
- set asciiFiles ""
- foreach obj [.main selectedObjSet] {
- lappend asciiFiles [path_name concat [$obj directory] [$obj uiName]]
- }
- BrowserProcs::printObjects $asciiFiles ""
- }
-
- method HCustFUiObj::removeObjects {this} {
- set box .main.removeWarning
- YesNoWarningDialog new $box \
- -title "Confirm Object Delete" \
- -message [BrowserProcs::removeMessage] \
- -noPressed {%this delete} \
- -yesPressed {
- set script ""
- foreach obj [.main selectedObjSet] {
- if {"$script" != ""} {
- append script " ;"
- }
- append script [list BasicFS::removeFile \
- [path_name concat [$obj directory] [$obj uiName]]]
- }
- .main startCommand tcl "$script" "" "" {1 0} 1
- %this delete
- }
- $box delCancelButton
- $box popUp
- }
-
- # Do not delete this line -- regeneration end marker
-
-