Class: RubyClip

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_gui_creator/ruby_clip.rb

Class Method Summary collapse

Class Method Details

.get_clipboard_contentsObject



19
20
21
22
23
# File 'lib/simple_gui_creator/ruby_clip.rb', line 19

def self.get_clipboard_contents
   clipboard = Toolkit.getDefaultToolkit().getSystemClipboard()
   data = clipboard.get_contents self
   data.getTransferData java.awt.datatransfer.DataFlavor::stringFlavor
end

.lostOwnership(aClipboard, aContents) ⇒ Object



15
16
17
# File 'lib/simple_gui_creator/ruby_clip.rb', line 15

def self.lostOwnership(aClipboard, aContents) 
   # ignore...
end

.set_clipboard(to_this) ⇒ Object



9
10
11
12
13
# File 'lib/simple_gui_creator/ruby_clip.rb', line 9

def self.set_clipboard to_this
  stringSelection = StringSelection.new( to_this.to_s )
  clipboard = Toolkit.getDefaultToolkit().getSystemClipboard()
  clipboard.setContents( stringSelection, self );
end