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
@@ -0,0 +1,24 @@
1
+
2
+ module Redcar
3
+ class Project
4
+ class ProjectTreeController
5
+ include Redcar::Tree::Controller
6
+
7
+ def initialize(project,title)
8
+ @project = project
9
+ @title = title
10
+ attach_project_listener(@project.window)
11
+ end
12
+
13
+ def attach_project_listener(win)
14
+ win.treebook.add_listener(:tree_removed) do |tree|
15
+ if tree == @project.tree and r = win.treebook.trees.detect do |t|
16
+ t.tree_mirror.title == @title
17
+ end
18
+ r.close
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,5 +1,6 @@
1
1
  module Redcar
2
2
  class Project
3
+ # FIXME: XXX: This is outright ugly. See the note on Redcar::Project::OpenCommand
3
4
  module Trash
4
5
  WINDOWS_SUPPORT_JS = File.expand_path("../recycle.js", __FILE__)
5
6
 
@@ -164,6 +164,56 @@ module Redcar
164
164
  end
165
165
  end
166
166
 
167
+ class GenerateWindowsMenu < Command
168
+ def initialize(builder)
169
+ @builder = builder
170
+ end
171
+
172
+ def execute
173
+ window = Redcar.app.focussed_window
174
+ Redcar.app.windows.each do |win|
175
+ @builder.item(win.title, :type => :radio, :active => (win == window)) do
176
+ FocusWindowCommand.new(win).run
177
+ end
178
+ end
179
+ end
180
+ end
181
+
182
+ class GenerateTabsMenu < Command
183
+ def initialize(builder)
184
+ @builder = builder
185
+ end
186
+
187
+ def trim(title)
188
+ title = title[0,13]+'...' if title.length > 13
189
+ title
190
+ end
191
+
192
+ def execute
193
+ if win = Redcar.app.focussed_window and
194
+ book = win.focussed_notebook and book.tabs.any?
195
+ focussed_tab = book.focussed_tab
196
+ @builder.separator
197
+ @builder.item "Focussed Notebook", ShowTitle
198
+ book.tabs.each_with_index do |tab,i|
199
+ num = i + 1
200
+ if num < 10
201
+ @builder.item "Tab #{num}: #{trim(tab.title)}", :type => :radio, :active => (tab == focussed_tab), :command => Top.const_get("SelectTab#{num}Command")
202
+ else
203
+ @builder.item("Tab #{num}: #{trim(tab.title)}", :type => :radio, :active => (tab == focussed_tab)) {tab.focus}
204
+ end
205
+ end
206
+ if book = win.nonfocussed_notebook and book.tabs.any?
207
+ @builder.separator
208
+ @builder.item "Nonfocussed Notebook", ShowTitle
209
+ book.tabs.each_with_index do |tab,i|
210
+ @builder.item("Tab #{i+1}: #{trim(tab.title)}") {tab.focus}
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end
216
+
167
217
  class FocusWindowCommand < Command
168
218
  def initialize(window=nil)
169
219
  @window = window
@@ -219,24 +269,18 @@ module Redcar
219
269
  end
220
270
  end
221
271
 
222
- class CloseTreeCommand < Command
272
+ class CloseTreeCommand < TreeCommand
223
273
  def execute
224
274
  win = Redcar.app.focussed_window
225
275
  if win and treebook = win.treebook
226
276
  if tree = treebook.focussed_tree
227
- if tree.tree_mirror.is_a?(Project::DirMirror)
228
- Redcar::Application::Dialog.message_box(
229
- "Use the \"Close Directory\" command to close this project"
230
- )
231
- else
232
- treebook.remove_tree(tree)
233
- end
277
+ treebook.remove_tree(tree)
234
278
  end
235
279
  end
236
280
  end
237
281
  end
238
282
 
239
- class ToggleTreesCommand < Command
283
+ class ToggleTreesCommand < TreeCommand
240
284
  def execute
241
285
  win = Redcar.app.focussed_window
242
286
  if win and treebook = win.treebook
@@ -280,7 +324,7 @@ Redcar.environment: #{Redcar.environment}
280
324
  end
281
325
  end
282
326
 
283
- class PrintScopeCommand < Command
327
+ class PrintScopeCommand < DocumentCommand
284
328
  def execute
285
329
  Application::Dialog.tool_tip(tab.edit_view.document.cursor_scope.gsub(" ", "\n"), :cursor)
286
330
  end
@@ -347,28 +391,28 @@ Redcar.environment: #{Redcar.environment}
347
391
  end
348
392
  end
349
393
 
350
- class SwitchTabDownCommand < Command
394
+ class SwitchTabDownCommand < TabCommand
351
395
 
352
396
  def execute
353
397
  win.focussed_notebook.switch_down
354
398
  end
355
399
  end
356
400
 
357
- class SwitchTabUpCommand < Command
401
+ class SwitchTabUpCommand < TabCommand
358
402
 
359
403
  def execute
360
404
  win.focussed_notebook.switch_up
361
405
  end
362
406
  end
363
407
 
364
- class MoveTabUpCommand < Command
408
+ class MoveTabUpCommand < TabCommand
365
409
 
366
410
  def execute
367
411
  win.focussed_notebook.move_up
368
412
  end
369
413
  end
370
414
 
371
- class MoveTabDownCommand < Command
415
+ class MoveTabDownCommand < TabCommand
372
416
 
373
417
  def execute
374
418
  win.focussed_notebook.move_down
@@ -717,7 +761,7 @@ Redcar.environment: #{Redcar.environment}
717
761
 
718
762
  # define commands from SelectTab1Command to SelectTab9Command
719
763
  (1..9).each do |tab_num|
720
- const_set("SelectTab#{tab_num}Command", Class.new(Redcar::Command)).class_eval do
764
+ const_set("SelectTab#{tab_num}Command", Class.new(Redcar::TabCommand)).class_eval do
721
765
  define_method :execute do
722
766
  notebook = Redcar.app.focussed_window_notebook
723
767
  notebook.tabs[tab_num-1].focus if notebook.tabs[tab_num-1]
@@ -769,6 +813,11 @@ Redcar.environment: #{Redcar.environment}
769
813
  end
770
814
  end
771
815
 
816
+ class ShowTitle < Command
817
+ sensitize :always_disabled
818
+ def execute; end
819
+ end
820
+
772
821
  class SelectFontSize < Command
773
822
  def execute
774
823
  result = Application::Dialog.input("Font Size", "Please enter new font size", Redcar::EditView.font_size.to_s) do |text|
@@ -1034,33 +1083,47 @@ Redcar.environment: #{Redcar.environment}
1034
1083
  end
1035
1084
  end
1036
1085
  sub_menu "View", :priority => 30 do
1037
- sub_menu "Appearance" do
1086
+ sub_menu "Appearance", :priority => 5 do
1038
1087
  item "Font", SelectNewFont
1039
1088
  item "Font Size", SelectFontSize
1040
1089
  item "Theme", SelectTheme
1041
1090
  end
1042
- item "Toggle Tree Visibility", :command => ToggleTreesCommand
1043
- item "Toggle Fullscreen", :command => ToggleFullscreen, :type => :check, :active => window ? window.fullscreen : false
1044
- separator
1045
- item "New Notebook", NewNotebookCommand
1046
- item "Close Notebook", CloseNotebookCommand
1047
- item "Rotate Notebooks", RotateNotebooksCommand
1048
- item "Move Tab To Other Notebook", MoveTabToOtherNotebookCommand
1049
- item "Switch Notebooks", SwitchNotebookCommand
1050
- separator
1051
- item "Previous Tab", SwitchTabDownCommand
1052
- item "Next Tab", SwitchTabUpCommand
1053
- item "Move Tab Left", MoveTabDownCommand
1054
- item "Move Tab Right", MoveTabUpCommand
1055
- sub_menu "Switch Tab" do
1056
- (1..9).each do |num|
1057
- item "Tab #{num}", Top.const_get("SelectTab#{num}Command")
1058
- end
1091
+ group(:priority => 10) do
1092
+ separator
1093
+ item "Toggle Tree Visibility", :command => ToggleTreesCommand
1094
+ item "Toggle Fullscreen", :command => ToggleFullscreen, :type => :check, :active => window ? window.fullscreen : false
1095
+ end
1096
+ group(:priority => 15) do
1097
+ separator
1098
+ lazy_sub_menu "Windows" do
1099
+ GenerateWindowsMenu.new(self).run
1100
+ end
1101
+ sub_menu "Notebooks" do
1102
+ item "New Notebook", NewNotebookCommand
1103
+ item "Close Notebook", CloseNotebookCommand
1104
+ item "Rotate Notebooks", RotateNotebooksCommand
1105
+ item "Move Tab To Other Notebook", MoveTabToOtherNotebookCommand
1106
+ item "Switch Notebooks", SwitchNotebookCommand
1107
+ end
1108
+ sub_menu "Tabs" do
1109
+ item "Previous Tab", SwitchTabDownCommand
1110
+ item "Next Tab", SwitchTabUpCommand
1111
+ item "Move Tab Left", MoveTabDownCommand
1112
+ item "Move Tab Right", MoveTabUpCommand
1113
+ separator
1114
+ # GenerateTabsMenu.new(self).run # TODO: find a way to maintain keybindings with lazy menus
1115
+ item "Focussed Notebook", ShowTitle
1116
+ (1..9).each do |num|
1117
+ item "Tab #{num}", Top.const_get("SelectTab#{num}Command")
1118
+ end
1119
+ end
1120
+ end
1121
+ group(:priority => :last) do
1122
+ separator
1123
+ item "Show Toolbar", :command => ToggleToolbar, :type => :check, :active => Redcar.app.show_toolbar?
1124
+ item "Show Invisibles", :command => ToggleInvisibles, :type => :check, :active => EditView.show_invisibles?
1125
+ item "Show Line Numbers", :command => ToggleLineNumbers, :type => :check, :active => EditView.show_line_numbers?
1059
1126
  end
1060
- separator
1061
- item "Show Toolbar", :command => ToggleToolbar, :type => :check, :active => Redcar.app.show_toolbar?
1062
- item "Show Invisibles", :command => ToggleInvisibles, :type => :check, :active => EditView.show_invisibles?
1063
- item "Show Line Numbers", :command => ToggleLineNumbers, :type => :check, :active => EditView.show_line_numbers?
1064
1127
  end
1065
1128
  sub_menu "Bundles", :priority => 45 do
1066
1129
  group(:priority => :first) do
@@ -47,7 +47,7 @@ module Redcar
47
47
  def execute
48
48
  path = Redcar.user_dir + "/profile_output.html"
49
49
  JRubyProf.print_graph_html(Debug.profiling_result, path)
50
- tab = win.new_tab(HtmlTab)
50
+ tab = win.new_tab(ConfigTab)
51
51
  tab.html_view.contents = File.read(path)
52
52
  tab.focus
53
53
  FileUtils.rm_f(path)
@@ -58,7 +58,7 @@ module Redcar
58
58
  def execute
59
59
  path = Redcar.user_dir + "/profile_output.html"
60
60
  JRubyProf.print_tree_html(Debug.profiling_result, path)
61
- tab = win.new_tab(HtmlTab)
61
+ tab = win.new_tab(ConfigTab)
62
62
  tab.html_view.contents = File.read(path)
63
63
  tab.focus
64
64
  FileUtils.rm_f(path)
@@ -69,7 +69,7 @@ module Redcar
69
69
 
70
70
  def execute
71
71
  controller = Controller.new
72
- tab = win.new_tab(HtmlTab)
72
+ tab = win.new_tab(ConfigTab)
73
73
  tab.html_view.controller = controller
74
74
  tab.focus
75
75
  end
@@ -0,0 +1,3 @@
1
+ When /^I open a "([^"]*)" repl$/ do |repl|
2
+ Redcar::REPL.const_get(repl.camelize + "OpenREPL").new.run
3
+ end
@@ -2,6 +2,7 @@ require 'repl/repl_mirror'
2
2
  require 'repl/ruby_mirror'
3
3
  require 'repl/clojure_mirror'
4
4
  require 'repl/groovy_mirror'
5
+ require 'repl/repl_tab'
5
6
 
6
7
  module Redcar
7
8
  class REPL
@@ -37,7 +38,7 @@ module Redcar
37
38
  [
38
39
  Sensitivity.new(:open_repl_tab, Redcar.app, false, [:tab_focussed]) do |tab|
39
40
  tab and
40
- tab.is_a?(EditTab) and
41
+ tab.is_a?(REPL::ReplTab) and
41
42
  tab.edit_view.document.mirror.is_a?(REPL::ReplMirror)
42
43
  end
43
44
  ]
@@ -46,17 +47,9 @@ module Redcar
46
47
  class OpenREPL < Command
47
48
 
48
49
  def open_repl(mirror)
49
- tab = win.new_tab(Redcar::EditTab)
50
- edit_view = tab.edit_view
51
- edit_view.document.mirror = mirror
52
- edit_view.cursor_offset = edit_view.document.length
53
- edit_view.grammar = mirror.grammar_name
50
+ tab = win.new_tab(REPL::ReplTab)
51
+ tab.repl_mirror = mirror
54
52
  tab.focus
55
-
56
- mirror.add_listener(:change) do
57
- edit_view.cursor_offset = edit_view.document.length
58
- edit_view.scroll_to_line(edit_view.document.line_count)
59
- end
60
53
  end
61
54
  end
62
55
 
@@ -0,0 +1,26 @@
1
+ module Redcar
2
+ class REPL
3
+ class ReplTab < Redcar::EditTab
4
+
5
+ DEFAULT_ICON = :application_terminal
6
+
7
+ def initialize(*args, &block)
8
+ super(*args,&block)
9
+ end
10
+
11
+ def icon
12
+ DEFAULT_ICON
13
+ end
14
+
15
+ def repl_mirror=(mirror)
16
+ edit_view.document.mirror = mirror
17
+ edit_view.cursor_offset = edit_view.document.length
18
+ edit_view.grammar = mirror.grammar_name
19
+ mirror.add_listener(:change) do
20
+ edit_view.cursor_offset = edit_view.document.length
21
+ edit_view.scroll_to_line(edit_view.document.line_count)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
File without changes
@@ -0,0 +1,4 @@
1
+ After do
2
+ # Truncate the test file
3
+ File.open(File.expand_path("../../fixtures/test.rb", __FILE__), "w")
4
+ end
@@ -0,0 +1,25 @@
1
+ Feature: Syntax Checking for Ruby
2
+ As a user
3
+ I want to get annotations on syntax errors in Ruby files
4
+
5
+ Background:
6
+ When I have opened "plugins/ruby/features/fixtures/test.rb"
7
+
8
+ Scenario: A syntax-clean Ruby file has no syntax error annotations
9
+ When I replace the contents with "def foo\n bar\nend"
10
+ And I save the tab
11
+ Then the tab should not have annotations
12
+
13
+ Scenario: A syntax-error in a Ruby file should cause syntax error annotations
14
+ When I replace the contents with "def foo\n => bar\nend"
15
+ And I save the tab
16
+ Then the tab should have annotations
17
+ And the tab should have an annotation on line 2
18
+
19
+ Scenario: Fixing a syntax-error in a Ruby file should cause syntax error annotations to vanish
20
+ When I replace the contents with "def foo\n => bar\nend"
21
+ And I save the tab
22
+ Then the tab should have annotations
23
+ When I replace the contents with "def foo\n bar\nend"
24
+ And I save the tab
25
+ Then the tab should not have annotations
@@ -29,6 +29,34 @@ Feature: Showing commands in a command tree
29
29
  And I expand the tree row "fixture_runnables"
30
30
  Then I should see "A changed app" in the tree
31
31
 
32
+ Scenario: I can switch forth and back between project and runnables tree
33
+ When I open the runnables tree
34
+ And I click the project tree tab
35
+ Then I should not see "fixture_runnables" in the tree
36
+ When I left-click the "Runnables" tree tab
37
+ Then I should see "fixture_runnables" in the tree
38
+
39
+ Scenario: Right-clicking the runnables tab does not activate it
40
+ When I open the runnables tree
41
+ And I click the project tree tab
42
+ Then I should not see "fixture_runnables" in the tree
43
+ When I right-click the "Runnables" tree tab
44
+ Then I should not see "fixture_runnables" in the tree
45
+
46
+ Scenario: Closing the project via icon closes the runnables tree
47
+ And I open the runnables tree
48
+ And I click the project tree tab
49
+ And I click the close button
50
+ Then the tree width should be the minimum size
51
+ And there should not be a tree titled "Runnables"
52
+
53
+ Scenario: Closing the project via menu item closes the runnables tree
54
+ And I open the runnables tree
55
+ And I click the project tree tab
56
+ And I close the tree
57
+ Then the tree width should be the minimum size
58
+ And there should not be a tree titled "Runnables"
59
+
32
60
  # TODO: Refresh on window changes
33
61
  # TODO: preserve expanding when refreshing
34
62
  # Example of these are available in refresh_directory_tree.feature
@@ -42,6 +42,7 @@ module Redcar
42
42
  end
43
43
  tab = window.new_tab(HtmlTab)
44
44
  tab.html_view.controller = controller
45
+ tab.icon = :cog
45
46
  tab.focus
46
47
  end
47
48
  end
@@ -23,20 +23,20 @@ module Redcar
23
23
  project = Project::Manager.in_window(win)
24
24
  tree = Tree.new(
25
25
  TreeMirror.new(project),
26
- TreeController.new(project)
26
+ TreeController.new(project,TREE_TITLE)
27
27
  )
28
28
  win.treebook.add_tree(tree)
29
29
  end
30
30
  end
31
31
  end
32
32
 
33
- class RunEditTabCommand < Redcar::EditTabCommand
34
- sensitize :open_project
33
+ class RunEditTabCommand < Redcar::DocumentCommand
34
+ sensitize :open_project, :focussed_committed_mirror
35
35
  def execute
36
36
  project = Project::Manager.in_window(win)
37
37
  f = Runnables.file_mappings(project).detect do |file_mapping|
38
38
  regex = Regexp.new(file_mapping["regex"])
39
- tab.edit_view.document.mirror.path =~ regex
39
+ doc.mirror.path =~ regex
40
40
  end
41
41
  run_tab(project.home_dir,tab, f) if f
42
42
  end