glimmer 0.1.0.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Gemfile +9 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +54 -0
- data/Rakefile +54 -0
- data/VERSION +1 -0
- data/bin/glimmer +132 -0
- data/glimmer.gemspec +145 -0
- data/images/Bitter-sweet.jpg +0 -0
- data/{src → lib}/command_handler.rb +7 -10
- data/{src → lib}/command_handler_chain_factory.rb +29 -22
- data/{src → lib}/command_handler_chain_link.rb +19 -22
- data/{src → lib}/command_handlers.rb +29 -26
- data/{src → lib}/command_handlers/bind_command_handler.rb +25 -28
- data/lib/command_handlers/combo_selection_data_binding_command_handler.rb +39 -0
- data/{src → lib}/command_handlers/data_binding_command_handler.rb +61 -64
- data/lib/command_handlers/list_selection_data_binding_command_handler.rb +42 -0
- data/lib/command_handlers/models/list_observer.rb +31 -0
- data/{src → lib}/command_handlers/models/model_observer.rb +28 -25
- data/{src → lib}/command_handlers/models/observable_array.rb +53 -46
- data/lib/command_handlers/models/observable_model.rb +61 -0
- data/{src → lib}/command_handlers/models/r_runnable.rb +11 -14
- data/{src → lib}/command_handlers/models/r_shell.rb +23 -26
- data/lib/command_handlers/models/r_tab_item_composite.rb +25 -0
- data/{src → lib}/command_handlers/models/r_widget.rb +16 -14
- data/lib/command_handlers/models/r_widget_listener.rb +9 -0
- data/{src → lib}/command_handlers/models/r_widget_packages.rb +5 -8
- data/{src → lib}/command_handlers/models/table_items_updater.rb +38 -39
- data/{src → lib}/command_handlers/models/widget_observer.rb +4 -6
- data/{src → lib}/command_handlers/shell_command_handler.rb +14 -17
- data/{src → lib}/command_handlers/swt_constant_command_handler.rb +18 -21
- data/lib/command_handlers/tab_item_command_handler.rb +22 -0
- data/{src → lib}/command_handlers/table_column_properties_data_binding_command_handler.rb +20 -23
- data/{src → lib}/command_handlers/table_items_data_binding_command_handler.rb +26 -29
- data/{src → lib}/command_handlers/widget_command_handler.rb +22 -25
- data/{src → lib}/command_handlers/widget_listener_command_handler.rb +36 -34
- data/{src → lib}/command_handlers/widget_method_command_handler.rb +18 -21
- data/{src → lib}/glimmer.rb +52 -45
- data/lib/parent.rb +5 -0
- data/{src → lib}/shine.rb +21 -24
- data/{src → lib}/xml_command_handlers.rb +15 -18
- data/{src → lib}/xml_command_handlers/html_command_handler.rb +45 -49
- data/{src → lib}/xml_command_handlers/models/depth_first_search_iterator.rb +17 -20
- data/{src → lib}/xml_command_handlers/models/name_space_visitor.rb +17 -20
- data/{src → lib}/xml_command_handlers/models/node.rb +80 -83
- data/{src → lib}/xml_command_handlers/models/node_visitor.rb +8 -11
- data/{src → lib}/xml_command_handlers/models/xml_visitor.rb +58 -61
- data/{src → lib}/xml_command_handlers/xml_command_handler.rb +18 -22
- data/{src → lib}/xml_command_handlers/xml_name_space_command_handler.rb +31 -34
- data/{src → lib}/xml_command_handlers/xml_tag_command_handler.rb +23 -26
- data/{src → lib}/xml_command_handlers/xml_text_command_handler.rb +19 -22
- data/samples/contactmanager/contact.rb +0 -3
- data/samples/contactmanager/contact_manager.rb +1 -4
- data/samples/contactmanager/contact_manager_presenter.rb +0 -3
- data/samples/contactmanager/contact_repository.rb +0 -3
- data/samples/hello_combo.rb +32 -0
- data/samples/hello_world.rb +1 -4
- data/samples/login.rb +1 -4
- data/samples/tictactoe/tic_tac_toe.rb +2 -5
- data/samples/tictactoe/tic_tac_toe_board.rb +0 -3
- data/test/glimmer_combo_data_binding_test.rb +131 -0
- data/test/glimmer_constant_test.rb +6 -11
- data/test/glimmer_data_binding_test.rb +16 -16
- data/test/glimmer_list_data_binding_test.rb +223 -0
- data/test/glimmer_listeners_test.rb +6 -6
- data/test/glimmer_shine_data_binding_test.rb +7 -6
- data/test/glimmer_tab_item_test.rb +61 -0
- data/test/glimmer_table_data_binding_test.rb +7 -20
- data/test/glimmer_test.rb +18 -13
- data/test/helper.rb +21 -0
- data/test/observable_model_test.rb +2 -4
- data/test/r_widget_test.rb +5 -5
- data/test/samples/contactmanager/contact_manager_presenter_test.rb +1 -4
- data/test/samples/tictactoe/tic_tac_toe_test.rb +1 -4
- data/test/xml/glimmer_xml_test.rb +43 -43
- metadata +210 -105
- data/COPYING.LGPL +0 -504
- data/README +0 -27
- data/src/command_handlers/models/observable_model.rb +0 -35
- data/src/command_handlers/models/r_widget_listener.rb +0 -12
- data/src/parent.rb +0 -8
- data/src/swt.rb +0 -10
- data/src/xml.rb +0 -10
data/README
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
Glimmer - a JRuby DSL that enables easy and efficient authoring of user-interfaces
|
2
|
-
using the robust platform-independent Eclipse SWT library. Glimmer comes with built-in
|
3
|
-
data-binding support to greatly facilitate synchronizing UI with domain models.
|
4
|
-
|
5
|
-
Copyright (C) 2007 Annas Al Maleh
|
6
|
-
Licensed under the LGPL. See /COPYING.LGPL for more details.
|
7
|
-
|
8
|
-
Instructions for use with stand-alone SWT:
|
9
|
-
1. Download the "SWT binary and source" archive from the Eclipse site and follow their instructions.
|
10
|
-
http://download.eclipse.org/eclipse/downloads/drops/R-3.3.1.1-200710231652/details.php#SWT
|
11
|
-
2. Have your program require the swt.rb file
|
12
|
-
3. Create a class that includes the Glimmer module and you will be able to write Glimmer syntax
|
13
|
-
|
14
|
-
Instructions for use with Eclipse:
|
15
|
-
1. Download and setup Eclipse 3.3 or 3.2
|
16
|
-
2. Download and setup jRuby 1.0.2
|
17
|
-
3. Modify Java launch command in jRuby script/batch file to include SWT libraries in both:
|
18
|
-
a. Classpath; must include %ECLIPSE_HOME%/plugins/org.eclipse.swt*.jar
|
19
|
-
For example with Eclipse 3.2 on Windows, we add the following:
|
20
|
-
-cp "%CLASSPATH%;%ECLIPSE_HOME%\plugins\org.eclipse.swt.win32.win32.x86_3.2.0.v3232m.jar;%ECLIPSE_HOME%\plugins\org.eclipse.swt_3.2.0.v3232o.jar"
|
21
|
-
b. java.library.path; must point to %ECLIPSE_HOME%/plugins/org.eclipse.swt* folder
|
22
|
-
For example, with Eclipse 3.2 on Windows, we add the following:
|
23
|
-
-Djava.library.path="%ECLIPSE_HOME%\plugins\org.eclipse.swt.win32.win32.x86_3.2.0.v3232m"
|
24
|
-
4. Have your program require the glimmer.rb file
|
25
|
-
5. Create a class that includes the Glimmer module and you will be able to write Glimmer syntax
|
26
|
-
|
27
|
-
Check samples folder for examples on how to write Glimmer programs.
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# Copyright (C) 2007-2008 Annas Al Maleh
|
2
|
-
# Licensed under the LGPL. See /COPYING.LGPL for more details.
|
3
|
-
|
4
|
-
module ObservableModel
|
5
|
-
|
6
|
-
def add_observer(property_name, observer)
|
7
|
-
property_observer_list(property_name) << observer
|
8
|
-
end
|
9
|
-
|
10
|
-
def property_observer_hash
|
11
|
-
@property_observers = Hash.new unless @property_observers
|
12
|
-
@property_observers
|
13
|
-
end
|
14
|
-
|
15
|
-
def property_observer_list(property_name)
|
16
|
-
property_observer_hash[property_name.to_sym] = [] unless property_observer_hash[property_name.to_sym]
|
17
|
-
property_observer_hash[property_name.to_sym]
|
18
|
-
end
|
19
|
-
|
20
|
-
def notify_observers(property_name)
|
21
|
-
property_observer_list(property_name).each {|observer| observer.update(send(property_name))}
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.extend_object(model)
|
25
|
-
super
|
26
|
-
model.methods.each do |method|
|
27
|
-
setter_method_pattern = /^\w+=$/
|
28
|
-
if (method.match(setter_method_pattern))
|
29
|
-
getter_method = method[0, method.length - 1]
|
30
|
-
model.instance_eval "alias original_#{method} #{method}\n"
|
31
|
-
model.instance_eval "def #{method}(value) \n self.original_#{method}(value); notify_observers('#{getter_method}'); \nend"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
data/src/parent.rb
DELETED
data/src/swt.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
# Glimmer - a JRuby DSL that enables easy and efficient authoring of user-interfaces
|
2
|
-
# using the robust platform-independent Eclipse SWT library. Glimmer comes with built-in
|
3
|
-
# data-binding support to greatly facilitate synchronizing UI with domain models.
|
4
|
-
#
|
5
|
-
# Copyright (C) 2007-2008 Annas Al Maleh
|
6
|
-
# Licensed under the LGPL. See /COPYING.LGPL for more details.
|
7
|
-
|
8
|
-
require File.dirname(__FILE__) + "/glimmer"
|
9
|
-
require File.dirname(__FILE__) + "/command_handlers"
|
10
|
-
|
data/src/xml.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
# Glimmer - a JRuby DSL that enables easy and efficient authoring of user-interfaces
|
2
|
-
# using the robust platform-independent Eclipse SWT library. Glimmer comes with built-in
|
3
|
-
# data-binding support to greatly facilitate synchronizing UI with domain models.
|
4
|
-
#
|
5
|
-
# Copyright (C) 2007-2008 Annas Al Maleh
|
6
|
-
# Licensed under the LGPL. See /COPYING.LGPL for more details.
|
7
|
-
|
8
|
-
require File.dirname(__FILE__) + "/glimmer"
|
9
|
-
require File.dirname(__FILE__) + "/xml_command_handlers"
|
10
|
-
|