jrubyconf-button 1-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+
2
+ require 'java'
3
+ require 'rubygems'
4
+ require 'swt'
5
+
6
+ class ButtonApp
7
+ attr_reader :shell
8
+
9
+ def initialize
10
+ display = Swt::Widgets::Display.get_current
11
+ @shell = Swt::Widgets::Shell.new
12
+ @shell.setLayout(Swt::Layout::FillLayout.new)
13
+ button = Swt::Widgets::Button.new(@shell, Swt::SWT::PUSH)
14
+ button.set_text("Click Me")
15
+ button.add_selection_listener { puts "Clicked!" }
16
+ @shell.pack
17
+ @shell.open
18
+ end
19
+ end
20
+
21
+ app = ButtonApp.new
22
+
23
+ Swt.event_loop { app.shell.disposed? }
24
+
@@ -0,0 +1,4 @@
1
+ Feature: The button
2
+
3
+ Scenario: Button exists
4
+ Then the button should show the text "Click Me"
@@ -0,0 +1,12 @@
1
+ def shell
2
+ display = Swt::Widgets::Display.get_current
3
+ shell = display.get_shells.to_a.first
4
+ end
5
+
6
+ def button
7
+ shell.children.to_a.first
8
+ end
9
+
10
+ Then /^the button should show the text "([^"]*)"$/ do |arg1|
11
+ button.text.should == arg1
12
+ end
@@ -0,0 +1,5 @@
1
+ $:.unshift(File.expand_path("../../../bin", __FILE__))
2
+
3
+ Swt.sync_exec do
4
+ load 'jrubyconf-button'
5
+ end
metadata ADDED
@@ -0,0 +1,60 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jrubyconf-button
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: "1"
6
+ platform: java
7
+ authors:
8
+ - Daniel Lucraft
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-08-03 00:00:00 -04:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: A JRubyConf button!
18
+ email:
19
+ - dan@fluentradical.com
20
+ executables:
21
+ - jrubyconf-button
22
+ extensions: []
23
+
24
+ extra_rdoc_files: []
25
+
26
+ files:
27
+ - bin/jrubyconf-button
28
+ - features/button.feature
29
+ - features/step_definitions/button_steps.rb
30
+ - features/support/env.rb
31
+ has_rdoc: true
32
+ homepage: ""
33
+ licenses: []
34
+
35
+ post_install_message:
36
+ rdoc_options: []
37
+
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: "0"
52
+ requirements: []
53
+
54
+ rubyforge_project:
55
+ rubygems_version: 1.5.1
56
+ signing_key:
57
+ specification_version: 3
58
+ summary: A button!
59
+ test_files: []
60
+