DeviceWorkstation.st
changeset 6130 494a954d3215
parent 6129 d83e9ee7e063
child 6145 a94de0c92f13
equal deleted inserted replaced
6129:d83e9ee7e063 6130:494a954d3215
   569 
   569 
   570 bufferAsString:aBuffer
   570 bufferAsString:aBuffer
   571     "aBuffer (my current selection) as a string"
   571     "aBuffer (my current selection) as a string"
   572 
   572 
   573     aBuffer isString ifTrue:[
   573     aBuffer isString ifTrue:[
   574 	^ aBuffer string.
   574         ^ aBuffer string.
   575     ].
   575     ].
   576 
   576 
   577     aBuffer isNil ifTrue:[
   577     aBuffer isNil ifTrue:[
   578 	^ ''
   578         ^ ''
   579     ].
   579     ].
   580 
   580 
   581     aBuffer isStringCollection ifTrue:[
   581     aBuffer isStringCollection ifTrue:[
   582 	^ aBuffer
   582         ^ aBuffer
   583 	    from:1
   583             from:1
   584 	    to:aBuffer size
   584             to:aBuffer size
   585 	    asStringWith:Character cr
   585             asStringWith:Character cr
   586 	    compressTabs:false
   586             compressTabs:false
   587 	    final:nil
   587             final:nil
   588 	    withEmphasis:false.
   588             withEmphasis:false.
   589     ].
   589     ].
   590 
   590 
   591     RecursiveStoreError handle:[:ex |
   591     Error handle:[:ex |
       
   592         Transcript showCR:'error while converting copyBuffer to string: ',ex description.
   592        ^ ''
   593        ^ ''
   593     ] do:[
   594     ] do:[
   594        ^ aBuffer storeString
   595        ^ aBuffer storeString
   595     ]
   596     ]
   596 
   597 
  3166 !
  3167 !
  3167 
  3168 
  3168 copyBufferAsString
  3169 copyBufferAsString
  3169     "return my current selection as a string"
  3170     "return my current selection as a string"
  3170 
  3171 
  3171     |copyBufferContents s|
  3172     ^ self class bufferAsString:self getCopyBuffer.
  3172 
       
  3173     copyBufferContents := self getCopyBuffer.
       
  3174     copyBufferContents isString ifFalse:[
       
  3175         s := copyBufferContents class nameWithArticle.
       
  3176         Transcript showCR:'invalid object in copyBuffer: ',s.
       
  3177         ^ s.
       
  3178     ].
       
  3179     ^ self class bufferAsString:copyBufferContents.
       
  3180 !
  3173 !
  3181 
  3174 
  3182 getClipboardObjectFor:drawableId
  3175 getClipboardObjectFor:drawableId
  3183     "Retrieve the common per-display selection object.
  3176     "Retrieve the common per-display selection object.
  3184      For clipBoard mechanisms to work (into ST/X),
  3177      For clipBoard mechanisms to work (into ST/X),
  8254 ! !
  8247 ! !
  8255 
  8248 
  8256 !DeviceWorkstation class methodsFor:'documentation'!
  8249 !DeviceWorkstation class methodsFor:'documentation'!
  8257 
  8250 
  8258 version
  8251 version
  8259     ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.591 2013-09-01 10:08:52 cg Exp $'
  8252     ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.592 2013-09-01 10:51:01 cg Exp $'
  8260 !
  8253 !
  8261 
  8254 
  8262 version_CVS
  8255 version_CVS
  8263     ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.591 2013-09-01 10:08:52 cg Exp $'
  8256     ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.592 2013-09-01 10:51:01 cg Exp $'
  8264 ! !
  8257 ! !
  8265 
  8258 
  8266 
  8259 
  8267 DeviceWorkstation initialize!
  8260 DeviceWorkstation initialize!