redcar 0.6.1 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. data/CHANGES +26 -0
  2. data/README.md +17 -31
  3. data/Rakefile +1 -1
  4. data/bin/redcar +1 -1
  5. data/lib/redcar.rb +8 -4
  6. data/lib/redcar/installer.rb +2 -1
  7. data/plugins/application/features/step_definitions/dialog_steps.rb +5 -0
  8. data/plugins/application/features/step_definitions/tree_steps.rb +1 -1
  9. data/plugins/application/features/support/env.rb +38 -17
  10. data/plugins/application/lib/application.rb +4 -0
  11. data/plugins/application/lib/application/command.rb +8 -2
  12. data/plugins/application/lib/application/command/executor.rb +37 -8
  13. data/plugins/application/lib/application/command/history.rb +3 -3
  14. data/plugins/application/lib/application/menu.rb +4 -0
  15. data/plugins/application/lib/application/menu/item.rb +9 -1
  16. data/plugins/application/lib/application/tab.rb +11 -0
  17. data/plugins/application/spec/application/command/executor_spec.rb +3 -3
  18. data/plugins/application/spec/application/command_spec.rb +24 -0
  19. data/plugins/application/spec/spec_helper.rb +1 -0
  20. data/plugins/application_swt/lib/application_swt.rb +27 -24
  21. data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +4 -33
  22. data/plugins/application_swt/lib/application_swt/dialogs/input_dialog.rb +46 -0
  23. data/plugins/application_swt/lib/application_swt/dialogs/text_and_file_dialog.rb +118 -0
  24. data/plugins/application_swt/lib/application_swt/icon.rb +37 -0
  25. data/plugins/application_swt/lib/application_swt/menu.rb +8 -3
  26. data/plugins/application_swt/lib/application_swt/tab.rb +6 -3
  27. data/plugins/application_swt/lib/application_swt/treebook.rb +29 -31
  28. data/plugins/application_swt/lib/swt/graphics_utils.rb +170 -0
  29. data/plugins/application_swt/lib/swt/vtab_folder.rb +125 -0
  30. data/plugins/application_swt/lib/swt/vtab_item.rb +69 -0
  31. data/plugins/application_swt/lib/swt/vtab_label.rb +84 -0
  32. data/plugins/auto_indenter/lib/auto_indenter.rb +4 -2
  33. data/plugins/core/lib/core/controller.rb +18 -0
  34. data/plugins/declarations/lib/declarations.rb +1 -1
  35. data/plugins/document_search/lib/document_search.rb +8 -6
  36. data/plugins/document_search/lib/document_search/replace.rb +51 -31
  37. data/plugins/document_search/lib/document_search/search_and_replace.rb +12 -11
  38. data/plugins/edit_view/features/step_definitions/editing_steps.rb +33 -17
  39. data/plugins/edit_view/lib/edit_view.rb +100 -21
  40. data/plugins/edit_view/lib/edit_view/actions/arrow_keys.rb +34 -11
  41. data/plugins/edit_view/lib/edit_view/actions/deletion.rb +10 -0
  42. data/plugins/edit_view/lib/edit_view/command.rb +5 -1
  43. data/plugins/edit_view/lib/edit_view/document.rb +8 -3
  44. data/plugins/edit_view/lib/edit_view/document/command.rb +15 -1
  45. data/plugins/edit_view/lib/edit_view/document/controller.rb +9 -0
  46. data/plugins/edit_view/lib/edit_view/document/history.rb +41 -0
  47. data/plugins/edit_view/lib/edit_view/tab_settings.rb +1 -11
  48. data/plugins/edit_view_swt/lib/edit_view_swt.rb +150 -4
  49. data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +1 -1
  50. data/plugins/edit_view_swt/vendor/java-mateview.rb +1 -1
  51. data/plugins/find-in-project/lib/find_in_project.rb +7 -5
  52. data/plugins/html_view/features/step_definitions/html_view_steps.rb +2 -2
  53. data/plugins/line_tools/features/step_definitions/line_tools_steps.rb +0 -1
  54. data/plugins/line_tools/lib/line_tools.rb +7 -9
  55. data/plugins/macros/features/block_selection_in_macros.feature +48 -0
  56. data/plugins/macros/features/predictive_macros.feature +79 -0
  57. data/plugins/macros/features/record_and_run_macro.feature +87 -0
  58. data/plugins/macros/features/step_definitions/macro_steps.rb +66 -0
  59. data/plugins/macros/features/step_definitions/prediction_steps.rb +8 -0
  60. data/plugins/macros/features/support/env.rb +2 -0
  61. data/plugins/macros/lib/macros.rb +167 -0
  62. data/plugins/macros/lib/macros/action_sequence.rb +30 -0
  63. data/plugins/macros/lib/macros/commands.rb +108 -0
  64. data/plugins/macros/lib/macros/macro.rb +37 -0
  65. data/plugins/macros/lib/macros/manager_controller.rb +67 -0
  66. data/plugins/macros/lib/macros/predictive/document_controller.rb +69 -0
  67. data/plugins/macros/lib/macros/predictive/sequence_finder.rb +112 -0
  68. data/plugins/macros/plugin.rb +9 -0
  69. data/plugins/macros/spec/macros/predictive/sequence_finder_spec.rb +142 -0
  70. data/plugins/macros/spec/spec_helper.rb +6 -0
  71. data/plugins/macros/views/macro_manager.html.erb +86 -0
  72. data/plugins/outline_view/lib/outline_view.rb +1 -1
  73. data/plugins/project/lib/project/commands.rb +2 -2
  74. data/plugins/redcar/redcar.rb +37 -46
  75. data/plugins/repl/lib/repl.rb +4 -4
  76. data/plugins/runnables/features/command_tree.feature +1 -1
  77. data/plugins/runnables/features/parameter_input.feature +42 -0
  78. data/plugins/runnables/features/step_definitions/runnable_steps.rb +6 -0
  79. data/plugins/runnables/features/support/env.rb +28 -8
  80. data/plugins/runnables/lib/runnables.rb +35 -206
  81. data/plugins/runnables/lib/runnables/commands.rb +65 -0
  82. data/plugins/runnables/lib/runnables/tree_mirror/nodes/runnable.rb +62 -0
  83. data/plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_group.rb +59 -0
  84. data/plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb +32 -0
  85. data/plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb +41 -0
  86. data/plugins/runnables/lib/runnables/tree_mirror/tree_mirror.rb +61 -0
  87. data/plugins/scm/lib/scm.rb +78 -45
  88. data/plugins/scm/lib/scm/commands.rb +18 -4
  89. data/plugins/scm/lib/scm/model.rb +54 -41
  90. data/plugins/scm_svn/LICENSE +48 -0
  91. data/plugins/scm_svn/features/add_and_commit.feature +18 -0
  92. data/plugins/scm_svn/features/checkout.feature +5 -0
  93. data/plugins/scm_svn/features/edit_and_index.feature +12 -0
  94. data/plugins/scm_svn/features/ignore_files.feature +14 -0
  95. data/plugins/scm_svn/features/merge.feature +34 -0
  96. data/plugins/scm_svn/features/resolve_conflict.feature +23 -0
  97. data/plugins/scm_svn/features/revert_and_delete.feature +21 -0
  98. data/plugins/scm_svn/features/step_definitions/branch_and_merge_steps.rb +27 -0
  99. data/plugins/scm_svn/features/step_definitions/checkout_steps.rb +25 -0
  100. data/plugins/scm_svn/features/step_definitions/edit_and_index_steps.rb +50 -0
  101. data/plugins/scm_svn/features/step_definitions/scm_svn_steps.rb +57 -0
  102. data/plugins/scm_svn/features/support/env.rb +74 -0
  103. data/plugins/scm_svn/features/switch_branches.feature +53 -0
  104. data/plugins/scm_svn/features/update.feature +16 -0
  105. data/plugins/scm_svn/lib/scm_svn.rb +423 -9
  106. data/plugins/scm_svn/lib/scm_svn/change.rb +116 -0
  107. data/plugins/swt/lib/swt.rb +0 -15
  108. data/plugins/swt/lib/swt/cucumber_patches.rb +2 -37
  109. data/plugins/swt/lib/swt/cucumber_runner.rb +1 -0
  110. data/plugins/swt/lib/swt/full_swt.rb +2 -0
  111. data/plugins/textmate/vendor/redcar-bundles/Bundles/Clojure.tmbundle/Syntaxes/Clojure.tmLanguage +14 -2
  112. data/plugins/todo_list/lib/todo_list/todo_controller.rb +1 -1
  113. data/plugins/todo_list/views/default.css +50 -0
  114. data/plugins/todo_list/views/index.html.erb +5 -16
  115. data/plugins/todo_list/views/redcar_small_icon.png +0 -0
  116. data/plugins/tree_view_swt/lib/tree_view_swt.rb +14 -33
  117. data/plugins/view_shortcuts/views/default.css +31 -0
  118. data/plugins/view_shortcuts/views/index.html.erb +26 -16
  119. data/plugins/view_shortcuts/views/redcar_small_icon.png +0 -0
  120. data/{plugins/runnables → share}/icons/cog.png +0 -0
  121. data/share/icons/folder-gear-emblem.png +0 -0
  122. data/share/icons/folder-gear.png +0 -0
  123. data/share/icons/folder-open-small-gears.png +0 -0
  124. metadata +59 -5
@@ -0,0 +1,116 @@
1
+ module Redcar
2
+ module Scm
3
+ module Subversion
4
+ class Change
5
+ include Redcar::Scm::ScmChangesMirror::Change
6
+ include_package 'org.tmatesoft.svn.core.wc'
7
+ include_package 'org.tmatesoft.svn.core'
8
+
9
+ def initialize(path,status,children,diff_client)
10
+ case Redcar.platform
11
+ when :osx, :linux
12
+ @path = path.gsub("//","/")
13
+ when :windows
14
+ @path = path.gsub("//","\\")
15
+ end
16
+ @status = status
17
+ @children = children
18
+ @diff_client = diff_client
19
+ end
20
+
21
+ def text
22
+ File.basename(@path)
23
+ end
24
+
25
+ def tooltip_text
26
+ @path
27
+ end
28
+
29
+ def icon
30
+ case @status
31
+ when :unmerged
32
+ if File.file?(@path)
33
+ File.join(Redcar::ICONS_DIRECTORY, "blue-document--exclamation.png")
34
+ else
35
+ File.join(Redcar::ICONS_DIRECTORY, "blue-folder--exclamation.png")
36
+ end
37
+ when :indexed
38
+ if File.file?(@path)
39
+ File.join(Redcar::ICONS_DIRECTORY, "blue-document--plus.png")
40
+ else
41
+ File.join(Redcar::ICONS_DIRECTORY, "blue-folder--plus.png")
42
+ end
43
+ when :deleted
44
+ if File.file?(@path)
45
+ File.join(Redcar::ICONS_DIRECTORY, "blue-document-shred.png")
46
+ else
47
+ File.join(Redcar::ICONS_DIRECTORY, "blue-folder-shred.png")
48
+ end
49
+ when :changed
50
+ if File.file?(@path)
51
+ File.join(Redcar::ICONS_DIRECTORY, "blue-document--pencil.png")
52
+ else
53
+ File.join(Redcar::ICONS_DIRECTORY, "blue-folder--pencil.png")
54
+ end
55
+ when :missing
56
+ File.join(Redcar::ICONS_DIRECTORY, "question-white.png")
57
+ when :new
58
+ if File.directory?(@path.to_s)
59
+ :directory
60
+ else
61
+ :file
62
+ end
63
+ else
64
+ :file
65
+ end
66
+ end
67
+
68
+ def leaf?
69
+ File.file?(@path)
70
+ end
71
+
72
+ def status
73
+ [@status]
74
+ end
75
+
76
+ def log_status
77
+ "#{log_codes[status] || ''} #{path}"
78
+ end
79
+
80
+ def path
81
+ @path
82
+ end
83
+
84
+ def children
85
+ @children
86
+ end
87
+
88
+ def diff
89
+ unless @status == :new
90
+ stream = Java::JavaIo::ByteArrayOutputStream.new
91
+ file = Java::JavaIo::File.new(path)
92
+ @diff_client.doDiff(
93
+ file, SVNRevision::BASE,
94
+ file, SVNRevision::WORKING,
95
+ SVNDepth::IMMEDIATES,
96
+ false,
97
+ stream,
98
+ Java::JavaUtil::ArrayList.new
99
+ )
100
+ stream.toString()
101
+ end
102
+ end
103
+
104
+ def log_codes
105
+ {
106
+ [:indexed] => "A",
107
+ [:changed] => "M",
108
+ [:deleted] => "D",
109
+ [:missing] => "!",
110
+ [:unmerged] => "C"
111
+ }
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end
@@ -175,18 +175,3 @@ module Swt
175
175
  display # must be created before we import the Clipboard class.
176
176
  end
177
177
  end
178
-
179
- module JFace
180
- Dir[Redcar.asset_dir + "/jface/*.jar"].each do |jar_fn|
181
- require jar_fn
182
- end
183
-
184
- module Viewers
185
- end
186
-
187
- module Text
188
- end
189
-
190
- module Dialogs
191
- end
192
- end
@@ -27,7 +27,9 @@ module Cucumber
27
27
  end
28
28
  end
29
29
  end
30
+
30
31
  Redcar::ApplicationSWT.display.syncExec(block)
32
+
31
33
  if ENV["SLOW_CUKES"]
32
34
  sleep ENV["SLOW_CUKES"].to_f
33
35
  end
@@ -37,28 +39,6 @@ module Cucumber
37
39
  end
38
40
  end
39
41
 
40
- # module Ast
41
- # class TreeWalker
42
- # def visit_steps(steps)
43
- # broadcast(steps) do
44
- # block = Swt::RRunnable.new do
45
- # steps.accept(self)
46
- # end
47
- # Redcar::ApplicationSWT.display.syncExec(block)
48
- # end
49
- # end
50
- #
51
- # def visit_step(step)
52
- # broadcast(step) do
53
- # block = Swt::RRunnable.new do
54
- # step.accept(self)
55
- # end
56
- # Redcar::ApplicationSWT.display.syncExec(block)
57
- # end
58
- # end
59
- # end
60
- # end
61
-
62
42
  module RbSupport
63
43
  class RbLanguage
64
44
  def require_support_files(path)
@@ -78,21 +58,6 @@ module Cucumber
78
58
  end
79
59
  end
80
60
 
81
- # class RbStepDefinition
82
- # def invoke(args)
83
- # args = args.map{|arg| Ast::PyString === arg ? arg.to_s : arg}
84
- # begin
85
- # args = @rb_language.execute_transforms(args)
86
- # block = Swt::RRunnable.new do
87
- # @rb_language.current_world.cucumber_instance_exec(true, regexp_source, *args, &@proc)
88
- # end
89
- # Redcar::ApplicationSWT.display.syncExec(block)
90
- # rescue Cucumber::ArityMismatchError => e
91
- # e.backtrace.unshift(self.backtrace_line)
92
- # raise e
93
- # end
94
- # end
95
- # end
96
61
  end
97
62
 
98
63
  module Cli
@@ -13,6 +13,7 @@ module Swt
13
13
  main = Cucumber::Cli::Main.new(args)
14
14
  main.execute!(Cucumber::StepMother.new)
15
15
  Redcar.app.quit
16
+ Redcar::ApplicationSWT.display.wake
16
17
  rescue Object => e
17
18
  puts e.message
18
19
  puts e.backtrace
@@ -71,10 +71,12 @@ module Swt
71
71
  import org.eclipse.swt.graphics.Font
72
72
  import org.eclipse.swt.graphics.GC
73
73
  import org.eclipse.swt.graphics.Point
74
+ import org.eclipse.swt.graphics.RGB
74
75
  end
75
76
 
76
77
  module Events
77
78
  import org.eclipse.swt.events.KeyEvent
79
+ import org.eclipse.swt.events.MouseListener
78
80
  end
79
81
 
80
82
  import org.eclipse.swt.browser.Browser
@@ -120,6 +120,12 @@
120
120
  <key>name</key>
121
121
  <string>constant.numeric.octal.clojure</string>
122
122
  </dict>
123
+ <dict>
124
+ <key>match</key>
125
+ <string>\b(=|\+|-|/|\*|if|var|accessor|aclone|add-classpath|add-watch|agent|agent-error|agent-errors|aget|alength|alias|all-ns|alter|alter-meta!|alter-var-root|amap|ancestors|and|apply|areduce|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|assoc!|assoc-in|associative\?|atom|await|await-for|bases|bean|bigdec|bigint|binding|bit-and|bit-and-not|bit-clear|bit-flip|bit-not|bit-or|bit-set|bit-shift-left|bit-shift-right|bit-test|bit-xor|boolean|boolean-array|booleans|bound-fn|bound-fn\*|bound\?|butlast|byte|byte-array|bytes|case|cast|char|char-array|char-escape-string|char-name-string|char\?|chars|class|class\?|clear-agent-errors|clojure-version|coll\?|comment|commute|comp|comparator|compare|compare-and-set!|compile|complement|concat|cond|condp|conj|conj!|cons|constantly|construct-proxy|contains\?|count|counted\?|create-ns|create-struct|cycle|dec|decimal\?|declare|definline|defmacro|defmethod|defmulti|defn|defn-|defonce|defprotocol|defrecord|defstruct|deftype|delay|delay\?|deliver|denominator|deref|derive|descendants|disj|disj!|dissoc|dissoc!|distinct|distinct\?|doall|doc|dorun|doseq|dosync|dotimes|doto|double|double-array|doubles|drop|drop-last|drop-while|empty|empty\?|ensure|enumeration-seq|error-handler|error-mode|eval|even\?|every\?|extend|extend-protocol|extend-type|extenders|extends\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|flatten|float|float-array|float\?|floats|flush|fn|fn\?|fnext|fnil|for|force|format|frequencies|future|future-call|future-cancel|future-cancelled\?|future-done\?|future\?|gen-class|gen-interface|gensym|get|get-in|get-method|get-proxy-class|get-thread-bindings|get-validator|group-by|hash|hash-map|hash-set|identical\?|identity|if-let|if-not|ifn\?|import|in-ns|inc|init-proxy|instance\?|int|int-array|integer\?|interleave|intern|interpose|into|into-array|ints|io!|isa\?|iterate|iterator-seq|juxt|keep|keep-indexed|key|keys|keyword|keyword\?|last|lazy-cat|lazy-seq|let|letfn|line-seq|list|list\*|list\?|load|load-file|load-reader|load-string|loaded-libs|locking|long|long-array|longs|loop|macroexpand|macroexpand-1|make-array|make-hierarchy|map|map-indexed|map\?|mapcat|max|max-key|memfn|memoize|merge|merge-with|meta|methods|min|min-key|mod|name|namespace|namespace-munge|neg\?|newline|next|nfirst|nil\?|nnext|not|not-any\?|not-empty|not-every\?|not=|ns|ns-aliases|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unalias|ns-unmap|nth|nthnext|num|number\?|numerator|object-array|odd\?|or|parents|partial|partition|partition-all|partition-by|pcalls|peek|persistent!|pmap|pop|pop!|pop-thread-bindings|pos\?|pr|pr-str|prefer-method|prefers|print|print-namespace-doc|print-str|printf|println|println-str|prn|prn-str|promise|proxy|proxy-mappings|proxy-super|push-thread-bindings|pvalues|quot|rand|rand-int|rand-nth|range|ratio\?|rationalize|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|read-string|reduce|reductions|ref|ref-history-count|ref-max-history|ref-min-history|ref-set|refer|refer-clojure|reify|release-pending-sends|rem|remove|remove-all-methods|remove-method|remove-ns|remove-watch|repeat|repeatedly|replace|replicate|require|reset!|reset-meta!|resolve|rest|restart-agent|resultset-seq|reverse|reversible\?|rseq|rsubseq|satisfies\?|second|select-keys|send|send-off|seq|seq\?|seque|sequence|sequential\?|set|set-error-handler!|set-error-mode!|set-validator!|set\?|short|short-array|shorts|shuffle|shutdown-agents|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|sorted-set-by|sorted\?|special-form-anchor|special-symbol\?|spit|split-at|split-with|str|string\?|struct|struct-map|subs|subseq|subvec|supers|swap!|symbol|symbol\?|sync|syntax-symbol-anchor|take|take-last|take-nth|take-while|test|the-ns|thread-bound\?|time|to-array|to-array-2d|trampoline|transient|tree-seq|true\?|type|unchecked-add|unchecked-dec|unchecked-divide|unchecked-inc|unchecked-multiply|unchecked-negate|unchecked-remainder|unchecked-subtract|underive|update-in|update-proxy|use|val|vals|var-get|var-set|var\?|vary-meta|vec|vector|vector-of|vector\?|when|when-first|when-let|when-not|while|with-bindings|with-bindings\*|with-in-str|with-local-vars|with-meta|with-open|with-out-str|with-precision|xml-seq|zero\?|zipmap)\b</string>
126
+ <key>name</key>
127
+ <string>keyword.control.clojure</string>
128
+ </dict>
123
129
  <dict>
124
130
  <key>match</key>
125
131
  <string>(\d+)</string>
@@ -253,7 +259,7 @@
253
259
  <array>
254
260
  <dict>
255
261
  <key>begin</key>
256
- <string>(?&lt;=\()(def|def-)\s+(.+?)(?=\s)</string>
262
+ <string>(?&lt;=\()(def|def-|deftest)\s+(.+?)(?=\s)</string>
257
263
  <key>beginCaptures</key>
258
264
  <dict>
259
265
  <key>1</key>
@@ -281,7 +287,7 @@
281
287
  </dict>
282
288
  <dict>
283
289
  <key>begin</key>
284
- <string>(?&lt;=\()(defn|defn-)\s+(.+?)(?=\s)</string>
290
+ <string>(?&lt;=\()(defn|defn-|deftest)\s+(.+?)(?=\s)</string>
285
291
  <key>beginCaptures</key>
286
292
  <dict>
287
293
  <key>1</key>
@@ -400,6 +406,12 @@
400
406
  <key>name</key>
401
407
  <string>meta.symbol.clojure</string>
402
408
  </dict>
409
+ <dict>
410
+ <key>match</key>
411
+ <string>(:\w[\w\d]+)</string>
412
+ <key>name</key>
413
+ <string>constant.other.symbol.clojure</string>
414
+ </dict>
403
415
  </array>
404
416
  </dict>
405
417
  <key>vector</key>
@@ -102,7 +102,7 @@ module Redcar
102
102
  html=<<-HTML
103
103
  <tr>
104
104
  <td bgcolor="#ccffcc" width="40%"><a class="action">#{action}</a></td>
105
- <td><a class="file_path" href="controller/open_file?#{path}">#{display_path}</a></td>
105
+ <td bgcolor="#dddddd"><a class="file_path" href="controller/open_file?#{path}">#{display_path}</a></td>
106
106
  </tr>
107
107
  HTML
108
108
  percentage = 100
@@ -0,0 +1,50 @@
1
+ body {
2
+ margin:0;
3
+ }
4
+
5
+ h1 {
6
+ background: #5f282d url("redcar_small_icon.png") no-repeat 10px 10px;
7
+ color: #dcb663;
8
+ height: 30px;
9
+ line-height: 30px;
10
+ padding: 10px 10px 10px 52px;
11
+ font-family: Palatino, Times, serif;
12
+ letter-spacing: 3px;
13
+ font-size: 100%;
14
+ }
15
+
16
+ .content {
17
+ margin: 10px;
18
+ }
19
+
20
+ .refresh {
21
+ padding: 5px;
22
+ }
23
+
24
+ .even {
25
+ background-color: #ddd;
26
+ }
27
+
28
+ table {
29
+ font-size: 80%;
30
+ border-collapse: collapse;
31
+ border: 1px solid #888;
32
+ }
33
+
34
+ td,th {
35
+ border-collapse: collapse;
36
+ border: 1px solid #888;
37
+ padding: 8px;
38
+ }
39
+
40
+ .status {
41
+ padding:3px;
42
+ margin:3px;
43
+ font-style:italic;
44
+ }
45
+
46
+ .final_status {
47
+ font-size:70%;
48
+ font-style:italic;
49
+ float:right;
50
+ }
@@ -1,22 +1,11 @@
1
1
 
2
2
  <script type="text/javascript" src="file://<%= Redcar::HtmlView.jquery_path %>"></script>
3
- <link rel="stylesheet" href="file://<%= Redcar::HtmlView.default_css_path %>" type="text/css" media="screen">
4
- <style>
5
- .status {
6
- padding:3px;
7
- margin:3px;
8
- font-style:italic;
9
- }
10
- .final_status {
11
- font-size:70%;
12
- font-style:italic;
13
- float:right;
14
- }
15
- </style>
16
- <h3>Todo List</h3>
3
+ <% redcar_css = File.expand_path(File.join(Redcar.root, %w(plugins todo_list views default.css))) %>
4
+ <link rel="stylesheet" href="file://<%= redcar_css %>" type="text/css" media="screen">
5
+ <h1>Todo List</h1>
17
6
  <div>
18
7
  <a class="status" id="status"></a>
19
- <a id="refresh" href="controller/index"></a>
8
+ <a id="refresh" href="controller/index"></a>
20
9
  <a class="final_status" id="final_status"></a>
21
10
  </div>
22
- <div id="tags"></div>
11
+ <div class="content" id="tags"></div>
@@ -2,7 +2,9 @@
2
2
  module Redcar
3
3
  class TreeViewSWT
4
4
  attr_reader :viewer, :model
5
-
5
+
6
+ extend Forwardable
7
+
6
8
  def self.storage
7
9
  @storage ||= begin
8
10
  storage = Plugin::Storage.new('tree_view_swt_plugin')
@@ -13,7 +15,7 @@ module Redcar
13
15
 
14
16
  def initialize(composite, model)
15
17
  @composite, @model = composite, model
16
- tree_style = Swt::SWT::MULTI
18
+ tree_style = Swt::SWT::MULTI | Swt::SWT::H_SCROLL | Swt::SWT::V_SCROLL
17
19
  @viewer = JFace::Viewers::TreeViewer.new(@composite, tree_style)
18
20
  grid_data = Swt::Layout::GridData.new
19
21
  grid_data.grabExcessHorizontalSpace = true
@@ -58,7 +60,13 @@ module Redcar
58
60
  @model.add_listener(:expand_element, &method(:expand_element))
59
61
  @model.add_listener(:select_element, &method(:select_element))
60
62
  end
61
-
63
+
64
+ def tree_mirror
65
+ @model.tree_mirror
66
+ end
67
+
68
+ def_delegators :control, :layout_data, :layout_data=, :visible, :visible=
69
+
62
70
  class DragSourceListener
63
71
  attr_reader :tree, :dragged_elements
64
72
 
@@ -268,7 +276,8 @@ module Redcar
268
276
  def close
269
277
  @viewer.getControl.dispose
270
278
  end
271
-
279
+ alias :dispose :close
280
+
272
281
  def right_click(mouse_event)
273
282
  if @model.tree_controller
274
283
  point = Swt::Graphics::Point.new(mouse_event.x, mouse_event.y)
@@ -438,16 +447,7 @@ module Redcar
438
447
  end
439
448
 
440
449
  def get_image(tree_node)
441
- case icon = tree_node.icon
442
- when :directory
443
- dir_image
444
- when :file
445
- file_image
446
- when Symbol
447
- image(File.expand_path(File.join(Redcar::ICONS_DIRECTORY, icon.to_s + ".png")))
448
- when String
449
- image(icon)
450
- end
450
+ ApplicationSWT::Icon.swt_image(tree_node.icon)
451
451
  end
452
452
 
453
453
  def dispose
@@ -470,25 +470,6 @@ module Redcar
470
470
  # 5000
471
471
  #end
472
472
 
473
- private
474
-
475
- def image(path)
476
- Swt::Graphics::Image.new(ApplicationSWT.display, path)
477
- end
478
-
479
- def dir_image
480
- @dir_image ||= begin
481
- path = File.join(Redcar.root, %w(plugins application icons darwin-folder.png))
482
- image(path)
483
- end
484
- end
485
-
486
- def file_image
487
- @file_image ||= begin
488
- path = File.join(Redcar.root, %w(plugins application icons darwin-file.png))
489
- image(path)
490
- end
491
- end
492
473
  end
493
474
  end
494
475
  end
@@ -0,0 +1,31 @@
1
+ body {
2
+ margin:0;
3
+ }
4
+
5
+ h1 {
6
+ background: #5f282d url("redcar_small_icon.png") no-repeat 10px 10px;
7
+ color: #dcb663;
8
+ height: 30px;
9
+ line-height: 30px;
10
+ padding: 10px 10px 10px 52px;
11
+ font-family: Palatino, Times, serif;
12
+ letter-spacing: 3px;
13
+ font-size: 100%;
14
+ }
15
+
16
+ .content {
17
+ margin: 10px;
18
+ }
19
+
20
+ .refresh {
21
+ padding: 5px;
22
+ }
23
+
24
+ .even {
25
+ background-color: #ddd;
26
+ }
27
+
28
+ table {
29
+ border: 1px solid black;
30
+ font-size: 80%;
31
+ }