redcar 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +24 -0
- data/Rakefile +85 -2
- data/lib/json/CHANGES +166 -0
- data/lib/json/COPYING +58 -0
- data/lib/json/GPL +340 -0
- data/lib/json/README +358 -0
- data/lib/json/Rakefile +292 -0
- data/lib/json/TODO +1 -0
- data/lib/json/VERSION +1 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
- data/lib/json/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
- data/lib/json/benchmarks/generator2_benchmark.rb +222 -0
- data/lib/json/benchmarks/generator_benchmark.rb +224 -0
- data/lib/json/benchmarks/ohai.json +1216 -0
- data/lib/json/benchmarks/ohai.ruby +1 -0
- data/lib/json/benchmarks/parser2_benchmark.rb +251 -0
- data/lib/json/benchmarks/parser_benchmark.rb +259 -0
- data/lib/json/bin/edit_json.rb +9 -0
- data/lib/json/bin/prettify_json.rb +75 -0
- data/lib/json/data/example.json +1 -0
- data/lib/json/data/index.html +38 -0
- data/lib/json/data/prototype.js +4184 -0
- data/lib/json/ext/json/ext/generator/extconf.rb +16 -0
- data/lib/json/ext/json/ext/generator/generator.c +1323 -0
- data/lib/json/ext/json/ext/generator/generator.h +170 -0
- data/lib/json/ext/json/ext/parser/extconf.rb +15 -0
- data/lib/json/ext/json/ext/parser/parser.c +1935 -0
- data/lib/json/ext/json/ext/parser/parser.h +71 -0
- data/lib/json/ext/json/ext/parser/parser.rl +792 -0
- data/lib/json/install.rb +26 -0
- data/lib/json/lib/json.rb +10 -0
- data/lib/json/lib/json/Array.xpm +21 -0
- data/lib/json/lib/json/FalseClass.xpm +21 -0
- data/lib/json/lib/json/Hash.xpm +21 -0
- data/lib/json/lib/json/Key.xpm +73 -0
- data/lib/json/lib/json/NilClass.xpm +21 -0
- data/lib/json/lib/json/Numeric.xpm +28 -0
- data/lib/json/lib/json/String.xpm +96 -0
- data/lib/json/lib/json/TrueClass.xpm +21 -0
- data/lib/json/lib/json/add/core.rb +148 -0
- data/lib/json/lib/json/add/rails.rb +58 -0
- data/lib/json/lib/json/common.rb +397 -0
- data/lib/json/lib/json/editor.rb +1371 -0
- data/lib/json/lib/json/ext.rb +15 -0
- data/lib/json/lib/json/json.xpm +1499 -0
- data/lib/json/lib/json/pure.rb +77 -0
- data/lib/json/lib/json/pure/generator.rb +452 -0
- data/lib/json/lib/json/pure/parser.rb +307 -0
- data/lib/json/lib/json/version.rb +8 -0
- data/lib/json/tests/fixtures/fail1.json +1 -0
- data/lib/json/tests/fixtures/fail10.json +1 -0
- data/lib/json/tests/fixtures/fail11.json +1 -0
- data/lib/json/tests/fixtures/fail12.json +1 -0
- data/lib/json/tests/fixtures/fail13.json +1 -0
- data/lib/json/tests/fixtures/fail14.json +1 -0
- data/lib/json/tests/fixtures/fail18.json +1 -0
- data/lib/json/tests/fixtures/fail19.json +1 -0
- data/lib/json/tests/fixtures/fail2.json +1 -0
- data/lib/json/tests/fixtures/fail20.json +1 -0
- data/lib/json/tests/fixtures/fail21.json +1 -0
- data/lib/json/tests/fixtures/fail22.json +1 -0
- data/lib/json/tests/fixtures/fail23.json +1 -0
- data/lib/json/tests/fixtures/fail24.json +1 -0
- data/lib/json/tests/fixtures/fail25.json +1 -0
- data/lib/json/tests/fixtures/fail27.json +2 -0
- data/lib/json/tests/fixtures/fail28.json +2 -0
- data/lib/json/tests/fixtures/fail3.json +1 -0
- data/lib/json/tests/fixtures/fail4.json +1 -0
- data/lib/json/tests/fixtures/fail5.json +1 -0
- data/lib/json/tests/fixtures/fail6.json +1 -0
- data/lib/json/tests/fixtures/fail7.json +1 -0
- data/lib/json/tests/fixtures/fail8.json +1 -0
- data/lib/json/tests/fixtures/fail9.json +1 -0
- data/lib/json/tests/fixtures/pass1.json +56 -0
- data/lib/json/tests/fixtures/pass15.json +1 -0
- data/lib/json/tests/fixtures/pass16.json +1 -0
- data/lib/json/tests/fixtures/pass17.json +1 -0
- data/lib/json/tests/fixtures/pass2.json +1 -0
- data/lib/json/tests/fixtures/pass26.json +1 -0
- data/lib/json/tests/fixtures/pass3.json +6 -0
- data/lib/json/tests/test_json.rb +361 -0
- data/lib/json/tests/test_json_addition.rb +162 -0
- data/lib/json/tests/test_json_encoding.rb +68 -0
- data/lib/json/tests/test_json_fixtures.rb +34 -0
- data/lib/json/tests/test_json_generate.rb +122 -0
- data/lib/json/tests/test_json_rails.rb +144 -0
- data/lib/json/tests/test_json_unicode.rb +76 -0
- data/lib/json/tools/fuzz.rb +139 -0
- data/lib/json/tools/server.rb +61 -0
- data/lib/redcar.rb +5 -3
- data/lib/redcar/runner.rb +1 -5
- data/lib/redcar_quick_start.rb +2 -7
- data/plugins/application/features/support/env.rb +6 -1
- data/plugins/application/lib/application/command/history.rb +5 -0
- data/plugins/application/lib/application/dialog.rb +1 -1
- data/plugins/application_swt/lib/application_swt.rb +0 -1
- data/plugins/application_swt/lib/application_swt/html_tab.rb +4 -2
- data/plugins/application_swt/lib/application_swt/menu.rb +3 -1
- data/plugins/application_swt/lib/application_swt/swt_wrapper.rb +4 -0
- data/plugins/core/lib/core.rb +1 -0
- data/plugins/core/lib/core/has_spi.rb +10 -0
- data/plugins/edit_view/features/new_tab.feature +0 -1
- data/plugins/edit_view/features/step_definitions/tab_steps.rb +1 -1
- data/plugins/edit_view/lib/edit_view.rb +13 -0
- data/plugins/edit_view/lib/edit_view/document/command.rb +1 -1
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +4 -0
- data/plugins/html_view/assets/redcar.css +2 -1
- data/plugins/html_view/lib/html_view.rb +19 -6
- data/plugins/html_view/lib/html_view/html_tab.rb +2 -2
- data/plugins/project/lib/project.rb +11 -0
- data/plugins/project/lib/project/dir_controller.rb +252 -2
- data/plugins/project/lib/project/dir_mirror.rb +53 -5
- data/plugins/project/lib/project/manager.rb +5 -1
- data/plugins/project/views/bulk_rename.html.erb +162 -0
- data/plugins/redcar/redcar.rb +22 -2
- data/plugins/runnables/icons/cog.png +0 -0
- data/plugins/runnables/lib/runnables.rb +99 -0
- data/plugins/runnables/plugin_no_load.rb +9 -0
- data/plugins/tree/lib/tree.rb +61 -0
- data/plugins/tree/lib/tree/controller.rb +53 -4
- data/plugins/tree/lib/tree/mirror.rb +56 -16
- data/plugins/tree_view_swt/lib/tree_view_swt.rb +250 -24
- metadata +2700 -2604
- data/plugins/application_swt/lib/application_swt/notebook/drag_and_drop_listener.rb +0 -71
@@ -0,0 +1,139 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
require 'iconv'
|
4
|
+
ISO_8859_1_TO_UTF8 = Iconv.new('utf-8', 'iso-8859-15')
|
5
|
+
class ::String
|
6
|
+
def to_utf8
|
7
|
+
ISO_8859_1_TO_UTF8.iconv self
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class Fuzzer
|
12
|
+
def initialize(n, freqs = {})
|
13
|
+
sum = freqs.inject(0.0) { |s, x| s + x.last }
|
14
|
+
freqs.each_key { |x| freqs[x] /= sum }
|
15
|
+
s = 0.0
|
16
|
+
freqs.each_key do |x|
|
17
|
+
freqs[x] = s .. (s + t = freqs[x])
|
18
|
+
s += t
|
19
|
+
end
|
20
|
+
@freqs = freqs
|
21
|
+
@n = n
|
22
|
+
@alpha = (0..0xff).to_a
|
23
|
+
end
|
24
|
+
|
25
|
+
def random_string
|
26
|
+
s = ''
|
27
|
+
30.times { s << @alpha[rand(@alpha.size)] }
|
28
|
+
s.to_utf8
|
29
|
+
end
|
30
|
+
|
31
|
+
def pick
|
32
|
+
r = rand
|
33
|
+
found = @freqs.find { |k, f| f.include? rand }
|
34
|
+
found && found.first
|
35
|
+
end
|
36
|
+
|
37
|
+
def make_pick
|
38
|
+
k = pick
|
39
|
+
case
|
40
|
+
when k == Hash, k == Array
|
41
|
+
k.new
|
42
|
+
when k == true, k == false, k == nil
|
43
|
+
k
|
44
|
+
when k == String
|
45
|
+
random_string
|
46
|
+
when k == Fixnum
|
47
|
+
rand(2 ** 30) - 2 ** 29
|
48
|
+
when k == Bignum
|
49
|
+
rand(2 ** 70) - 2 ** 69
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def fuzz(current = nil)
|
54
|
+
if @n > 0
|
55
|
+
case current
|
56
|
+
when nil
|
57
|
+
@n -= 1
|
58
|
+
current = fuzz [ Hash, Array ][rand(2)].new
|
59
|
+
when Array
|
60
|
+
while @n > 0
|
61
|
+
@n -= 1
|
62
|
+
current << case p = make_pick
|
63
|
+
when Array, Hash
|
64
|
+
fuzz(p)
|
65
|
+
else
|
66
|
+
p
|
67
|
+
end
|
68
|
+
end
|
69
|
+
when Hash
|
70
|
+
while @n > 0
|
71
|
+
@n -= 1
|
72
|
+
current[random_string] = case p = make_pick
|
73
|
+
when Array, Hash
|
74
|
+
fuzz(p)
|
75
|
+
else
|
76
|
+
p
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
current
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
class MyState < JSON.state
|
86
|
+
WS = " \r\t\n"
|
87
|
+
|
88
|
+
def initialize
|
89
|
+
super(
|
90
|
+
:indent => make_spaces,
|
91
|
+
:space => make_spaces,
|
92
|
+
:space_before => make_spaces,
|
93
|
+
:object_nl => make_spaces,
|
94
|
+
:array_nl => make_spaces,
|
95
|
+
:max_nesting => false
|
96
|
+
)
|
97
|
+
end
|
98
|
+
|
99
|
+
def make_spaces
|
100
|
+
s = ''
|
101
|
+
rand(1).times { s << WS[rand(WS.size)] }
|
102
|
+
s
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
n = (ARGV.shift || 500).to_i
|
107
|
+
loop do
|
108
|
+
fuzzer = Fuzzer.new(n,
|
109
|
+
Hash => 25,
|
110
|
+
Array => 25,
|
111
|
+
String => 10,
|
112
|
+
Fixnum => 10,
|
113
|
+
Bignum => 10,
|
114
|
+
nil => 5,
|
115
|
+
true => 5,
|
116
|
+
false => 5
|
117
|
+
)
|
118
|
+
o1 = fuzzer.fuzz
|
119
|
+
json = JSON.generate o1, MyState.new
|
120
|
+
if $DEBUG
|
121
|
+
puts "-" * 80
|
122
|
+
puts json, json.size
|
123
|
+
else
|
124
|
+
puts json.size
|
125
|
+
end
|
126
|
+
begin
|
127
|
+
o2 = JSON.parse(json, :max_nesting => false)
|
128
|
+
rescue JSON::ParserError => e
|
129
|
+
puts "Caught #{e.class}: #{e.message}\n#{e.backtrace * "\n"}"
|
130
|
+
puts "o1 = #{o1.inspect}", "json = #{json}", "json_str = #{json.inspect}"
|
131
|
+
puts "locals = #{local_variables.inspect}"
|
132
|
+
exit
|
133
|
+
end
|
134
|
+
if o1 != o2
|
135
|
+
puts "mismatch", "o1 = #{o1.inspect}", "o2 = #{o2.inspect}",
|
136
|
+
"json = #{json}", "json_str = #{json.inspect}"
|
137
|
+
puts "locals = #{local_variables.inspect}"
|
138
|
+
end
|
139
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'webrick'
|
4
|
+
include WEBrick
|
5
|
+
$:.unshift 'ext'
|
6
|
+
$:.unshift 'lib'
|
7
|
+
require 'json'
|
8
|
+
|
9
|
+
class JSONServlet < HTTPServlet::AbstractServlet
|
10
|
+
@@count = 1
|
11
|
+
|
12
|
+
def do_GET(req, res)
|
13
|
+
obj = {
|
14
|
+
"TIME" => Time.now.strftime("%FT%T"),
|
15
|
+
"foo" => "Bär",
|
16
|
+
"bar" => "© ≠ €!",
|
17
|
+
'a' => 2,
|
18
|
+
'b' => 3.141,
|
19
|
+
'COUNT' => @@count += 1,
|
20
|
+
'c' => 'c',
|
21
|
+
'd' => [ 1, "b", 3.14 ],
|
22
|
+
'e' => { 'foo' => 'bar' },
|
23
|
+
'g' => "松本行弘",
|
24
|
+
'h' => 1000.0,
|
25
|
+
'i' => 0.001,
|
26
|
+
'j' => "\xf0\xa0\x80\x81",
|
27
|
+
}
|
28
|
+
res.body = JSON.generate obj
|
29
|
+
res['Content-Type'] = "application/json"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def create_server(err, dir, port)
|
34
|
+
dir = File.expand_path(dir)
|
35
|
+
err.puts "Surf to:", "http://#{Socket.gethostname}:#{port}"
|
36
|
+
|
37
|
+
s = HTTPServer.new(
|
38
|
+
:Port => port,
|
39
|
+
:DocumentRoot => dir,
|
40
|
+
:Logger => WEBrick::Log.new(err),
|
41
|
+
:AccessLog => [
|
42
|
+
[ err, WEBrick::AccessLog::COMMON_LOG_FORMAT ],
|
43
|
+
[ err, WEBrick::AccessLog::REFERER_LOG_FORMAT ],
|
44
|
+
[ err, WEBrick::AccessLog::AGENT_LOG_FORMAT ]
|
45
|
+
]
|
46
|
+
)
|
47
|
+
s.mount("/json", JSONServlet)
|
48
|
+
s
|
49
|
+
end
|
50
|
+
|
51
|
+
default_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'data'))
|
52
|
+
dir = ARGV.shift || default_dir
|
53
|
+
port = (ARGV.shift || 6666).to_i
|
54
|
+
s = create_server(STDERR, dir, 6666)
|
55
|
+
t = Thread.new { s.start }
|
56
|
+
trap(:INT) do
|
57
|
+
s.shutdown
|
58
|
+
t.join
|
59
|
+
exit
|
60
|
+
end
|
61
|
+
sleep
|
data/lib/redcar.rb
CHANGED
@@ -40,10 +40,10 @@ require 'yaml'
|
|
40
40
|
#
|
41
41
|
# and so on.
|
42
42
|
module Redcar
|
43
|
-
VERSION = '0.3.
|
43
|
+
VERSION = '0.3.7'
|
44
44
|
VERSION_MAJOR = 0
|
45
45
|
VERSION_MINOR = 3
|
46
|
-
VERSION_RELEASE =
|
46
|
+
VERSION_RELEASE = 7
|
47
47
|
|
48
48
|
ENVIRONMENTS = [:user, :debug, :test]
|
49
49
|
|
@@ -88,6 +88,9 @@ module Redcar
|
|
88
88
|
$:.push File.expand_path(File.join(File.dirname(__FILE__), "plugin_manager", "lib"))
|
89
89
|
require 'plugin_manager'
|
90
90
|
|
91
|
+
$:.push File.expand_path(File.join(File.dirname(__FILE__), "json", "lib"))
|
92
|
+
require 'json'
|
93
|
+
|
91
94
|
plugin_manager.load
|
92
95
|
if plugin_manager.unreadable_definitions.any?
|
93
96
|
puts "Couldn't read definition files: "
|
@@ -103,7 +106,6 @@ module Redcar
|
|
103
106
|
puts
|
104
107
|
puts "Unloaded plugins:"
|
105
108
|
puts plugin_manager.unloaded_plugins.map {|d| " * " + d.name}
|
106
|
-
|
107
109
|
end
|
108
110
|
end
|
109
111
|
|
data/lib/redcar/runner.rb
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
module Redcar
|
4
|
-
|
5
2
|
# Cribbed from ruby-processing. Many thanks!
|
6
3
|
class Runner
|
7
|
-
|
8
4
|
# Trade in this Ruby instance for a JRuby instance, loading in a
|
9
5
|
# starter script and passing it some arguments.
|
10
6
|
# If --jruby is passed, use the installed version of jruby, instead of
|
@@ -17,7 +13,7 @@ module Redcar
|
|
17
13
|
exit 1
|
18
14
|
end
|
19
15
|
ENV['RUBYOPT'] = nil # disable other native args
|
20
|
-
command = "java #{java_args} -Xmx500m -Xss1024k -Djruby.memory.max=500m -Djruby.stack.max=1024k -cp \"#{jruby_complete}\" org.jruby.Main #{"--debug" if debug_mode?} \"#{bin}\" #{cleaned_args} --no-sub-jruby"
|
16
|
+
command = "java #{java_args} -Xmx500m -Xss1024k -Djruby.memory.max=500m -Djruby.stack.max=1024k -cp \"#{jruby_complete}\" org.jruby.Main #{"--debug" if debug_mode?} \"#{bin}\" #{cleaned_args} --no-sub-jruby --ignore-stdin"
|
21
17
|
puts command
|
22
18
|
exec(command)
|
23
19
|
end
|
data/lib/redcar_quick_start.rb
CHANGED
@@ -8,14 +8,9 @@ module Redcar
|
|
8
8
|
if not $stdin.tty? and not ARGV.include?(DONT_READ_STDIN_ARG)
|
9
9
|
data = ""
|
10
10
|
begin
|
11
|
-
|
12
|
-
data << chunk
|
13
|
-
while chunk
|
14
|
-
chunk = $stdin.read_nonblock(1024)
|
15
|
-
data << chunk
|
16
|
-
end
|
11
|
+
data = $stdin.read
|
17
12
|
rescue Errno::EAGAIN
|
18
|
-
|
13
|
+
# retry
|
19
14
|
rescue EOFError
|
20
15
|
end
|
21
16
|
|
@@ -11,7 +11,7 @@ module SwtHelper
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def active_shell
|
14
|
-
Redcar
|
14
|
+
Redcar.app.focussed_window.controller.shell
|
15
15
|
end
|
16
16
|
|
17
17
|
def dialog(type)
|
@@ -125,6 +125,11 @@ end
|
|
125
125
|
|
126
126
|
After do
|
127
127
|
close_everything
|
128
|
+
errors = Redcar.app.history.select {|command| command.error }
|
129
|
+
if errors.any?
|
130
|
+
raise "Command errors #{errors.inspect}"
|
131
|
+
end
|
132
|
+
Redcar.app.history.clear
|
128
133
|
end
|
129
134
|
|
130
135
|
at_exit {
|
@@ -27,7 +27,7 @@ module Redcar
|
|
27
27
|
# For example:
|
28
28
|
#
|
29
29
|
# >> Application::Dialog.message_box("YO!", :type => :info,
|
30
|
-
# >>
|
30
|
+
# >> :buttons => :yes_no_cancel)
|
31
31
|
# => :yes
|
32
32
|
def self.message_box(text, options={})
|
33
33
|
if buttons = options[:buttons] and !available_message_box_button_combos.include?(buttons)
|
@@ -15,7 +15,6 @@ require "application_swt/html_tab"
|
|
15
15
|
require "application_swt/menu"
|
16
16
|
require "application_swt/menu/binding_translator"
|
17
17
|
require "application_swt/notebook"
|
18
|
-
require "application_swt/notebook/drag_and_drop_listener"
|
19
18
|
require "application_swt/notebook/tab_transfer"
|
20
19
|
require "application_swt/notebook/tab_drag_and_drop_listener"
|
21
20
|
require "application_swt/speedbar"
|
@@ -42,9 +42,11 @@ module Redcar
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def changing(event)
|
45
|
-
|
45
|
+
uri = URI.parse(event.location)
|
46
|
+
if uri.path =~ %r{/controller/([^/]*)}
|
46
47
|
event.doit = false
|
47
|
-
|
48
|
+
params = uri.query ? CGI.parse(uri.query) : nil
|
49
|
+
@html_tab.controller_action($1, params)
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
@@ -69,6 +69,7 @@ module Swt
|
|
69
69
|
import org.eclipse.swt.custom.StackLayout
|
70
70
|
import org.eclipse.swt.custom.ST
|
71
71
|
import org.eclipse.swt.custom.StyledText
|
72
|
+
import org.eclipse.swt.custom.TreeEditor
|
72
73
|
end
|
73
74
|
|
74
75
|
module DND
|
@@ -76,6 +77,7 @@ module Swt
|
|
76
77
|
import org.eclipse.swt.dnd.Clipboard
|
77
78
|
import org.eclipse.swt.dnd.Transfer
|
78
79
|
import org.eclipse.swt.dnd.TextTransfer
|
80
|
+
import org.eclipse.swt.dnd.FileTransfer
|
79
81
|
import org.eclipse.swt.dnd.ByteArrayTransfer
|
80
82
|
|
81
83
|
import org.eclipse.swt.dnd.DropTarget
|
@@ -140,6 +142,8 @@ module JFace
|
|
140
142
|
import org.eclipse.jface.viewers.ILabelProvider
|
141
143
|
import org.eclipse.jface.viewers.ILazyTreeContentProvider
|
142
144
|
import org.eclipse.jface.viewers.ILabelProvider
|
145
|
+
import org.eclipse.jface.viewers.TextCellEditor
|
146
|
+
import org.eclipse.jface.viewers.ViewerDropAdapter
|
143
147
|
end
|
144
148
|
|
145
149
|
module Text
|
data/plugins/core/lib/core.rb
CHANGED
@@ -76,7 +76,7 @@ end
|
|
76
76
|
|
77
77
|
Then /^the tab should have the keyboard focus$/ do
|
78
78
|
tab = get_tab(get_tab_folder)
|
79
|
-
tab.controller.edit_view.
|
79
|
+
tab.controller.edit_view.is_current?.should be_true
|
80
80
|
end
|
81
81
|
|
82
82
|
Then /^I should (not )?see "(.*)" in the edit tab$/ do |bool, content|
|
@@ -140,12 +140,25 @@ module Redcar
|
|
140
140
|
|
141
141
|
# Called by the GUI whenever an EditView is focussed or
|
142
142
|
# loses focus. Sends :focussed_edit_view event.
|
143
|
+
#
|
144
|
+
# Will return nil if the application is not focussed or if
|
145
|
+
# no edit view is focussed.
|
143
146
|
def self.focussed_edit_view=(edit_view)
|
147
|
+
if edit_view
|
148
|
+
@last_focussed_edit_view = edit_view
|
149
|
+
end
|
144
150
|
@focussed_edit_view = edit_view
|
145
151
|
edit_view.check_for_updated_document if edit_view
|
146
152
|
notify_listeners(:focussed_edit_view, edit_view)
|
147
153
|
end
|
148
154
|
|
155
|
+
def self.current
|
156
|
+
tab = Redcar.app.focussed_window.focussed_notebook.focussed_tab
|
157
|
+
if tab.is_a?(Redcar::EditTab)
|
158
|
+
tab.edit_view
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
149
162
|
def self.sensitivities
|
150
163
|
[
|
151
164
|
Sensitivity.new(:edit_tab_focussed, Redcar.app, false, [:tab_focussed]) do |tab|
|