home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)vsfileobj.tcl /main/hindenburg/4
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)vsfileobj.tcl /main/hindenburg/4 30 May 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "browsuiobj.tcl"
-
- # This class represents a VCM file.
- # It contains general VCM functionality.
-
- Class VSFileObj : {BrowsUiObj} {
- constructor
- method destructor
- method uiClass
- method browserType
- method hasChildren
- method initializeInfo
- method canBeDragged
- method openFile
- method editFile
- method showFile
- method showFileVersion
- method promoter
- method isDirectory
- method uiIdentity
- method directory
- attribute initializedAllInfo
- attribute _directory
- }
-
- constructor VSFileObj {class this name} {
- set this [BrowsUiObj::constructor $class $this $name]
- $this initializedAllInfo 0
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method VSFileObj::destructor {this} {
- set ref [$this _directory]
- if {$ref != ""} {
- [$ref _fileSet] removeValue $this
- }
- # Start destructor user section
- # End destructor user section
- $this BrowsUiObj::destructor
- }
-
-
- # Return 'ExternalFileVersion' as the uiClass in order
- # to share defined object types.
- #
- method VSFileObj::uiClass {this} {
- return "ExternalFileVersion"
- }
-
-
- # Associations of a VSFile, reused by all VCM
- # specific objects.
- #
- proc VSFileObj::associations {} {
- return {}
- }
-
-
- # childTypes of a VSFile, reused by all VCM specific objects.
- #
- proc VSFileObj::childTypes {assoc} {
- return "[BrowsUiObj::childTypes $assoc]"
- }
-
-
- # Controlled lists of a VSFile, reused by all VCM specific objects.
- #
- proc VSFileObj::controlledLists {} {
- return ""
- }
-
-
- # Return standard properties plus general VCM properties.
- #
- proc VSFileObj::infoProperties {} {
- return [concat \
- [BrowserProcs::infoProperties] \
- { "Generated From Class" } \
- ]
- }
-
-
- # Returns the browser type of this file.
- #
- method VSFileObj::browserType {this} {
- return [$this type]
- }
-
-
- # VSFile object has no children: return 0.
- #
- method VSFileObj::hasChildren {this} {
- return 0
- }
-
-
- # Initialize general VCM properties.
- #
- method VSFileObj::initializeInfo {this dummy} {
- $this BrowsUiObj::initializeInfo $dummy
- }
-
- method VSFileObj::canBeDragged {this} {
- return 1
- }
-
- method VSFileObj::openFile {this} {
- $this editFile
- }
-
-
- # Start editor for this file.
- #
- method VSFileObj::editFile {this} {
- if {! [file writable [$this path]]} {
- $this showFile
- return
- }
- set file [$this path]
- $wmttoolObj startM4Command editor "$file" "" "$file"
- if {! [file exists $file]} {
- wmtkwarning "File '$file' does not exist"
- }
- }
-
-
- # Show the file.
- #
- method VSFileObj::showFile {this} {
- set filePath [$this getReference]
- $wmttoolObj startM4Command viewer "$filePath" \
- "$this deleteReference $filePath" "$filePath"
- }
-
-
- # Show another version of this file.
- #
- method VSFileObj::showFileVersion {this version} {
- set filePath [$this getReference $version]
- $wmttoolObj startM4Command viewer "$filePath" \
- "$this deleteReference [list $filePath]" "$filePath"
- }
-
- method VSFileObj::promoter {this} {
- $this uiName [$this name]
- $this parent [$this systemVersion]
- $this initializedAllInfo 0
- $this BrowsUiObj::promoter
- }
-
-
- # Returns 0.
- #
- method VSFileObj::isDirectory {this} {
- return 0
- }
-
- method VSFileObj::uiIdentity {this} {
- regexp {.*(VSFile:.*)$} $this dummy uiIdentity
- return $uiIdentity
- }
-
- # Do not delete this line -- regeneration end marker
-
- method VSFileObj::directory {this args} {
- if {$args == ""} {
- return [$this _directory]
- }
- set ref [$this _directory]
- if {$ref != ""} {
- [$ref _fileSet] removeValue $this
- }
- set obj [lindex $args 0]
- if {$obj != ""} {
- [$obj _fileSet] append $this
- }
- $this _directory $obj
- }
-
-