8
8
CJ_CLIENT_WINDOW
9
9
10
10
inherit
11
- EV_TITLED_WINDOW
11
+ ANY
12
12
redefine
13
- initialize ,
13
+ default_create
14
+ end
15
+
16
+ feature {NONE } -- Initialization
17
+
18
+ default_create
19
+ do
14
20
create_interface_objects
21
+ initialize_tools (docking_manager )
22
+ initialize
15
23
end
16
24
25
+ feature -- Access
26
+
27
+ window : EV_TITLED_WINDOW
28
+
29
+ main_box : EV_VERTICAL_BOX
30
+
31
+
17
32
feature {NONE } -- Initialization
18
33
19
34
create_interface_objects
35
+ local
36
+ win : EV_TITLED_WINDOW
37
+ vb : EV_VERTICAL_BOX
38
+ dm : SD_DOCKING_MANAGER
20
39
do
21
- Precursor
22
40
create field_url
23
41
24
42
create button_go .make_with_text (" Go" )
25
43
create button_settings .make_with_text (" ..." )
26
44
27
45
create cj_client_proxy .make (create {CJ_CLIENT }.make (" " ))
28
46
29
- create information_tool .make (cj_client_proxy )
30
- create queries_tool .make (cj_client_proxy )
31
- queries_tool .on_query_actions .extend (agent explore_query )
32
- create template_tool .make (cj_client_proxy )
33
- create formatted_body_tool .make (cj_client_proxy )
34
- create http_response_tool .make (cj_client_proxy )
35
- create header_tool .make (cj_client_proxy )
47
+ create win
48
+ create vb
49
+ win .extend (vb )
50
+ window := win
51
+ main_box := vb
52
+
53
+ create dm .make (vb , window )
54
+ docking_manager := dm
36
55
37
56
cj_client_proxy .context_adaptation_agents .extend (agent updated_context )
38
57
end
39
58
59
+ initialize_tools (dm : SD_DOCKING_MANAGER )
60
+ do
61
+ create information_tool .make (cj_client_proxy , dm )
62
+ create queries_tool .make (cj_client_proxy , dm )
63
+ create template_tool .make (cj_client_proxy , dm )
64
+ create formatted_body_tool .make (cj_client_proxy , dm )
65
+ create http_response_tool .make (cj_client_proxy , dm )
66
+ create header_tool .make (cj_client_proxy , dm )
67
+ queries_tool .on_query_actions .extend (agent explore_query )
68
+ end
69
+
40
70
initialize
41
71
-- Initialize `Current'.
42
72
local
@@ -47,10 +77,7 @@ feature {NONE} -- Initialization
47
77
dm : like docking_manager
48
78
f : RAW_FILE
49
79
do
50
- Precursor
51
- create vb
52
- extend (vb )
53
-
80
+ vb := main_box
54
81
vb .set_border_width (3 )
55
82
56
83
create hb
@@ -69,11 +96,10 @@ feature {NONE} -- Initialization
69
96
vb .extend (hb )
70
97
vb .disable_item_expand (hb )
71
98
72
-
73
- create dm .make (vb , Current )
74
- docking_manager := dm
99
+ dm := docking_manager
75
100
create f .make (" layout.db" )
76
101
dm .close_editor_place_holder
102
+ initialize_tools (dm )
77
103
dm .contents .extend (information_tool .sd_content )
78
104
dm .contents .extend (queries_tool .sd_content )
79
105
dm .contents .extend (template_tool .sd_content )
@@ -97,8 +123,8 @@ feature {NONE} -- Initialization
97
123
information_tool .set_focus
98
124
end
99
125
100
- set_title (" Collection-JSON explorer" )
101
- set_size (800 , 600 )
126
+ window . set_title (" Collection-JSON explorer" )
127
+ window . set_size (800 , 600 )
102
128
103
129
initialize_actions
104
130
@@ -113,11 +139,16 @@ feature {NONE} -- Initialization
113
139
button_go .select_actions .extend (agent on_go )
114
140
button_settings .select_actions .extend (agent on_settings )
115
141
116
- close_request_actions .extend (agent on_quit )
142
+ window . close_request_actions .extend (agent on_quit )
117
143
end
118
144
119
145
feature -- Action
120
146
147
+ show
148
+ do
149
+ window .show
150
+ end
151
+
121
152
on_quit
122
153
do
123
154
if attached docking_manager as dm then
@@ -126,7 +157,7 @@ feature -- Action
126
157
-- .. too bad
127
158
end
128
159
end
129
- destroy_and_exit_if_last
160
+ window . destroy_and_exit_if_last
130
161
end
131
162
132
163
on_go
@@ -185,14 +216,14 @@ feature -- Explore
185
216
last_collection := Void
186
217
if not retried then
187
218
set_field_url_from_location (q .href )
188
- set_pointer_style (stock_pixmaps .Busy_cursor )
219
+ window . set_pointer_style (stock_pixmaps .Busy_cursor )
189
220
if
190
221
attached cj_client_proxy .query (q , Void ) as resp
191
222
then
192
223
set_response (resp )
193
224
end
194
225
end
195
- set_pointer_style (stock_pixmaps .Standard_cursor )
226
+ window . set_pointer_style (stock_pixmaps .Standard_cursor )
196
227
rescue
197
228
retried := True
198
229
retry
@@ -225,7 +256,7 @@ feature -- Explore
225
256
last_collection := Void
226
257
if not retried then
227
258
set_field_url_from_location (a_url )
228
- set_pointer_style (stock_pixmaps .Busy_cursor )
259
+ window . set_pointer_style (stock_pixmaps .Busy_cursor )
229
260
230
261
if
231
262
attached cj_client_proxy .get (a_url , Void ) as resp
@@ -234,7 +265,7 @@ feature -- Explore
234
265
end
235
266
end
236
267
237
- set_pointer_style (stock_pixmaps .Standard_cursor )
268
+ window . set_pointer_style (stock_pixmaps .Standard_cursor )
238
269
rescue
239
270
retried := True
240
271
retry
@@ -613,6 +644,7 @@ feature -- Tools
613
644
formatted_body_tool : CJ_FORMATTED_BODY_TOOL
614
645
615
646
http_response_tool : CJ_HTTP_RESPONSE_TOOL
647
+
616
648
header_tool : CJ_HEADER_TOOL
617
649
618
650
feature -- Widget
@@ -641,7 +673,7 @@ feature -- Widget
641
673
642
674
feature -- UI widgets
643
675
644
- docking_manager : detachable SD_DOCKING_MANAGER
676
+ docking_manager : SD_DOCKING_MANAGER
645
677
646
678
set_template_tab_displayed (b : BOOLEAN )
647
679
do
0 commit comments