home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)csconfigvi.tcl /main/titanic/13
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)csconfigvi.tcl /main/titanic/13 17 Oct 1997 Copyright 1996 Cayenne Software Inc.
-
- # Start user added include file section
- require "cstree.tcl"
- # End user added include file section
-
- require "reptoolvie.tcl"
-
- Class CSConfigView : {RepToolView} {
- method destructor
- constructor
- method initialize
- method selectedObjSet
- method selectionChanged
- method update
- method canDelete
- method canReload
- method canChangeServerEntry
- method canChangeParameters
- method canShowLog
- method canLogRegistrations
- method canLogMessage
- method canShutdown
- method changeParamMode
- method setFont
- method getFont
- method fileDelete
- method fileReload
- method fileChangeServerEntry
- method fileChangeParameters
- method fileShowLog
- method fileLogRegistrations
- method fileLogMessage
- method fileShutdown
- method viewRefreshSelected
- method optionsParamMode
- method optionsLogFont
- method helpOnContext
- attribute paramMode
- attribute tree
- attribute info
- }
-
- method CSConfigView::destructor {this} {
- # Start destructor user section
- # End destructor user section
- [$this tree].root saveConfiguration
- $this RepToolView::destructor
- }
-
- constructor CSConfigView {class this name} {
- set this [RepToolView::constructor $class $this $name repconf]
-
- $this setTitle "Client/Server Configuration" rep_conf_64
- $this firstExposed "$this initialize"
-
- $this paramMode [m4_var get M4_csconfig_parammode]
- if {[$this paramMode] == ""} {
- $this paramMode "Normal"
- }
-
- # Set a small ORB timeout to have little delays caused by trying to
- # access objects serviced by exited brokers or servers.
- # Not too small, since now we're starting a dbserver when
- # editing server definitions.
- #
- [$this rep] quickTimeOut 10000
-
- # Create main interface part.
- #
- interface VerSplitter $this.gui.row {
- CSTree tree {
- columnCount 30
- }
- MultiLineText info {
- editable 0
- columnCount 40
- rowCount 20
- }
- }
-
- $this tree $this.gui.row.tree
- [$this tree] view $this
- [$this tree] selectionChanged "$this selectionChanged"
- [$this tree] font [$this getFont]
-
- $this info $this.gui.row.info
- [$this info] font [$this getFont]
-
- TreePopUpMenu new [$this tree].pop -poppedUp {
- [.main tree].pop entrySet [[.main menuHandler] validPopUpEntrySet]
- }
-
- return $this
- }
-
- proc CSConfigView::repToolClass {} {
- return "CSConfigView"
- }
-
- method CSConfigView::initialize {this} {
- busy {
- $this viewRefresh
-
- set root [$this tree].root
- [$this tree] selected $root
- $this selectionChanged
- $root display
- }
- }
-
- method CSConfigView::selectedObjSet {this} {
- return [[$this tree] selected]
- }
-
- method CSConfigView::selectionChanged {this} {
- if [lempty [$this selectedObjSet]] {
- [$this info] text ""
- }
- $this RepToolView::selectionChanged
- }
-
- method CSConfigView::update {this} {
- [$this tree] update
-
- foreach logDlg [info commands $this.showlogdlg-*] {
- if [$logDlg isA BrokerLogDialog] {
- $logDlg refresh
- }
- }
- }
-
- method CSConfigView::canDelete {this} {
- set obj [[$this tree] selected]
- return [$obj canDelete]
- }
-
- method CSConfigView::canReload {this} {
- set obj [[$this tree] selected]
- return [$obj canReload]
- }
-
- method CSConfigView::canChangeServerEntry {this} {
- set obj [[$this tree] selected]
- return [$obj canChangeEntry]
- }
-
- method CSConfigView::canChangeParameters {this} {
- set obj [[$this tree] selected]
- return [$obj canChangeParams]
- }
-
- method CSConfigView::canShowLog {this} {
- set obj [[$this tree] selected]
- return [$obj canShowLog]
- }
-
- method CSConfigView::canLogRegistrations {this} {
- set obj [[$this tree] selected]
- return [$obj canLogRegistrations]
- }
-
- method CSConfigView::canLogMessage {this} {
- set obj [[$this tree] selected]
- return [$obj canLogMessage]
- }
-
- method CSConfigView::canShutdown {this} {
- set obj [[$this tree] selected]
- return [$obj canShutdown]
- }
-
- method CSConfigView::changeParamMode {this newMode} {
- $this paramMode $newMode
- m4_var set M4_csconfig_parammode $newMode
- [$this tree] update 0
-
- set obj [[$this tree] selected]
- if ![lempty $obj] {
- $obj display
- }
- }
-
- method CSConfigView::setFont {this font} {
- [$this tree] font $font
- [$this info] font $font
-
- $this RepToolView::setFont $font
- }
-
- method CSConfigView::getFont {this} {
- return [m4_var get M4_font -context repconf]
- }
-
- method CSConfigView::fileDelete {this} {
- [[$this tree] selected] removeEntry
- }
-
- method CSConfigView::fileReload {this} {
- [[$this tree] selected] reload
- }
-
- method CSConfigView::fileChangeServerEntry {this} {
- [[$this tree] selected] changeEntry
- }
-
- method CSConfigView::fileChangeParameters {this} {
- [[$this tree] selected] changeParameters
- }
-
- method CSConfigView::fileShowLog {this} {
- [[$this tree] selected] showLog
- }
-
- method CSConfigView::fileLogRegistrations {this} {
- [[$this tree] selected] logRegistrations
- }
-
- method CSConfigView::fileLogMessage {this} {
- [[$this tree] selected] logMessage
- }
-
- method CSConfigView::fileShutdown {this} {
- [[$this tree] selected] shutdown
- }
-
- method CSConfigView::viewRefreshSelected {this} {
- set obj [[$this tree] selected]
- $obj update 0
- $obj display
- }
-
- method CSConfigView::optionsParamMode {this} {
- set dlg [ListDialog new $this.optionsparammode \
- -title "Parameter Display Mode" \
- -message "Change Parameter Display Mode" \
- -selectionPolicy "BROWSE" \
- -modal 1]
-
- if $win95 {
- $dlg entrySet { "Normal" "Meta4" }
- } else {
- $dlg entrySet { "Normal" "Meta4" "Sh" "Csh" }
- }
- $dlg rowCount [llength [$dlg entrySet]]
- $dlg selectedSet [list [$this paramMode]]
-
- $dlg okPressed "
- $this changeParamMode \[lindex \[%this selectedSet] 0]
- %this delete
- "
- $dlg helpPressed "$this helpOnName changeParamMode"
- $dlg popUp
- }
-
- method CSConfigView::optionsLogFont {this} {
- set dlg $this.logfontdlg
- if ![isCommand $dlg] {
- FontChooser new $dlg \
- -title "Broker Log Font" \
- -value [m4_var get M4_font -context brokerlog] \
- -okPressed "
- m4_var set M4_font \[%this value] -context brokerlog
- foreach logDlg \[info commands .main.showlogdlg-*] {
- if \[\$logDlg isA BrokerLogDialog] {
- \[\$logDlg text] font \[%this value]
- }
- }
- "
- }
- $dlg popUp
- }
-
- method CSConfigView::helpOnContext {this} {
- set selected [[$this tree] selected]
- if {$selected != ""} {
- $this helpOnName "selected[$selected objType]"
- } else {
- $this helpOnName repToolCSConfigView
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-