glimmer 0.1.0.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. data/.rvmrc +1 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE.txt +20 -0
  4. data/README.markdown +54 -0
  5. data/Rakefile +54 -0
  6. data/VERSION +1 -0
  7. data/bin/glimmer +132 -0
  8. data/glimmer.gemspec +145 -0
  9. data/images/Bitter-sweet.jpg +0 -0
  10. data/{src → lib}/command_handler.rb +7 -10
  11. data/{src → lib}/command_handler_chain_factory.rb +29 -22
  12. data/{src → lib}/command_handler_chain_link.rb +19 -22
  13. data/{src → lib}/command_handlers.rb +29 -26
  14. data/{src → lib}/command_handlers/bind_command_handler.rb +25 -28
  15. data/lib/command_handlers/combo_selection_data_binding_command_handler.rb +39 -0
  16. data/{src → lib}/command_handlers/data_binding_command_handler.rb +61 -64
  17. data/lib/command_handlers/list_selection_data_binding_command_handler.rb +42 -0
  18. data/lib/command_handlers/models/list_observer.rb +31 -0
  19. data/{src → lib}/command_handlers/models/model_observer.rb +28 -25
  20. data/{src → lib}/command_handlers/models/observable_array.rb +53 -46
  21. data/lib/command_handlers/models/observable_model.rb +61 -0
  22. data/{src → lib}/command_handlers/models/r_runnable.rb +11 -14
  23. data/{src → lib}/command_handlers/models/r_shell.rb +23 -26
  24. data/lib/command_handlers/models/r_tab_item_composite.rb +25 -0
  25. data/{src → lib}/command_handlers/models/r_widget.rb +16 -14
  26. data/lib/command_handlers/models/r_widget_listener.rb +9 -0
  27. data/{src → lib}/command_handlers/models/r_widget_packages.rb +5 -8
  28. data/{src → lib}/command_handlers/models/table_items_updater.rb +38 -39
  29. data/{src → lib}/command_handlers/models/widget_observer.rb +4 -6
  30. data/{src → lib}/command_handlers/shell_command_handler.rb +14 -17
  31. data/{src → lib}/command_handlers/swt_constant_command_handler.rb +18 -21
  32. data/lib/command_handlers/tab_item_command_handler.rb +22 -0
  33. data/{src → lib}/command_handlers/table_column_properties_data_binding_command_handler.rb +20 -23
  34. data/{src → lib}/command_handlers/table_items_data_binding_command_handler.rb +26 -29
  35. data/{src → lib}/command_handlers/widget_command_handler.rb +22 -25
  36. data/{src → lib}/command_handlers/widget_listener_command_handler.rb +36 -34
  37. data/{src → lib}/command_handlers/widget_method_command_handler.rb +18 -21
  38. data/{src → lib}/glimmer.rb +52 -45
  39. data/lib/parent.rb +5 -0
  40. data/{src → lib}/shine.rb +21 -24
  41. data/{src → lib}/xml_command_handlers.rb +15 -18
  42. data/{src → lib}/xml_command_handlers/html_command_handler.rb +45 -49
  43. data/{src → lib}/xml_command_handlers/models/depth_first_search_iterator.rb +17 -20
  44. data/{src → lib}/xml_command_handlers/models/name_space_visitor.rb +17 -20
  45. data/{src → lib}/xml_command_handlers/models/node.rb +80 -83
  46. data/{src → lib}/xml_command_handlers/models/node_visitor.rb +8 -11
  47. data/{src → lib}/xml_command_handlers/models/xml_visitor.rb +58 -61
  48. data/{src → lib}/xml_command_handlers/xml_command_handler.rb +18 -22
  49. data/{src → lib}/xml_command_handlers/xml_name_space_command_handler.rb +31 -34
  50. data/{src → lib}/xml_command_handlers/xml_tag_command_handler.rb +23 -26
  51. data/{src → lib}/xml_command_handlers/xml_text_command_handler.rb +19 -22
  52. data/samples/contactmanager/contact.rb +0 -3
  53. data/samples/contactmanager/contact_manager.rb +1 -4
  54. data/samples/contactmanager/contact_manager_presenter.rb +0 -3
  55. data/samples/contactmanager/contact_repository.rb +0 -3
  56. data/samples/hello_combo.rb +32 -0
  57. data/samples/hello_world.rb +1 -4
  58. data/samples/login.rb +1 -4
  59. data/samples/tictactoe/tic_tac_toe.rb +2 -5
  60. data/samples/tictactoe/tic_tac_toe_board.rb +0 -3
  61. data/test/glimmer_combo_data_binding_test.rb +131 -0
  62. data/test/glimmer_constant_test.rb +6 -11
  63. data/test/glimmer_data_binding_test.rb +16 -16
  64. data/test/glimmer_list_data_binding_test.rb +223 -0
  65. data/test/glimmer_listeners_test.rb +6 -6
  66. data/test/glimmer_shine_data_binding_test.rb +7 -6
  67. data/test/glimmer_tab_item_test.rb +61 -0
  68. data/test/glimmer_table_data_binding_test.rb +7 -20
  69. data/test/glimmer_test.rb +18 -13
  70. data/test/helper.rb +21 -0
  71. data/test/observable_model_test.rb +2 -4
  72. data/test/r_widget_test.rb +5 -5
  73. data/test/samples/contactmanager/contact_manager_presenter_test.rb +1 -4
  74. data/test/samples/tictactoe/tic_tac_toe_test.rb +1 -4
  75. data/test/xml/glimmer_xml_test.rb +43 -43
  76. metadata +210 -105
  77. data/COPYING.LGPL +0 -504
  78. data/README +0 -27
  79. data/src/command_handlers/models/observable_model.rb +0 -35
  80. data/src/command_handlers/models/r_widget_listener.rb +0 -12
  81. data/src/parent.rb +0 -8
  82. data/src/swt.rb +0 -10
  83. 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
@@ -1,12 +0,0 @@
1
- # Copyright (C) 2007-2008 Annas Al Maleh
2
- # Licensed under the LGPL. See /COPYING.LGPL for more details.
3
-
4
- class RWidgetListener
5
-
6
- attr_reader :listener
7
-
8
- def initialize(listener)
9
- @listener = listener
10
- end
11
-
12
- end
@@ -1,8 +0,0 @@
1
- # Copyright (C) 2007-2008 Annas Al Maleh
2
- # Licensed under the LGPL. See /COPYING.LGPL for more details.
3
-
4
- module Parent
5
- def process_block(block)
6
- raise "must be implemented by a class"
7
- end
8
- end
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
-