home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / readme / fileins / dtshadow.st < prev    next >
Encoding:
Text File  |  1995-10-24  |  2.2 KB  |  69 lines

  1. " Fix for Distributed Feature 
  2.  
  3.   This file in fixes a problem where the name server browser
  4.    and object exchange actions for 
  5.  
  6.       'ReferencedObject'-> 'Install in Shadow Dictionary', and
  7.       'ReferencedObject'-> 'Install in Smalltalk Dictionary'
  8.  
  9.   install a remote object into the dictionary rather than a 
  10.   shadow for the object (a shadow is based on an object reference
  11.   and is reconnectable; whereas a remote object is not 
  12.   reconnectable)."
  13.  
  14.  
  15. DtNameServerBrowserApplication becomeDefault!
  16.  
  17. !DtGlobalReference publicMethods !
  18.  
  19. dtInstallInShadowDictionaryFor: aBrowser
  20.     "Install the selected objects in the browsers shadowdictionary"
  21.     | keyString shadow theObject |
  22.     aBrowser message: NlsBlank.
  23.     aBrowser execLongOperation: [
  24.         shadow := self shadow. 
  25.         theObject := shadow dtYourself.  ].
  26.     theObject dtIsAvailable ifFalse: [
  27.                 aBrowser beep;
  28.                     message: (self getMRIString: DtMsgReferenceInvalidOrUnavailable group: #DsMessages).
  29.                 ^nil  ].
  30.  
  31.     keyString := aBrowser shadowDictionary 
  32.                 dtPromptForStringKeyAndAdd: shadow
  33.                                 defaultKeyString: NlsNull
  34.                                 message: (self getMRIString: DtMsgEnterKeyInShadowDictionary group: #DsMessages).
  35.  
  36.     keyString isNil ifTrue: [
  37.                 aBrowser message: NlsMsgActionCancelled.
  38.                 ^nil].
  39.  
  40.     aBrowser message: (self getMRIString: DtMsgObjectInstalledInShadowDictionary group: #DsMessages).
  41.     
  42. !
  43.  
  44. dtInstallInSmalltalkDictionaryFor: aBrowser
  45.     "Install the selected objects in the browsers shadowdictionary"
  46.     | keyString shadow theObject |
  47.     aBrowser message: NlsBlank.
  48.     aBrowser execLongOperation: [
  49.         shadow := self shadow.
  50.         theObject := shadow dtYourself.  ].
  51.     theObject dtIsAvailable ifFalse: [
  52.                 aBrowser beep;
  53.                         message: (self getMRIString: DtMsgReferenceInvalidOrUnavailable group: #DsMessages).
  54.                 ^nil  ].
  55.  
  56.     keyString := Smalltalk
  57.                 dtPromptForSymbolKeyAndAdd: shadow
  58.                                 defaultKeyString: NlsNull
  59.                                 message: (
  60.                                     self getMRIString: DtMsgEnterKeyInSmalltalkDictionary group: #DsMessages).
  61.  
  62.     keyString isNil ifTrue: [
  63.                 aBrowser message: NlsMsgActionCancelled.
  64.                 ^nil].
  65.  
  66.     aBrowser message: (self getMRIString: DtMsgObjectInstalledInSmalltalkDictionary group: #DsMessages).
  67.     
  68. ! !
  69.