Sha256: 0bc12a069e22120f5b5d7a8e981e0a0b08955662d8e634932843430082819593

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

require 'java'
require 'jemmy.jar'
require 'junquenote_app'

include_class 'org.netbeans.jemmy.JemmyProperties'
include_class 'org.netbeans.jemmy.TestOut'

%w(Frame TextArea MenuBar Dialog Button).each do |o| #(1)
  include_class "org.netbeans.jemmy.operators.J#{o}Operator"
end

JemmyProperties.set_current_timeout 'DialogWaiter.WaitDialogTimeout', 3000 #(2)
JemmyProperties.set_current_output TestOut.get_null_output #(3)

class Note
  def initialize
    JunqueNoteApp.new
    @main_window = JFrameOperator.new 'JunqueNote'
  end
  
  def type_in(text)
    edit = JTextAreaOperator.new @main_window
    edit.type_text text
  end
  
  def text
    edit = JTextAreaOperator.new @main_window
    edit.text
  end
  
  def exit!
    begin
      menu = JMenuBarOperator.new @main_window
      menu.push_menu_no_block 'File|Exit', '|'
      
      dialog = JDialogOperator.new "Quittin' time"
      button = JButtonOperator.new dialog, "No"
      button.push
      
      @prompted = true
    rescue
    end
  end
  
  def has_prompted?
    @prompted
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
win_gui-0.1.6 lib/note/java/jnote.rb
win_gui-0.1.4 lib/note/java/jnote.rb
win_gui-0.1.3 lib/note/java/jnote.rb
win_gui-0.1.2 lib/note/java/jnote.rb
win_gui-0.1.1 lib/note/java/jnote.rb
win_gui-0.1.0 lib/note/java/jnote.rb