redcar 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. data/CHANGES +41 -1
  2. data/README.md +1 -1
  3. data/Rakefile +5 -6
  4. data/lib/plugin_manager/lib/plugin_manager.rb +1 -2
  5. data/lib/redcar.rb +19 -14
  6. data/lib/redcar/installer.rb +21 -17
  7. data/lib/redcar/runner.rb +10 -7
  8. data/lib/redcar/usage.rb +1 -0
  9. data/lib/redcar_quick_start.rb +8 -12
  10. data/lib/regex_replace.rb +3 -3
  11. data/plugins/application/features/step_definitions/menu_steps.rb +10 -0
  12. data/plugins/application/features/step_definitions/speedbar_steps.rb +8 -2
  13. data/plugins/application/features/step_definitions/tree_steps.rb +48 -6
  14. data/plugins/application/features/step_definitions/window_steps.rb +9 -4
  15. data/plugins/application/features/support/env.rb +20 -1
  16. data/plugins/application/features/support/fake_event.rb +14 -0
  17. data/plugins/application/lib/application.rb +29 -12
  18. data/plugins/application/lib/application/dialogs/filter_list_dialog.rb +19 -0
  19. data/plugins/application/lib/application/speedbar.rb +23 -17
  20. data/plugins/application/lib/application/tab.rb +20 -15
  21. data/plugins/application/lib/application/treebook.rb +10 -7
  22. data/plugins/application/lib/application/window.rb +1 -1
  23. data/plugins/application/plugin.rb +1 -1
  24. data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +4 -4
  25. data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +15 -4
  26. data/plugins/application_swt/lib/application_swt/icon.rb +3 -5
  27. data/plugins/application_swt/lib/application_swt/notebook/tab_drag_and_drop_listener.rb +4 -4
  28. data/plugins/application_swt/lib/application_swt/notebook/tab_transfer.rb +5 -5
  29. data/plugins/application_swt/lib/application_swt/speedbar.rb +34 -120
  30. data/plugins/application_swt/lib/application_swt/speedbar/button_item.rb +20 -0
  31. data/plugins/application_swt/lib/application_swt/speedbar/combo_item.rb +38 -0
  32. data/plugins/application_swt/lib/application_swt/speedbar/label_item.rb +15 -0
  33. data/plugins/application_swt/lib/application_swt/speedbar/slider_item.rb +32 -0
  34. data/plugins/application_swt/lib/application_swt/speedbar/text_box_item.rb +36 -0
  35. data/plugins/application_swt/lib/application_swt/speedbar/toggle_item.rb +29 -0
  36. data/plugins/application_swt/lib/application_swt/tab.rb +1 -3
  37. data/plugins/application_swt/lib/application_swt/toolbar.rb +19 -20
  38. data/plugins/application_swt/lib/application_swt/treebook.rb +24 -9
  39. data/plugins/application_swt/lib/application_swt/window.rb +110 -98
  40. data/plugins/application_swt/lib/swt/vtab_folder.rb +77 -32
  41. data/plugins/application_swt/lib/swt/vtab_item.rb +9 -0
  42. data/plugins/application_swt/lib/swt/vtab_label.rb +63 -23
  43. data/plugins/application_swt/plugin.rb +1 -1
  44. data/plugins/clipboard-viewer/lib/clipboard_viewer/clipboard_bar.rb +2 -2
  45. data/plugins/comment/features/line_comment.feature +116 -4
  46. data/plugins/comment/lib/comment.rb +18 -16
  47. data/plugins/connection_manager/lib/connection_manager/commands.rb +1 -1
  48. data/plugins/connection_manager/lib/connection_manager/private_key_store.rb +5 -3
  49. data/plugins/declarations/lib/declarations.rb +1 -1
  50. data/plugins/declarations/lib/declarations/parser.rb +68 -20
  51. data/plugins/document_search/features/replace.feature +18 -0
  52. data/plugins/document_search/lib/document_search.rb +37 -54
  53. data/plugins/document_search/lib/document_search/replace_all_command.rb +27 -0
  54. data/plugins/document_search/lib/document_search/replace_command.rb +38 -0
  55. data/plugins/document_search/lib/document_search/replace_next_command.rb +27 -0
  56. data/plugins/document_search/lib/document_search/search_and_replace.rb +17 -24
  57. data/plugins/edit_view/features/step_definitions/editing_steps.rb +4 -4
  58. data/plugins/edit_view/features/step_definitions/tab_steps.rb +9 -0
  59. data/plugins/edit_view/features/step_definitions/window_steps.rb +0 -12
  60. data/plugins/edit_view/lib/edit_view/document.rb +2 -0
  61. data/plugins/edit_view/lib/edit_view/document/command.rb +8 -8
  62. data/plugins/edit_view/lib/edit_view/edit_tab.rb +21 -7
  63. data/plugins/edit_view/lib/edit_view/select_font_dialog.rb +6 -0
  64. data/plugins/edit_view/lib/edit_view/select_theme_dialog.rb +6 -0
  65. data/plugins/edit_view_swt/lib/edit_view_swt.rb +92 -43
  66. data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +17 -4
  67. data/plugins/find-in-project/lib/find_in_project.rb +1 -4
  68. data/plugins/find-in-project/lib/find_in_project/commands.rb +0 -14
  69. data/plugins/find-in-project/lib/find_in_project/controllers.rb +12 -0
  70. data/plugins/find-in-project/lib/find_in_project/views/index.html.erb +5 -0
  71. data/plugins/groovy/features/fixtures/test.groovy +0 -0
  72. data/plugins/groovy/features/step_definitions/groovy_steps.rb +27 -0
  73. data/plugins/groovy/features/support/env.rb +27 -0
  74. data/plugins/groovy/features/syntax_check_groovy.feature +72 -0
  75. data/plugins/groovy/lib/syntax_check/groovy.rb +76 -0
  76. data/plugins/groovy/plugin.rb +7 -0
  77. data/plugins/help/lib/help.rb +28 -4
  78. data/plugins/help/lib/help/help_tab.rb +11 -0
  79. data/plugins/help/lib/help/view_controller.rb +25 -0
  80. data/plugins/help/plugin.rb +2 -1
  81. data/plugins/{view_shortcuts → help}/views/default.css +0 -0
  82. data/plugins/{view_shortcuts → help}/views/index.html.erb +1 -1
  83. data/plugins/{view_shortcuts → help}/views/redcar_small_icon.png +0 -0
  84. data/plugins/html_view/features/browser_bar.feature +47 -0
  85. data/plugins/html_view/features/fixtures/other.html +1 -0
  86. data/plugins/html_view/features/fixtures/sample.html +1 -0
  87. data/plugins/html_view/features/step_definitions/html_view_steps.rb +45 -5
  88. data/plugins/html_view/features/support/env.rb +26 -0
  89. data/plugins/html_view/features/web_preview.feature +21 -0
  90. data/plugins/html_view/lib/html_controller.rb +5 -5
  91. data/plugins/html_view/lib/html_view.rb +62 -10
  92. data/plugins/{web_bookmarks/lib/web_bookmarks → html_view/lib/html_view}/browser_bar.rb +32 -20
  93. data/plugins/html_view/lib/html_view/commands.rb +64 -0
  94. data/plugins/{web_bookmarks/lib/web_bookmarks/view_controller.rb → html_view/lib/html_view/default_controller.rb} +7 -6
  95. data/plugins/html_view/lib/html_view/html_tab.rb +17 -6
  96. data/plugins/html_view/plugin.rb +3 -3
  97. data/plugins/{web_bookmarks → html_view}/views/index.html.erb +0 -0
  98. data/plugins/javascript/features/fixtures/test.js +0 -0
  99. data/plugins/javascript/features/support/env.rb +4 -0
  100. data/plugins/javascript/features/syntax_check_javascript.feature +27 -0
  101. data/plugins/javascript/lib/syntax_check/javascript.rb +52 -0
  102. data/plugins/javascript/plugin.rb +7 -0
  103. data/plugins/javascript/vendor/jslint.js +539 -0
  104. data/plugins/macros/lib/macros/commands.rb +3 -3
  105. data/plugins/open_default_app/lib/open_default_app.rb +29 -3
  106. data/plugins/open_default_app/plugin.rb +1 -1
  107. data/plugins/outline_view/features/outline_view.feature +79 -0
  108. data/plugins/outline_view/features/step_definitions/outline_steps.rb +45 -0
  109. data/plugins/outline_view/lib/outline_view.rb +1 -1
  110. data/plugins/outline_view/spec/fixtures/some_project/javascript.js +10 -0
  111. data/plugins/outline_view/spec/fixtures/some_project/nothing_to_see.rb +0 -0
  112. data/plugins/outline_view/spec/fixtures/some_project/one_lonely_class.rb +2 -0
  113. data/plugins/outline_view/spec/fixtures/some_project/similar_names.rb +18 -0
  114. data/plugins/outline_view/spec/fixtures/some_project/something_fancy.rb +736 -0
  115. data/plugins/outline_view/spec/fixtures/some_project/trailing_space.rb +5 -0
  116. data/plugins/outline_view_swt/lib/outline_view_swt.rb +17 -19
  117. data/plugins/pair_highlighter/lib/pair_highlighter/document_controller.rb +1 -4
  118. data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +12 -3
  119. data/plugins/project/features/close_directory_tree.feature +27 -0
  120. data/plugins/project/features/highlight_focussed_tab.feature +45 -1
  121. data/plugins/project/features/open_and_save_files.feature +33 -0
  122. data/plugins/project/features/open_directory_tree.feature +37 -11
  123. data/plugins/project/features/step_definitions/directory_steps.rb +1 -1
  124. data/plugins/project/features/step_definitions/drb_steps.rb +40 -0
  125. data/plugins/project/features/support/env.rb +17 -0
  126. data/plugins/project/lib/project.rb +12 -2
  127. data/plugins/project/lib/project/commands.rb +101 -99
  128. data/plugins/project/lib/project/drb_service.rb +55 -65
  129. data/plugins/project/lib/project/manager.rb +29 -4
  130. data/plugins/project/lib/project/project_tree_controller.rb +24 -0
  131. data/plugins/project/lib/project/support/trash.rb +1 -0
  132. data/plugins/redcar/redcar.rb +100 -37
  133. data/plugins/redcar_debug/lib/redcar_debug.rb +3 -3
  134. data/plugins/repl/features/step_definitions/repl_steps.rb +3 -0
  135. data/plugins/repl/lib/repl.rb +4 -11
  136. data/plugins/repl/lib/repl/repl_tab.rb +26 -0
  137. data/plugins/ruby/features/fixtures/test.rb +0 -0
  138. data/plugins/ruby/features/support/env.rb +4 -0
  139. data/plugins/ruby/features/syntax_check_ruby.feature +25 -0
  140. data/plugins/runnables/features/command_tree.feature +28 -0
  141. data/plugins/runnables/lib/runnables.rb +1 -0
  142. data/plugins/runnables/lib/runnables/commands.rb +4 -4
  143. data/plugins/runnables/lib/runnables/output_processor.rb +5 -5
  144. data/plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb +2 -7
  145. data/plugins/runnables/lib/runnables/tree_mirror/tree_mirror.rb +13 -8
  146. data/plugins/scm_git/lib/scm_git/change.rb +5 -5
  147. data/plugins/strip_trailing_spaces/features/fixtures/test.txt +3 -0
  148. data/plugins/strip_trailing_spaces/features/strip_trailing_spaces.feature +34 -0
  149. data/plugins/strip_trailing_spaces/lib/strip_trailing_spaces.rb +3 -38
  150. data/plugins/swt/lib/swt.rb +5 -13
  151. data/plugins/swt/lib/swt/full_swt.rb +15 -13
  152. data/plugins/syntax_check/features/step_definitions/syntax_check_steps.rb +7 -0
  153. data/plugins/syntax_check/lib/syntax_check.rb +21 -3
  154. data/plugins/syntax_check/lib/syntax_check/error.rb +4 -3
  155. data/plugins/task_manager/lib/task_manager.rb +1 -1
  156. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Preferences/Autocompletions.tmPreferences +345 -0
  157. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Preferences/Symbol List Target.tmPreferences +22 -0
  158. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Snippets/Doc Banner.tmSnippet +20 -0
  159. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Syntaxes/Ant.tmLanguage +247 -0
  160. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/info.plist +55 -0
  161. data/plugins/textmate/vendor/redcar-bundles/Bundles/RedcarRepl.tmbundle/Syntaxes/GroovyRepl.plist +40 -0
  162. data/plugins/textmate/vendor/redcar-bundles/Bundles/RedcarRepl.tmbundle/info.plist +1 -1
  163. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby Haml.tmbundle/Syntaxes/Ruby_Haml.tmLanguage +0 -1
  164. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby Sass.tmbundle/Syntaxes/Ruby Sass.tmLanguage +626 -0
  165. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby Sass.tmbundle/info.plist +16 -0
  166. data/plugins/todo_list/features/support/env.rb +8 -0
  167. data/plugins/todo_list/features/todo_list.feature +26 -0
  168. data/plugins/todo_list/lib/todo_list.rb +1 -0
  169. data/plugins/todo_list/lib/todo_list/file_parser.rb +23 -19
  170. data/plugins/todo_list/lib/todo_list/todo_controller.rb +60 -100
  171. data/plugins/todo_list/spec/fixtures/project/FIXME.file +3 -0
  172. data/plugins/todo_list/spec/fixtures/project/NOTE.ignored.file +1 -0
  173. data/plugins/todo_list/spec/fixtures/project/OPTIMIZE_colon.file +1 -0
  174. data/plugins/todo_list/spec/fixtures/project/XXX.ignored +1 -0
  175. data/plugins/todo_list/spec/fixtures/project/ignored_directory/TODO.file +2 -0
  176. data/plugins/todo_list/spec/fixtures/settings.rb +11 -0
  177. data/plugins/todo_list/spec/spec_helper.rb +6 -0
  178. data/plugins/todo_list/spec/todo_list/file_parser_spec.rb +35 -0
  179. data/plugins/tree/lib/tree.rb +1 -0
  180. data/plugins/tree/lib/tree/command.rb +5 -0
  181. data/plugins/web_bookmarks/features/bookmark.feature +37 -0
  182. data/plugins/web_bookmarks/features/fixtures/other.html +1 -0
  183. data/plugins/web_bookmarks/features/fixtures/sample.html +1 -0
  184. data/plugins/web_bookmarks/features/step_definitions/web_steps.rb +4 -0
  185. data/plugins/web_bookmarks/features/support/env.rb +26 -0
  186. data/plugins/web_bookmarks/lib/web_bookmarks.rb +0 -10
  187. data/plugins/web_bookmarks/lib/web_bookmarks/bookmark.rb +10 -1
  188. data/plugins/web_bookmarks/lib/web_bookmarks/commands.rb +1 -47
  189. data/plugins/web_bookmarks/lib/web_bookmarks/tree.rb +21 -14
  190. data/{plugins/application → share}/icons/close.png +0 -0
  191. data/{plugins/application → share}/icons/darwin-file.png +0 -0
  192. data/{plugins/application → share}/icons/darwin-folder.png +0 -0
  193. data/share/icons/open-source-flipped.png +0 -0
  194. data/{plugins/application/icons/redcar_icon_beta_dev.png → share/icons/redcar-icon-beta-dev.png} +0 -0
  195. data/{plugins/application/icons/redcar_icon_beta.png → share/icons/redcar-icon-beta.png} +0 -0
  196. data/{plugins/application → share}/icons/redcar-splash.png +0 -0
  197. metadata +90 -30
  198. data/lib/redcar/jvm_options_probe.rb +0 -33
  199. data/plugins/document_search/lib/document_search/replace.rb +0 -113
  200. data/plugins/document_search/lib/document_search/search.rb +0 -45
  201. data/plugins/outline_view_swt/lib/icons/alias.png +0 -0
  202. data/plugins/outline_view_swt/lib/icons/assignment.png +0 -0
  203. data/plugins/outline_view_swt/lib/icons/attribute.png +0 -0
  204. data/plugins/outline_view_swt/lib/icons/class.png +0 -0
  205. data/plugins/outline_view_swt/lib/icons/interface.png +0 -0
  206. data/plugins/outline_view_swt/lib/icons/method.png +0 -0
  207. data/plugins/strip_trailing_spaces/CHANGELOG +0 -12
  208. data/plugins/strip_trailing_spaces/README.md +0 -32
  209. data/plugins/view_shortcuts/lib/view_shortcuts.rb +0 -52
  210. data/plugins/view_shortcuts/plugin.rb +0 -11
@@ -48,11 +48,11 @@ module Redcar
48
48
  close_ansi_spans(:clear)
49
49
  else
50
50
  style = ""
51
- style += "ansi-regular " if match[2] == "0"
52
- style += "ansi-bold " if match[2] == "1"
53
- style += "ansi-light " if match[4] == "9"
54
- style += "ansi-on-#{color(match[5])} " if match[4] == "4"
55
- style += "ansi-#{color(match[5])}" if match[4] == "3" || match[4] == "9"
51
+ style << "ansi-regular " if match[2] == "0"
52
+ style << "ansi-bold " if match[2] == "1"
53
+ style << "ansi-light " if match[4] == "9"
54
+ style << "ansi-on-#{color(match[5])} " if match[4] == "4"
55
+ style << "ansi-#{color(match[5])}" if match[4] == "3" || match[4] == "9"
56
56
  @ansi_stack << style unless style.empty?
57
57
  ansi_span(style)
58
58
  end
@@ -1,11 +1,6 @@
1
1
  module Redcar
2
2
  class Runnables
3
- class TreeController
4
- include Redcar::Tree::Controller
5
-
6
- def initialize(project)
7
- @project = project
8
- end
3
+ class TreeController < Redcar::Project::ProjectTreeController
9
4
 
10
5
  def right_click(tree, node)
11
6
  controller = self
@@ -31,7 +26,7 @@ module Redcar
31
26
  Runnables.run_process(@project.home_dir, node.command, node.text, node.output)
32
27
  when HelpItem
33
28
  tab = Redcar.app.focussed_window.new_tab(HtmlTab)
34
- tab.go_to_location("http://wiki.github.com/danlucraft/redcar/users-guide-runnables")
29
+ tab.go_to_location("http://github.com/redcar/redcar/wiki/Users-Guide---Runnables")
35
30
  tab.title = "Runnables Help"
36
31
  tab.focus
37
32
  end
@@ -30,14 +30,19 @@ module Redcar
30
30
  end
31
31
 
32
32
  def load
33
- groups = {}
34
- runnable_file_paths.each do |path|
35
- runnables = []
36
- name = File.basename(path,".json")
37
- json = File.read(path)
38
- this_runnables = JSON(json)["commands"]
39
- runnables += this_runnables || []
40
- groups[name.to_s] = runnables.to_a
33
+ begin
34
+ groups = {}
35
+ runnable_file_paths.each do |path|
36
+ runnables = []
37
+ name = File.basename(path,".json")
38
+ json = File.read(path)
39
+ this_runnables = JSON(json)["commands"]
40
+ runnables += this_runnables || []
41
+ groups[name.to_s] = runnables.to_a
42
+ end
43
+ rescue Object => e
44
+ Redcar::Application::Dialog.message_box("There was an error parsing Runnables: #{e.message}")
45
+ groups = {}
41
46
  end
42
47
 
43
48
  if groups.any?
@@ -85,15 +85,15 @@ module Redcar
85
85
  icon = (@type == :file ? "notebook" : "folder")
86
86
  case
87
87
  when ((@file.type_raw == "??") or (@file.type_raw[0,1] == "A" and @indexed))
88
- icon += "--plus"
88
+ icon << "--plus"
89
89
  when ((@file.type_raw[0,1] == "M" and @indexed) or (@file.type_raw[1,1] == "M" and (not @indexed)))
90
- icon += "--pencil"
90
+ icon << "--pencil"
91
91
  when (['C', 'R'].include?(@file.type_raw[0,1]) and @indexed)
92
- icon += "--arrow"
92
+ icon << "--arrow"
93
93
  when ((@file.type_raw[0,1] == "D" and @indexed) or (@file.type_raw[1,1] == "D" and (not @indexed)))
94
- icon += "--minus"
94
+ icon << "--minus"
95
95
  when (@file.type_raw[0,1] == "U" and (not @indexed))
96
- icon += "--exclamation"
96
+ icon << "--exclamation"
97
97
  else
98
98
  icon = (@type == :file ? :file : :directory)
99
99
  end
@@ -0,0 +1,34 @@
1
+ Feature: Strip Trailing Spaces
2
+ As a user
3
+ I sometimes want my editor to split trailing spaces on save
4
+
5
+ Background:
6
+ Given I will choose "plugins/strip_trailing_spaces/features/fixtures/test.txt" from the "open_file" dialog
7
+ And I open a file
8
+ And I replace the contents with "Hi \n \n Foo \n"
9
+
10
+ Scenario: Strip spaces on save
11
+ When I click "Enabled" from the "Plugins/Strip Trailing Spaces" menu
12
+ When I click "Strip Blank Lines" from the "Plugins/Strip Trailing Spaces" menu
13
+ And I save the tab
14
+ Then I should see "Hi\n\n Foo\n" in the edit tab
15
+
16
+ Scenario: Keep cursor position on save
17
+ When I move the cursor to 8
18
+ And I save the tab
19
+ Then the contents should be "Hi\n\n F<c>oo\n"
20
+
21
+ Scenario: Keep closest cursor position on save
22
+ When I move the cursor to 5
23
+ And I save the tab
24
+ Then the contents should be "Hi\n<c>\n Foo\n"
25
+
26
+ Scenario: Strip spaces, but not newlines on save
27
+ When I click "Strip Blank Lines" from the "Plugins/Strip Trailing Spaces" menu
28
+ And I save the tab
29
+ Then I should see "Hi\n \n Foo\n" in the edit tab
30
+
31
+ Scenario: Strip nothing on save
32
+ When I click "Enabled" from the "Plugins/Strip Trailing Spaces" menu
33
+ And I save the tab
34
+ Then I should see "Hi \n \n Foo \n" in the edit tab
@@ -39,44 +39,9 @@ module Redcar
39
39
 
40
40
  def self.before_save(doc)
41
41
  if (doc.mirror.is_a?(Redcar::Project::FileMirror) && StripTrailingSpaces.enabled?)
42
- cursor = CursorHandler.new(doc)
43
-
44
- doc.controllers(Redcar::AutoPairer::DocumentController).first.ignore do
45
- doc.controllers(Redcar::AutoIndenter::DocumentController).first.ignore do
46
- doc.compound do
47
- doc.line_count.times do |l|
48
- doc.replace_line(l) do |line_text|
49
- stripped = line_text.rstrip
50
- (stripped.length > 0 || StripTrailingSpaces.strip_blank_lines?) ? stripped : line_text
51
- end
52
- end
53
- end
54
- end
55
- end
56
-
57
- cursor.adjust
58
- end
59
- end
60
-
61
- class CursorHandler
62
- ##
63
- # Read cursor position and adjust line offset
64
- def initialize(doc)
65
- @doc = doc
66
- @cursor_line = @doc.cursor_line
67
- @top_line = @doc.smallest_visible_line
68
- @line_offset = @doc.cursor_line_offset
69
- line = @doc.get_line(@cursor_line)
70
- @line_offset = line.rstrip.size if @line_offset > line.rstrip.size
71
- end
72
-
73
- ##
74
- # Adjust cursor offset and make visible
75
- def adjust
76
- @doc.scroll_to_line_at_top(@top_line)
77
- offset=@doc.offset_at_line(@cursor_line) + @line_offset
78
- @doc.cursor_offset=offset
79
- @doc.ensure_visible(offset)
42
+ regex = /[\t ]*$/ if StripTrailingSpaces.strip_blank_lines?
43
+ regex ||= /([^\s]+)[\t ]+$/
44
+ doc.text = doc.get_all_text.gsub(regex, "\\1")
80
45
  end
81
46
  end
82
47
 
@@ -10,18 +10,10 @@ module Swt
10
10
 
11
11
  def self.jar_path
12
12
  case Config::CONFIG["host_os"]
13
- when /darwin/i
14
- if Config::CONFIG["host_cpu"] == "x86_64"
15
- 'osx64'
16
- else
17
- 'osx'
18
- end
19
- when /linux/i
20
- if %w(amd64 x84_64).include? Config::CONFIG["host_cpu"]
21
- 'linux64'
22
- else
23
- 'linux'
24
- end
13
+ when /(darwin|linux)/i
14
+ jar = ($1 == "linux" ? "linux" : "osx")
15
+ jar << '64' if %w(amd64 x86_64).include? Config::CONFIG["host_cpu"]
16
+ jar
25
17
  when /windows|mswin/i
26
18
  'win32'
27
19
  end
@@ -47,7 +39,7 @@ module Swt
47
39
  end
48
40
 
49
41
  def show
50
- @image = Swt::Graphics::Image.new(Swt.display, File.dirname(__FILE__) + "/../../application/icons/redcar-splash.png")
42
+ @image = Swt::Graphics::Image.new(Swt.display, Redcar::ICONS_DIRECTORY + "/redcar-splash.png")
51
43
  @splash = Swt::Widgets::Shell.new(Swt::SWT::NONE)
52
44
  @bar = Swt::Widgets::ProgressBar.new(@splash, Swt::SWT::NONE)
53
45
  @bar.setMaximum(max)
@@ -19,6 +19,7 @@ module Swt
19
19
  import org.eclipse.swt.widgets.CoolBar
20
20
  import org.eclipse.swt.widgets.CoolItem
21
21
  import org.eclipse.swt.widgets.Sash
22
+ import org.eclipse.swt.widgets.Slider
22
23
  import org.eclipse.swt.widgets.TabFolder
23
24
  import org.eclipse.swt.widgets.TabItem
24
25
  import org.eclipse.swt.widgets.Text
@@ -26,7 +27,7 @@ module Swt
26
27
  import org.eclipse.swt.widgets.Table
27
28
  import org.eclipse.swt.widgets.TableItem
28
29
  end
29
-
30
+
30
31
  module Custom
31
32
  import org.eclipse.swt.custom.CTabFolder
32
33
  import org.eclipse.swt.custom.CTabItem
@@ -36,10 +37,10 @@ module Swt
36
37
  import org.eclipse.swt.custom.StyledText
37
38
  import org.eclipse.swt.custom.TreeEditor
38
39
  end
39
-
40
+
40
41
  module DND
41
42
  import org.eclipse.swt.dnd.DND
42
-
43
+
43
44
  # Only load Clipboard in full running mode.
44
45
  import org.eclipse.swt.dnd.Clipboard unless Redcar.no_gui_mode?
45
46
 
@@ -47,16 +48,16 @@ module Swt
47
48
  import org.eclipse.swt.dnd.TextTransfer
48
49
  import org.eclipse.swt.dnd.FileTransfer
49
50
  import org.eclipse.swt.dnd.ByteArrayTransfer
50
-
51
+
51
52
  import org.eclipse.swt.dnd.DropTarget
52
53
  import org.eclipse.swt.dnd.DropTargetEvent
53
54
  import org.eclipse.swt.dnd.DropTargetListener
54
-
55
+
55
56
  import org.eclipse.swt.dnd.DragSource
56
57
  import org.eclipse.swt.dnd.DragSourceEvent
57
58
  import org.eclipse.swt.dnd.DragSourceListener
58
59
  end
59
-
60
+
60
61
  module Layout
61
62
  import org.eclipse.swt.layout.FillLayout
62
63
  import org.eclipse.swt.layout.GridLayout
@@ -64,7 +65,7 @@ module Swt
64
65
  import org.eclipse.swt.layout.RowLayout
65
66
  import org.eclipse.swt.layout.RowData
66
67
  end
67
-
68
+
68
69
  module Graphics
69
70
  import org.eclipse.swt.graphics.Color
70
71
  import org.eclipse.swt.graphics.Device
@@ -73,17 +74,18 @@ module Swt
73
74
  import org.eclipse.swt.graphics.Point
74
75
  import org.eclipse.swt.graphics.RGB
75
76
  end
76
-
77
+
77
78
  module Events
78
79
  import org.eclipse.swt.events.KeyEvent
79
80
  import org.eclipse.swt.events.MouseListener
81
+ import org.eclipse.swt.events.MouseTrackListener
80
82
  end
81
-
83
+
82
84
  import org.eclipse.swt.browser.Browser
83
85
  class Browser
84
86
  import org.eclipse.swt.browser.BrowserFunction
85
87
  end
86
-
88
+
87
89
  class RRunnable
88
90
  include java.lang.Runnable
89
91
 
@@ -101,7 +103,7 @@ module JFace
101
103
  Dir[Redcar.asset_dir + "/jface/*.jar"].each do |jar_fn|
102
104
  require jar_fn
103
105
  end
104
-
106
+
105
107
  module Viewers
106
108
  import org.eclipse.jface.viewers.ColumnViewerToolTipSupport
107
109
  import org.eclipse.jface.viewers.TreeViewer
@@ -112,11 +114,11 @@ module JFace
112
114
  import org.eclipse.jface.viewers.TextCellEditor
113
115
  import org.eclipse.jface.viewers.ViewerDropAdapter
114
116
  end
115
-
117
+
116
118
  module Text
117
119
  import org.eclipse.jface.text.TextViewerUndoManager
118
120
  end
119
-
121
+
120
122
  module Dialogs
121
123
  import org.eclipse.jface.dialogs.Dialog
122
124
  import org.eclipse.jface.dialogs.InputDialog
@@ -0,0 +1,7 @@
1
+ Given /^I have (not )?suppressed syntax checking message dialogs$/ do |negate|
2
+ if negate
3
+ Redcar::SyntaxCheck.storage['supress_message_dialogs'] = true
4
+ else
5
+ Redcar::SyntaxCheck.storage['supress_message_dialogs'] = false
6
+ end
7
+ end
@@ -7,10 +7,28 @@ module Redcar
7
7
  edit_view.remove_all_annotations :type => Error::Type
8
8
  end
9
9
 
10
+ def self.storage
11
+ @storage ||= begin
12
+ storage = Plugin::Storage.new('syntax_checking')
13
+ storage.set_default('suppress_message_dialogs',false)
14
+ storage.set_default('suppress_syntax_checking',false)
15
+ storage
16
+ end
17
+ end
18
+
19
+ def self.message(message,type)
20
+ unless SyntaxCheck.storage['suppress_message_dialogs']
21
+ Redcar::Application::Dialog.message_box(
22
+ message,{:type => type})
23
+ end
24
+ end
25
+
10
26
  def self.after_save(doc)
11
- remove_syntax_error_annotations(doc.edit_view)
12
- checker = Checker[doc.edit_view.grammar]
13
- checker.new(doc).check if checker
27
+ unless SyntaxCheck.storage['suppress_syntax_checking']
28
+ remove_syntax_error_annotations(doc.edit_view)
29
+ checker = Checker[doc.edit_view.grammar]
30
+ checker.new(doc).check if checker
31
+ end
14
32
  end
15
33
  end
16
34
  end
@@ -5,18 +5,19 @@ module Redcar
5
5
  Icon = "compile-error"
6
6
  Color = [255, 32, 32]
7
7
 
8
- attr_accessor :line, :message, :doc
8
+ attr_accessor :line, :char, :message, :doc
9
9
 
10
- def initialize(doc, line, message)
10
+ def initialize(doc, line, message, char=0)
11
11
  @doc = doc
12
12
  @line = line
13
13
  @message = message
14
+ @char = char
14
15
  end
15
16
 
16
17
  def annotate
17
18
  edit_view = doc.edit_view
18
19
  edit_view.add_annotation_type(Type, Icon, Color)
19
- edit_view.add_annotation(Type, line, message, 0, doc.get_line(line).length)
20
+ edit_view.add_annotation(Type, line, message, @char, doc.get_line(line).length)
20
21
  end
21
22
  end
22
23
  end
@@ -8,7 +8,7 @@ module Redcar
8
8
 
9
9
  def execute
10
10
  controller = Controller.new
11
- tab = win.new_tab(HtmlTab)
11
+ tab = win.new_tab(ConfigTab)
12
12
  tab.html_view.controller = controller
13
13
  tab.focus
14
14
  end
@@ -0,0 +1,345 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>name</key>
6
+ <string>Completions</string>
7
+ <key>scope</key>
8
+ <string>text.xml.ant</string>
9
+ <key>settings</key>
10
+ <dict>
11
+ <key>completions</key>
12
+ <array>
13
+ <string>add</string>
14
+ <string>ant</string>
15
+ <string>antcall</string>
16
+ <string>antfile</string>
17
+ <string>antlr</string>
18
+ <string>antstructure</string>
19
+ <string>append</string>
20
+ <string>apply</string>
21
+ <string>apt</string>
22
+ <string>arg</string>
23
+ <string>args</string>
24
+ <string>attrib</string>
25
+ <string>author</string>
26
+ <string>available</string>
27
+ <string>base</string>
28
+ <string>basedir</string>
29
+ <string>basename</string>
30
+ <string>bootclasspath</string>
31
+ <string>bootclasspathref</string>
32
+ <string>bottom</string>
33
+ <string>buildnumber</string>
34
+ <string>cab</string>
35
+ <string>casesensitive</string>
36
+ <string>catalogpath</string>
37
+ <string>changelog</string>
38
+ <string>charset</string>
39
+ <string>checksum</string>
40
+ <string>chgrp</string>
41
+ <string>chmod</string>
42
+ <string>chown</string>
43
+ <string>classname</string>
44
+ <string>classpath</string>
45
+ <string>classpathref</string>
46
+ <string>command</string>
47
+ <string>common</string>
48
+ <string>compiler</string>
49
+ <string>compress</string>
50
+ <string>concat</string>
51
+ <string>condition</string>
52
+ <string>conditions</string>
53
+ <string>copy</string>
54
+ <string>copydir</string>
55
+ <string>copyfile</string>
56
+ <string>cr</string>
57
+ <string>cvs</string>
58
+ <string>cvspass</string>
59
+ <string>cvsRoot</string>
60
+ <string>cvstagdiff</string>
61
+ <string>cvsversion</string>
62
+ <string>debug</string>
63
+ <string>debuglevel</string>
64
+ <string>default</string>
65
+ <string>defaultexcludes</string>
66
+ <string>delete</string>
67
+ <string>deleteonexit</string>
68
+ <string>deltree</string>
69
+ <string>depend</string>
70
+ <string>depends</string>
71
+ <string>dependset</string>
72
+ <string>deprecation</string>
73
+ <string>description</string>
74
+ <string>dest</string>
75
+ <string>destDir</string>
76
+ <string>destdir</string>
77
+ <string>destfile</string>
78
+ <string>diagnostics</string>
79
+ <string>dir</string>
80
+ <string>dirname</string>
81
+ <string>dirset</string>
82
+ <string>docencoding</string>
83
+ <string>doctitle</string>
84
+ <string>dtd</string>
85
+ <string>duplicate</string>
86
+ <string>ear</string>
87
+ <string>echo</string>
88
+ <string>echoproperties</string>
89
+ <string>echoxml</string>
90
+ <string>enamblemultiplemappings</string>
91
+ <string>encoding</string>
92
+ <string>entity</string>
93
+ <string>entry</string>
94
+ <string>eof</string>
95
+ <string>error</string>
96
+ <string>errorproperty</string>
97
+ <string>exclude</string>
98
+ <string>excludes</string>
99
+ <string>excludesfile</string>
100
+ <string>exec</string>
101
+ <string>executable</string>
102
+ <string>expand</string>
103
+ <string>ext</string>
104
+ <string>extdirs</string>
105
+ <string>extension</string>
106
+ <string>factory</string>
107
+ <string>fail</string>
108
+ <string>failonerror</string>
109
+ <string>file</string>
110
+ <string>filelist</string>
111
+ <string>filepath</string>
112
+ <string>fileset</string>
113
+ <string>filesonly</string>
114
+ <string>filter</string>
115
+ <string>filtering</string>
116
+ <string>filterset</string>
117
+ <string>fixcrlf</string>
118
+ <string>flatten</string>
119
+ <string>followsymlinks</string>
120
+ <string>footer</string>
121
+ <string>force</string>
122
+ <string>fork</string>
123
+ <string>format</string>
124
+ <string>ftp</string>
125
+ <string>genkey</string>
126
+ <string>get</string>
127
+ <string>globmapper</string>
128
+ <string>granularity</string>
129
+ <string>group</string>
130
+ <string>gunzip</string>
131
+ <string>gzip</string>
132
+ <string>header</string>
133
+ <string>helpfile</string>
134
+ <string>ID</string>
135
+ <string>id</string>
136
+ <string>if</string>
137
+ <string>ignore</string>
138
+ <string>ignoresystemclasses</string>
139
+ <string>image</string>
140
+ <string>implementation</string>
141
+ <string>import</string>
142
+ <string>in</string>
143
+ <string>include</string>
144
+ <string>includeAntRuntime</string>
145
+ <string>includeEmptyDirs</string>
146
+ <string>includeemptydirs</string>
147
+ <string>includeJavaRuntime</string>
148
+ <string>includes</string>
149
+ <string>includesfile</string>
150
+ <string>inheritAll</string>
151
+ <string>inheritRefs</string>
152
+ <string>input</string>
153
+ <string>inputstring</string>
154
+ <string>items</string>
155
+ <string>jar</string>
156
+ <string>jarfile</string>
157
+ <string>jarlib-available</string>
158
+ <string>jarlib-display</string>
159
+ <string>jarlib-manifest</string>
160
+ <string>jarlib-resolve</string>
161
+ <string>java</string>
162
+ <string>javac</string>
163
+ <string>javacc</string>
164
+ <string>javadoc</string>
165
+ <string>javadoc2</string>
166
+ <string>javah</string>
167
+ <string>jdepend</string>
168
+ <string>jjdoc</string>
169
+ <string>jjtree</string>
170
+ <string>jlink</string>
171
+ <string>jspc</string>
172
+ <string>junit</string>
173
+ <string>junitreport</string>
174
+ <string>jvm</string>
175
+ <string>jvmargs</string>
176
+ <string>keepcompression</string>
177
+ <string>keys</string>
178
+ <string>keysubst</string>
179
+ <string>length</string>
180
+ <string>link</string>
181
+ <string>linkoffline</string>
182
+ <string>listfiles</string>
183
+ <string>loadfile</string>
184
+ <string>loadproperties</string>
185
+ <string>loadresource</string>
186
+ <string>locale</string>
187
+ <string>location</string>
188
+ <string>logError</string>
189
+ <string>macrodef</string>
190
+ <string>mail</string>
191
+ <string>makeurl</string>
192
+ <string>manifest</string>
193
+ <string>manifestclasspath</string>
194
+ <string>maxmemory</string>
195
+ <string>memoryInitialSize</string>
196
+ <string>memoryMaximumSize</string>
197
+ <string>message</string>
198
+ <string>mimemail</string>
199
+ <string>mkdir</string>
200
+ <string>move</string>
201
+ <string>name</string>
202
+ <string>native2ascii</string>
203
+ <string>netrexxc</string>
204
+ <string>newenvironment</string>
205
+ <string>nice</string>
206
+ <string>nodedeprecated</string>
207
+ <string>nodedeprecatedlist</string>
208
+ <string>nohelp</string>
209
+ <string>noindex</string>
210
+ <string>nonavbar</string>
211
+ <string>notree</string>
212
+ <string>nowarn</string>
213
+ <string>offset</string>
214
+ <string>old</string>
215
+ <string>optimize</string>
216
+ <string>os</string>
217
+ <string>out</string>
218
+ <string>output</string>
219
+ <string>outputencoding</string>
220
+ <string>outputproperty</string>
221
+ <string>overview</string>
222
+ <string>overwrite</string>
223
+ <string>pack</string>
224
+ <string>package</string>
225
+ <string>packagenames</string>
226
+ <string>parallel</string>
227
+ <string>param</string>
228
+ <string>patch</string>
229
+ <string>path</string>
230
+ <string>pathconvert</string>
231
+ <string>pathelement</string>
232
+ <string>pathref</string>
233
+ <string>pattern</string>
234
+ <string>patternset</string>
235
+ <string>perm</string>
236
+ <string>prefix</string>
237
+ <string>preservelastmodified</string>
238
+ <string>presetdef</string>
239
+ <string>private</string>
240
+ <string>processor</string>
241
+ <string>project</string>
242
+ <string>property</string>
243
+ <string>propertyfile</string>
244
+ <string>protected</string>
245
+ <string>public</string>
246
+ <string>publicId</string>
247
+ <string>pvcs</string>
248
+ <string>pvcsproject</string>
249
+ <string>quiet</string>
250
+ <string>recorder</string>
251
+ <string>reference</string>
252
+ <string>refid</string>
253
+ <string>reloadstylesheet</string>
254
+ <string>remove</string>
255
+ <string>rename</string>
256
+ <string>renameext</string>
257
+ <string>replace</string>
258
+ <string>replaceregexp</string>
259
+ <string>resource</string>
260
+ <string>resourcecount</string>
261
+ <string>resultproperty</string>
262
+ <string>reverse</string>
263
+ <string>rexec</string>
264
+ <string>rmic</string>
265
+ <string>roundup</string>
266
+ <string>scale</string>
267
+ <string>scanincludeddirectories</string>
268
+ <string>schemavalidate</string>
269
+ <string>scp</string>
270
+ <string>script</string>
271
+ <string>scriptdef</string>
272
+ <string>sep</string>
273
+ <string>sequential</string>
274
+ <string>serialwarn</string>
275
+ <string>serverdeploy</string>
276
+ <string>setproxy</string>
277
+ <string>signjar</string>
278
+ <string>sleep</string>
279
+ <string>sound</string>
280
+ <string>source</string>
281
+ <string>sourcefiles</string>
282
+ <string>sourcepath</string>
283
+ <string>spawn</string>
284
+ <string>splash</string>
285
+ <string>splitindex</string>
286
+ <string>sql</string>
287
+ <string>src</string>
288
+ <string>srcdir</string>
289
+ <string>sshexec</string>
290
+ <string>style</string>
291
+ <string>stylebook</string>
292
+ <string>stylesheetfile</string>
293
+ <string>subant</string>
294
+ <string>symlink</string>
295
+ <string>sync</string>
296
+ <string>tab</string>
297
+ <string>tag</string>
298
+ <string>tar</string>
299
+ <string>tarfile</string>
300
+ <string>target</string>
301
+ <string>taskdef</string>
302
+ <string>telnet</string>
303
+ <string>tempdir</string>
304
+ <string>tempfile</string>
305
+ <string>timeout</string>
306
+ <string>timezone</string>
307
+ <string>todir</string>
308
+ <string>tofile</string>
309
+ <string>token</string>
310
+ <string>torefid</string>
311
+ <string>touch</string>
312
+ <string>translate</string>
313
+ <string>tstamp</string>
314
+ <string>type</string>
315
+ <string>typedef</string>
316
+ <string>unit</string>
317
+ <string>unless</string>
318
+ <string>unpack</string>
319
+ <string>untar</string>
320
+ <string>unzip</string>
321
+ <string>update</string>
322
+ <string>uptodate</string>
323
+ <string>use</string>
324
+ <string>value</string>
325
+ <string>verbose</string>
326
+ <string>version</string>
327
+ <string>waitfor</string>
328
+ <string>war</string>
329
+ <string>warfile</string>
330
+ <string>webxml</string>
331
+ <string>whichresource</string>
332
+ <string>windowtitle</string>
333
+ <string>wljspc</string>
334
+ <string>xmlcatalog</string>
335
+ <string>xmlproperty</string>
336
+ <string>xmlvalidate</string>
337
+ <string>xslt</string>
338
+ <string>zip</string>
339
+ <string>zipfile</string>
340
+ </array>
341
+ </dict>
342
+ <key>uuid</key>
343
+ <string>AE288C48-081B-4615-A8B6-03041B92652B</string>
344
+ </dict>
345
+ </plist>