/[eiffelstudio]/branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/windows/eb_development_window.e
ViewVC logotype

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/windows/eb_development_window.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 56761 - (show annotations)
Thu Jan 26 23:18:27 2006 UTC (14 years, 1 month ago) by king
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/windows/eb_development_window.e
File size: 126120 byte(s)
Accounted for removal of gray pixmap and tool bar button pixmap hacks
1 indexing
2 description : "Window holding a project tool"
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date : "$Date$"
6 revision : "$Revision$"
7 author : "$Author$"
8
9 class
10 EB_DEVELOPMENT_WINDOW
11
12 inherit
13 EB_TOOL_MANAGER
14 redefine
15 make,
16 init_size_and_position,
17 window_displayed,
18 init_commands,
19 build_menu_bar,
20 build_menus,
21 build_file_menu,
22 build_edit_menu,
23 build_view_menu,
24 build_tools_menu,
25 build_favorites_menu,
26 refresh,
27 recycle,
28 destroy_imp,
29 destroy,
30 position,
31 pos_container
32 end
33
34 EB_FILEABLE
35 export {NONE}
36 set_position,
37 set_pos_container
38 redefine
39 set_stone,
40 reset,
41 stone,
42 on_text_saved,
43 perform_check_before_save,
44 check_passed,
45 update_save_symbol,
46 position,
47 pos_container
48 select
49 set_stone
50 end
51
52 EB_FILEABLE
53 rename
54 set_stone as old_set_stone
55 export {NONE}
56 old_set_stone,
57 set_position,
58 set_pos_container
59 redefine
60 reset,
61 stone,
62 on_text_saved,
63 perform_check_before_save,
64 check_passed,
65 update_save_symbol,
66 position,
67 pos_container
68 end
69
70
71 -- Shared tools & contexts
72
73 SHARED_EIFFEL_PROJECT
74
75 PROJECT_CONTEXT
76
77 EB_SHARED_MANAGERS
78
79 EB_SHARED_GRAPHICAL_COMMANDS
80
81 EB_SHARED_PREFERENCES
82 export
83 {NONE} all
84 end
85
86 EV_STOCK_PIXMAPS
87
88 EB_CONFIRM_SAVE_CALLBACK
89
90 -- Errors
91 EB_GRAPHICAL_ERROR_MANAGER
92
93 TEXT_OBSERVER
94 redefine
95 on_text_reset, on_text_edited,
96 on_text_back_to_its_last_saved_state,
97 on_text_fully_loaded, on_cursor_moved
98 end
99
100 EV_KEY_CONSTANTS
101 export
102 {NONE} All
103 end
104
105 EIFFEL_ENV
106 export
107 {NONE} All
108 end
109
110 SHARED_TEXT_ITEMS
111 export
112 {NONE} All
113 end
114
115 create {EB_WINDOW_MANAGER}
116 make,
117 make_with_session_data,
118 make_as_context_tool,
119 make_as_editor
120
121 feature {NONE} -- Initialization
122
123 make_as_context_tool is
124 -- Create a new development window and expand the context tool.
125 do
126 make
127 -- Perform window setting from `show_actions', as the
128 -- resizing executed as a result only works correctly
129 -- while the window is displayed.
130 window.show_actions.extend (agent set_context_mode)
131 end
132
133 set_context_mode is
134 -- Set `current' into context mode, that is the context tool
135 -- maximized, and the non editor panel is hidden.
136 do
137 if not context_tool.shown then
138 context_tool.show
139 end
140 if not unified_stone then
141 toggle_stone_cmd.execute
142 end
143 context_tool.explorer_bar_item.maximize
144 close_all_bars_except (right_panel)
145 end
146
147 make_as_editor is
148 -- Create a new development window and expand the editor tool.
149 do
150 make
151 -- Perform window setting from `show_actions', as the resizing executed
152 -- must be performed after `current' is displayed.
153 window.show_actions.extend (agent (editor_tool.explorer_bar_item).maximize)
154 window.show_actions.extend (agent close_all_bars_except (right_panel))
155 end
156
157 make_with_session_data (a_session_data: EB_DEVELOPMENT_WINDOW_SESSION_DATA) is
158 -- Recreate a previously existing development window using `a_session_data'.
159 local
160 l_class_i: CLASS_I
161 l_class_c_stone: CLASSC_STONE
162 l_cluster_string, l_class_string, l_feature_string: STRING
163 do
164 internal_development_window_data := a_session_data
165 make
166 -- Attempt to reload last edited class of `Current'.
167 if a_session_data.file_name /= Void then
168 l_class_i := eiffel_universe.class_with_file_name (a_session_data.file_name)
169 if l_class_i /= Void and then l_class_i.compiled then
170 -- Create compiled class stone and target `Current' to it.
171 create l_class_c_stone.make (l_class_i.compiled_class)
172 set_stone_after_check (l_class_c_stone)
173 if a_session_data.editor_position > 0 then
174 editor_tool.text_area.display_line_when_ready (a_session_data.editor_position, False)
175 end
176 end
177 end
178 if context_tool /= Void then
179 -- Presumption is made that if the strings are not void then they represent
180 -- valid entities in the project.
181 l_cluster_string := a_session_data.context_cluster_string
182 l_class_string := a_session_data.context_class_string
183 l_feature_string := a_session_data.context_feature_string
184 if l_feature_string /= Void then
185 context_tool.address_manager.feature_address.set_text (l_feature_string)
186 context_tool.address_manager.class_address.set_text (l_class_string)
187 context_tool.address_manager.execute_with_feature
188 elseif l_class_string /= Void then
189 context_tool.address_manager.class_address.set_text (l_class_string)
190 context_tool.address_manager.execute_with_class
191 elseif l_cluster_string /= Void then
192 context_tool.address_manager.cluster_address.set_text (l_cluster_string)
193 context_tool.address_manager.execute_with_cluster
194 end
195 -- Set the appropriate notebook tab
196 context_tool.notebook.select_item (context_tool.notebook.i_th (a_session_data.context_tab_index))
197 end
198 end
199
200 make is
201 -- Create a new development window.
202 do
203 unified_stone := preferences.development_window_data.context_unified_stone
204 -- Build the history manager, the address manager, ...
205 create history_manager.make (Current)
206 create address_manager.make (Current, False)
207 build_formatters
208 address_manager.set_formatters (managed_main_formatters)
209
210 -- Init commands, build interface, build menus, ...
211 Precursor
212
213 initialized := False -- Reset the flag since initialization is not yet complete.
214 set_up_accelerators
215
216 window.focus_in_actions.extend(agent on_focus)
217
218 -- Create the toolbars.
219 build_toolbars_area
220 container.put_front (toolbars_area)
221 container.disable_item_expand (toolbars_area)
222
223 -- Update widgets visibilities
224 window.show_actions.extend (agent update)
225 status_bar.remove_cursor_position
226 address_manager.set_output_line (status_bar.label)
227
228 -- Finish initializing the main editor formatters
229 end_build_formatters
230
231 address_manager.disable_formatters
232 if Eiffel_project.manager.is_project_loaded then
233 on_project_created
234 on_project_loaded
235 elseif Eiffel_project.manager.is_created then
236 on_project_unloaded
237 on_project_created
238 else
239 on_project_unloaded
240 end
241
242 -- Create feature position table
243 create feature_positions.make (1)
244 feature_positions.compare_objects
245
246 window.move_actions.force_extend (agent window_moved)
247
248 initialized := True
249 is_destroying := False
250 end
251
252 init_size_and_position is
253 -- Initialize window size.
254 local
255 screen: EB_STUDIO_SCREEN
256 l_x, l_y: INTEGER
257 do
258 create screen
259 window.set_size (
260 development_window_data.width.min (screen.width),
261 development_window_data.height.min (screen.height))
262 l_x := development_window_data.x_position
263 if l_x < screen.virtual_left or l_x > screen.virtual_right then
264 -- Somehow screens have changed, reset it to 0
265 l_x := 0
266 end
267 l_y := development_window_data.y_position
268 if l_y < screen.virtual_top or l_y > screen.virtual_bottom then
269 -- Somehow screens have changed, reset it to 0
270 l_y := 0
271 end
272 window.set_position (l_x, l_y)
273 end
274
275 window_displayed is
276 -- `Current' has been displayed on screen.
277 do
278 -- Minimize or Maximize window if needed.
279 if development_window_data.is_maximized then
280 window.maximize
281 elseif development_window_data.is_minimized then
282 window.minimize
283 end
284 end
285
286 init_commands is
287 -- Initialize commands.
288 local
289 accel: EV_ACCELERATOR
290 do
291 Precursor
292 create toolbarable_commands.make (15)
293
294 -- Open, save, ...
295 toolbarable_commands.extend (new_editor_cmd)
296
297 toolbarable_commands.extend (new_context_tool_cmd)
298
299 create open_cmd.make (Current)
300 toolbarable_commands.extend (open_cmd)
301
302 create save_cmd.make (Current)
303 toolbarable_commands.extend (save_cmd)
304
305 create save_as_cmd.make (Current)
306 if editor_tool = Void or else editor_tool.text_area.is_empty then
307 save_as_cmd.disable_sensitive
308 else
309 save_as_cmd.enable_sensitive
310 end
311
312 create shell_cmd.make (Current)
313 toolbarable_commands.extend (shell_cmd)
314
315 create print_cmd.make (Current)
316 if is_empty then
317 print_cmd.disable_sensitive
318 else
319 print_cmd.enable_sensitive
320 end
321 toolbarable_commands.extend (print_cmd)
322
323 -- Compilation
324 create c_workbench_compilation_cmd.make_workbench (Current)
325 create c_finalized_compilation_cmd.make_finalized (Current)
326 if has_dll_generation then
327 create show_dynamic_lib_tool.make
328 show_dynamic_lib_tool.set_menu_name (Interface_names.m_new_dynamic_lib)
329 show_dynamic_lib_tool.add_agent (agent show_dynamic_library_dialog)
330 end
331 if has_profiler then
332 create show_profiler
333 end
334
335 -- Undo/redo, cut, copy, paste.
336 create undo_cmd.make (Current)
337 toolbarable_commands.extend (undo_cmd)
338
339 create redo_cmd.make (Current)
340 toolbarable_commands.extend (redo_cmd)
341
342 create editor_paste_cmd.make (Current)
343 toolbarable_commands.extend (editor_paste_cmd)
344
345 create new_cluster_cmd.make (Current)
346 toolbarable_commands.extend (new_cluster_cmd)
347
348 create new_class_cmd.make (Current)
349 toolbarable_commands.extend (new_class_cmd)
350
351 create delete_class_cluster_cmd.make (Current)
352 toolbarable_commands.extend (delete_class_cluster_cmd)
353
354 create new_feature_cmd.make (Current)
355 toolbarable_commands.extend (new_feature_cmd)
356
357 create toggle_feature_alias_cmd.make (Current)
358 toolbarable_commands.extend (toggle_feature_alias_cmd)
359
360 create toggle_feature_signature_cmd.make (Current)
361 toolbarable_commands.extend (toggle_feature_signature_cmd)
362
363 create toggle_feature_assigner_cmd.make (Current)
364 toolbarable_commands.extend (toggle_feature_assigner_cmd)
365
366 create toggle_stone_cmd.make (Current)
367 toolbarable_commands.extend (toggle_stone_cmd)
368
369 create send_stone_to_context_cmd.make
370 send_stone_to_context_cmd.set_pixmap (Pixmaps.Icon_send_stone_down)
371 send_stone_to_context_cmd.set_tooltip (Interface_names.e_send_stone_to_context)
372 send_stone_to_context_cmd.set_menu_name (Interface_names.m_send_stone_to_context)
373 send_stone_to_context_cmd.set_name ("Send_to_context")
374 send_stone_to_context_cmd.set_tooltext (Interface_names.b_send_stone_to_context)
375 send_stone_to_context_cmd.add_agent (agent send_stone_to_context)
376 create accel.make_with_key_combination (
377 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.Key_down), False, True, False
378 )
379 accel.actions.extend (agent send_stone_to_context)
380 send_stone_to_context_cmd.set_accelerator (accel)
381 send_stone_to_context_cmd.disable_sensitive
382 toolbarable_commands.extend (send_stone_to_context_cmd)
383
384 toolbarable_commands.extend (window_manager.minimize_all_cmd)
385 window_manager.minimize_all_cmd.enable_sensitive
386 toolbarable_commands.extend (window_manager.raise_all_cmd)
387 window_manager.raise_all_cmd.enable_sensitive
388
389 toolbarable_commands.extend (New_development_window_cmd)
390 -- Show tool/toolbar commands (will be filled when tools will
391 -- be created)
392 create show_tool_commands.make (7)
393 create show_toolbar_commands.make (3)
394
395 new_feature_cmd.disable_sensitive
396 toggle_feature_alias_cmd.disable_sensitive
397 toggle_feature_signature_cmd.disable_sensitive
398 toggle_feature_assigner_cmd.disable_sensitive
399
400 create editors.make (5)
401 estudio_debug_cmd.set_main_window (window)
402 end
403
404 set_up_accelerators is
405 -- Fill the accelerator of `window' with the accelerators of the `toolbarable_commands'.
406 local
407 cmds: ARRAYED_LIST [EB_TOOLBARABLE_COMMAND]
408 do
409 --| Accelerators related to toolbarable_commands
410 from
411 cmds := toolbarable_commands
412 cmds.start
413 until
414 cmds.after
415 loop
416 if cmds.item.accelerator /= Void then
417 window.accelerators.extend (cmds.item.accelerator)
418 end
419 cmds.forth
420 end
421
422 --| Accelerators related to debugging toolbarable_commands
423 from
424 cmds := Eb_debugger_manager.toolbarable_commands
425 cmds.start
426 until
427 cmds.after
428 loop
429 if
430 cmds.item.accelerator /= Void
431 then
432 window.accelerators.extend (cmds.item.accelerator)
433 end
434 cmds.forth
435 end
436 end
437
438 build_formatters is
439 -- Build all formatters used.
440 local
441 form: EB_CLASS_TEXT_FORMATTER
442 accel: EV_ACCELERATOR
443 do
444 create managed_class_formatters.make (17)
445 managed_class_formatters.extend (create {EB_CLICKABLE_FORMATTER}.make (Current))
446 managed_class_formatters.extend (create {EB_FLAT_FORMATTER}.make (Current))
447 managed_class_formatters.extend (create {EB_SHORT_FORMATTER}.make (Current))
448 managed_class_formatters.extend (create {EB_FLAT_SHORT_FORMATTER}.make (Current))
449 managed_class_formatters.extend (Void)
450 managed_class_formatters.extend (create {EB_ANCESTORS_FORMATTER}.make (Current))
451 managed_class_formatters.extend (create {EB_DESCENDANTS_FORMATTER}.make (Current))
452 managed_class_formatters.extend (create {EB_CLIENTS_FORMATTER}.make (Current))
453 managed_class_formatters.extend (create {EB_SUPPLIERS_FORMATTER}.make (Current))
454 managed_class_formatters.extend (Void)
455 managed_class_formatters.extend (create {EB_ATTRIBUTES_FORMATTER}.make (Current))
456 managed_class_formatters.extend (create {EB_ROUTINES_FORMATTER}.make (Current))
457 managed_class_formatters.extend (create {EB_INVARIANTS_FORMATTER}.make (Current))
458 managed_class_formatters.extend (create {EB_CREATORS_FORMATTER}.make (Current))
459 managed_class_formatters.extend (create {EB_DEFERREDS_FORMATTER}.make (Current))
460 managed_class_formatters.extend (create {EB_ONCES_FORMATTER}.make (Current))
461 managed_class_formatters.extend (create {EB_EXTERNALS_FORMATTER}.make (Current))
462 managed_class_formatters.extend (create {EB_EXPORTED_FORMATTER}.make (Current))
463
464 create managed_feature_formatters.make (12)
465 managed_feature_formatters.extend (create {EB_BASIC_FEATURE_FORMATTER}.make (Current))
466 managed_feature_formatters.extend (create {EB_ROUTINE_FLAT_FORMATTER}.make (Current))
467 managed_feature_formatters.extend (Void)
468 managed_feature_formatters.extend (create {EB_CALLERS_FORMATTER}.make (Current, 0))
469 managed_feature_formatters.extend (create {EB_CALLERS_FORMATTER}.make (Current,
470 {DEPEND_UNIT}.is_in_assignment_flag))
471 managed_feature_formatters.extend (create {EB_CALLERS_FORMATTER}.make (Current,
472 {DEPEND_UNIT}.is_in_creation_flag))
473 managed_feature_formatters.extend (Void)
474 managed_feature_formatters.extend (create {EB_IMPLEMENTERS_FORMATTER}.make (Current))
475 managed_feature_formatters.extend (create {EB_ROUTINE_ANCESTORS_FORMATTER}.make (Current))
476 managed_feature_formatters.extend (create {EB_ROUTINE_DESCENDANTS_FORMATTER}.make (Current))
477 managed_feature_formatters.extend (Void)
478 managed_feature_formatters.extend (create {EB_HOMONYMS_FORMATTER}.make (Current))
479
480
481 create managed_main_formatters.make (6)
482
483 create {EB_BASIC_TEXT_FORMATTER} form.make (Current)
484 create accel.make_with_key_combination (
485 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.Key_t),
486 True, False, True)
487 accel.actions.extend (agent form.execute)
488 form.set_accelerator (accel)
489 managed_main_formatters.extend (form)
490
491 create {EB_CLICKABLE_FORMATTER} form.make (Current)
492 create accel.make_with_key_combination (
493 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.Key_c),
494 True, False, True)
495 accel.actions.extend (agent form.execute)
496 form.set_accelerator (accel)
497 managed_main_formatters.extend (form)
498
499 create {EB_FLAT_FORMATTER} form.make (Current)
500 create accel.make_with_key_combination (
501 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.Key_f),
502 True, False, True)
503 accel.actions.extend (agent form.execute)
504 form.set_accelerator (accel)
505 managed_main_formatters.extend (form)
506
507 create {EB_SHORT_FORMATTER} form.make (Current)
508 create accel.make_with_key_combination (
509 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.Key_o),
510 True, False, True)
511 accel.actions.extend (agent form.execute)
512 form.set_accelerator (accel)
513 managed_main_formatters.extend (form)
514
515 create {EB_FLAT_SHORT_FORMATTER} form.make (Current)
516 create accel.make_with_key_combination (
517 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.Key_i),
518 True, False, True)
519 accel.actions.extend (agent form.execute)
520 form.set_accelerator (accel)
521 managed_main_formatters.extend (form)
522 end
523
524 end_build_formatters is
525 -- Finish initialization of formatters (associate them with editor
526 -- and select a formatter).
527 local
528 f_ind: INTEGER
529 do
530 from
531 managed_class_formatters.start
532 until
533 managed_class_formatters.after
534 loop
535 if managed_class_formatters.item /= Void then
536 managed_class_formatters.item.set_manager (context_tool)
537 end
538 managed_class_formatters.forth
539 end
540 from
541 managed_feature_formatters.start
542 until
543 managed_feature_formatters.after
544 loop
545 if managed_feature_formatters.item /= Void then
546 managed_feature_formatters.item.set_manager (context_tool)
547 end
548 managed_feature_formatters.forth
549 end
550 from
551 managed_main_formatters.start
552 until
553 managed_main_formatters.after
554 loop
555 managed_main_formatters.item.set_editor (editor_tool.text_area)
556 managed_main_formatters.item.on_shown
557 if managed_main_formatters.item.accelerator /= Void then
558 window.accelerators.extend (managed_main_formatters.item.accelerator)
559 end
560 managed_main_formatters.forth
561 end
562
563 (managed_main_formatters @ 1).enable_select;
564
565 -- We now select the correct class formatter.
566 f_ind := preferences.context_tool_data.default_class_formatter_index
567 --| This takes the formatter separators in consideration.
568 if f_ind > 4 then
569 f_ind := f_ind + 1
570 end
571 if f_ind > 8 then
572 f_ind := f_ind + 1
573 end
574 if f_ind < 1 or f_ind > managed_class_formatters.count then
575 f_ind := 6
576 end
577 (managed_class_formatters @ f_ind).enable_select;
578 -- We now select the correct feature formatter.
579 f_ind := preferences.context_tool_data.default_feature_formatter_index
580 if f_ind > 2 then
581 f_ind := f_ind + 1
582 end
583 if f_ind < 1 or f_ind > managed_feature_formatters.count then
584 f_ind := 2
585 end
586 managed_class_formatters.i_th (f_ind).enable_select
587 end
588
589 build_tools is
590 -- Build all tools that can take place in this window and put them
591 -- in `left_tools' or `bottom_tools'.
592 local
593 show_cmd: EB_SHOW_TOOL_COMMAND
594 l_accel: EV_ACCELERATOR
595 l_shortcut_preference: SHORTCUT_PREFERENCE
596 do
597 lock_update
598 -- Build the features tool
599 create features_tool.make (Current)
600 features_tool.attach_to_explorer_bar (left_panel)
601 left_tools.extend (features_tool.explorer_bar_item)
602 create show_cmd.make (Current, features_tool.explorer_bar_item)
603 show_tool_commands.extend (show_cmd)
604 toolbarable_commands.extend (show_cmd)
605 add_recyclable (features_tool)
606
607 -- Build the breakpoints tool
608 create breakpoints_tool.make (Current)
609 breakpoints_tool.attach_to_explorer_bar (left_panel)
610 left_tools.extend (breakpoints_tool.explorer_bar_item)
611 create show_cmd.make (Current, breakpoints_tool.explorer_bar_item)
612 show_tool_commands.extend (show_cmd)
613 toolbarable_commands.extend (show_cmd)
614 add_recyclable (breakpoints_tool)
615
616 -- Build the cluster tool
617 create cluster_tool.make (Current, Current)
618 cluster_tool.attach_to_explorer_bar (left_panel)
619 left_tools.extend (cluster_tool.explorer_bar_item)
620 create show_cmd.make (Current, cluster_tool.explorer_bar_item)
621 show_tool_commands.extend (show_cmd)
622 toolbarable_commands.extend (show_cmd)
623 add_recyclable (cluster_tool)
624
625 -- Build the favorites tool
626 create favorites_tool.make (Current, favorites_manager)
627 favorites_tool.attach_to_explorer_bar (left_panel)
628 left_tools.extend (favorites_tool.explorer_bar_item)
629 create show_cmd.make (Current, favorites_tool.explorer_bar_item)
630 show_tool_commands.extend (show_cmd)
631 toolbarable_commands.extend (show_cmd)
632 add_recyclable (favorites_tool)
633
634 -- Build the windows tool (formerly known as Selector tool)
635 create windows_tool.make (Current)
636 windows_tool.attach_to_explorer_bar (left_panel)
637 left_tools.extend (windows_tool.explorer_bar_item)
638 create show_cmd.make (Current, windows_tool.explorer_bar_item)
639 show_tool_commands.extend (show_cmd)
640 toolbarable_commands.extend (show_cmd)
641 add_recyclable (windows_tool)
642
643 -- Build the search tool
644 create search_tool.make (Current)
645 search_tool.attach_to_explorer_bar (right_panel)
646 bottom_tools.extend (search_tool.explorer_bar_item)
647 create show_cmd.make (Current, search_tool.explorer_bar_item)
648 l_shortcut_preference := preferences.editor_data.shortcuts.item ("show_search_panel")
649 create l_accel.make_with_key_combination (l_shortcut_preference.key, l_shortcut_preference.is_ctrl, l_shortcut_preference.is_alt, l_shortcut_preference.is_shift)
650 l_accel.actions.extend (agent search_tool.prepare_search)
651 show_cmd.set_accelerator (l_accel)
652 show_tool_commands.extend (show_cmd)
653 toolbarable_commands.extend (show_cmd)
654 add_recyclable (search_tool)
655
656 -- Build the editor tool
657 create editor_tool.make (Current)
658 editor_tool.attach_to_explorer_bar (right_panel)
659 bottom_tools.extend (editor_tool.explorer_bar_item)
660 editor_tool.text_area.add_edition_observer(save_cmd)
661 editor_tool.text_area.add_edition_observer(save_as_cmd)
662 editor_tool.text_area.add_edition_observer(print_cmd)
663 editor_tool.text_area.add_edition_observer(Current)
664 editor_tool.text_area.add_edition_observer(search_tool)
665 editor_tool.text_area.drop_actions.set_veto_pebble_function (agent can_drop)
666 editor_tool.text_area.add_cursor_observer (Current)
667 create show_cmd.make(Current, editor_tool.explorer_bar_item)
668 show_tool_commands.extend (show_cmd)
669 toolbarable_commands.extend (show_cmd)
670
671 -- The minimim height masks a bug on windows to do with the sizing of the editors
672 -- scroll bars, which were affecting the resizing although they should not have done so.
673 -- Having a default minimum height on the editor is perfectly reasonable.
674 editor_tool.widget.set_minimum_height (20)
675 add_recyclable (editor_tool)
676
677 -- Build the context tool
678 create context_tool.make (Current)
679 context_tool.attach_to_explorer_bar (right_panel)
680 bottom_tools.extend (context_tool.explorer_bar_item)
681 create show_cmd.make (Current, context_tool.explorer_bar_item)
682 show_tool_commands.extend (show_cmd)
683 toolbarable_commands.extend (show_cmd)
684 add_recyclable (context_tool)
685
686 -- Set the flag "Tools initialized"
687 tools_initialized := True
688
689 -- Initialize undo / redo accelerators
690 create undo_accelerator.make_with_key_combination (
691 create {EV_KEY}.make_with_code (Key_z), True, False, False)
692 if has_case then
693 undo_accelerator.actions.extend (agent (context_tool.editor.undo_cmd).on_ctrl_z)
694 end
695 undo_accelerator.actions.extend (agent undo_cmd.accelerator_execute)
696 create redo_accelerator.make_with_key_combination (
697 create {EV_KEY}.make_with_code (Key_y), True, False, False)
698 if has_case then
699 redo_accelerator.actions.extend (agent (context_tool.editor.redo_cmd).on_ctrl_y)
700 end
701 redo_accelerator.actions.extend (agent redo_cmd.accelerator_execute)
702 window.accelerators.extend (undo_accelerator)
703 window.accelerators.extend (redo_accelerator)
704 unlock_update
705 end
706
707 feature -- Access
708
709 cluster: CLUSTER_I is
710 -- Cluster for current class. Void if none.
711 local
712 classi_stone: CLASSI_STONE
713 cluster_stone: CLUSTER_STONE
714 do
715 classi_stone ?= stone
716 if classi_stone /= Void then
717 Result := classi_stone.cluster
718 end
719 cluster_stone ?= stone
720 if cluster_stone /= Void then
721 Result := cluster_stone.cluster_i
722 end
723 end
724
725 class_name: STRING is
726 -- Name of the current class, Void if none.
727 local
728 class_stone: CLASSI_STONE
729 do
730 class_stone ?= stone
731 if class_stone /= Void then
732 Result := class_stone.class_name
733 end
734 end
735
736 feature_name: STRING is
737 -- Name of the current feature, Void if none.
738 local
739 feature_stone: FEATURE_STONE
740 do
741 feature_stone ?= stone
742 if feature_stone /= Void then
743 Result := feature_stone.feature_name
744 end
745 end
746
747 feature -- Status setting
748
749 disable_sensitive is
750 -- Disable sensitivity of all widgets.
751 do
752 window.disable_sensitive
753 end
754
755 enable_sensitive is
756 -- Enable sensitivity of all widgets.
757 do
758 window.enable_sensitive
759 end
760
761 feature -- Window Settings
762
763 set_initialized is
764 -- Set `initialized' to True.
765 do
766 initialized := True
767 end
768
769 set_text (a_text: STRING) is
770 -- Assign `a_text' to `text'.
771 require
772 a_text_not_void: a_text /= Void
773 do
774 editor_tool.text_area.set_editor_text (a_text)
775 ensure
776 --| FIXME This needs to work: text_assigned: text.is_equal (a_text)
777 --| FIXME changed_flag_set: changed
778 end
779
780 feature -- Window Properties
781
782 changed: BOOLEAN is
783 -- Has something been changed and not yet been saved?
784 do
785 Result := editor_tool.changed
786 end
787
788 is_empty: BOOLEAN is
789 -- Does `Current's text is empty?
790 do
791 Result := editor_tool = Void or else editor_tool.text_area.is_empty
792 end
793
794 text: STRING is
795 -- Text representing Current
796 do
797 Result := editor_tool.text_area.text
798 end
799
800 pixmap: EV_PIXMAP is
801 -- Pixmap representing Current window.
802 do
803 Result := Pixmaps.Icon_development_window
804 end
805
806 feature -- Pulldown Menus
807
808 metric_menu: EV_MENU
809 -- Menu for entries of metric tool.
810
811 format_menu: EV_MENU
812 -- ID Menu for formats.
813 -- Only used during debugging
814
815 compile_menu: EV_MENU
816 -- Compile ID menu.
817
818 debug_menu: EV_MENU
819 -- Debug ID menu.
820
821 debugging_tools_menu: EV_MENU
822 -- Debugging tools menu item
823
824 active_menus (erase: BOOLEAN) is
825 -- Enable all the menus and if `erase' clean
826 -- the content of the Project tool.
827 do
828 compile_menu.enable_sensitive
829 if erase then
830 output_manager.clear
831 end
832 end
833
834 disable_menus is
835 -- Disable all the menus.
836 do
837 compile_menu.disable_sensitive
838 end
839
840 update_debug_menu is
841 -- Update debug menu
842 do
843 Eb_debugger_manager.update_debugging_tools_menu_from (Current)
844 end
845
846 feature -- Modifiable menus
847
848 melt_menu_item: EV_MENU_ITEM
849 -- Melt menu entry
850
851 freeze_menu_item: EV_MENU_ITEM
852 -- Freeze menu entry
853
854 finalize_menu_item: EV_MENU_ITEM
855 -- Finalize menu entry
856
857 feature -- Update
858
859 synchronize is
860 -- Synchronize stones.
861 local
862 st: STONE
863 do
864 during_synchronization := True
865 favorites_manager.refresh
866 context_tool.synchronize
867 cluster_tool.synchronize
868 history_manager.synchronize
869 features_tool.synchronize
870 breakpoints_tool.synchronize
871 -- Update main views
872 managed_main_formatters.i_th (2).invalidate
873 managed_main_formatters.i_th (3).invalidate
874 managed_main_formatters.i_th (4).invalidate
875 managed_main_formatters.i_th (5).invalidate
876 if stone /= Void then
877 st := stone.synchronized_stone
878 end
879 editor_tool.text_area.update_click_list (False)
880 set_stone (st)
881 update_save_symbol
882 address_manager.refresh
883 during_synchronization := False
884 end
885
886 synchronize_routine_tool_to_default is
887 -- Synchronize the editor tool to the debug format.
888 do
889 --| FIXME ARNAUD: To be implemented
890 end
891
892 clear_object_tool is
893 -- Clear the contents of the object tool if shown.
894 do
895 --| FIXME ARNAUD: To be implemented
896 end
897
898 build_menus is
899 -- Build all menus displayed in the development window.
900 do
901 -- Build each menu
902 build_file_menu
903 build_edit_menu
904 build_view_menu
905 build_favorites_menu
906 build_project_menu
907 build_debug_menu
908 build_tools_menu
909 build_window_menu
910 build_help_menu
911 -- Build the menu bar.
912 build_menu_bar
913 end
914
915 build_debug_menu is
916 -- Build the `Debug' menu through the debugger_manager.
917 local
918 conv_mit: EB_COMMAND_MENU_ITEM
919 do
920 debug_menu := Eb_debugger_manager.new_debug_menu
921 from
922 debug_menu.start
923 until
924 debug_menu.after
925 loop
926 conv_mit ?= debug_menu.item
927 if conv_mit /= Void then
928 add_recyclable (conv_mit)
929 end
930 debug_menu.forth
931 end
932 --| Debugging tools menu
933 debugging_tools_menu := Eb_debugger_manager.new_debugging_tools_menu
934 debug_menu.extend (create {EV_MENU_SEPARATOR})
935 debug_menu.extend (debugging_tools_menu)
936 update_debug_menu
937 end
938
939 build_menu_bar is
940 -- Build the menu bar
941 local
942 mb: EV_MENU_BAR
943 do
944 check
945 window.menu_bar /= Void implies not window.menu_bar.is_empty
946 -- If a menu bar was already present, it shouldn't be empty.
947 end
948 if window.menu_bar /= Void then
949 mb := window.menu_bar
950 from
951 mb.start
952 mb.forth
953 until
954 mb.after
955 loop
956 mb.remove
957 end
958 else
959 create mb
960 window.set_menu_bar (mb)
961 mb.extend (file_menu)
962 end
963
964 if Eiffel_project.manager.is_created then
965 mb.extend (edit_menu)
966 mb.extend (view_menu)
967 mb.extend (favorites_menu)
968 mb.extend (project_menu)
969 mb.extend (debug_menu)
970 else
971 mb.extend (view_menu)
972 end
973 mb.extend (tools_menu)
974 mb.extend (window_menu)
975 mb.extend (help_menu)
976 estudio_debug_cmd.build_menu_bar
977 end
978
979 feature -- Graphical Interface
980
981 build_general_toolbar is
982 -- Set up the general toolbar (New, Save, Search, Shell, Undo, Redo, ...)
983 local
984 cell: EV_CELL
985 hsep: EV_HORIZONTAL_SEPARATOR
986 hbox: EV_HORIZONTAL_BOX
987 do
988 -- Create the toolbar.
989 create general_toolbar
990 general_customizable_toolbar := development_window_data.retrieve_general_toolbar (toolbarable_commands)
991 if development_window_data.show_text_in_general_toolbar then
992 general_customizable_toolbar.enable_important_text
993 elseif development_window_data.show_all_text_in_general_toolbar then
994 general_customizable_toolbar.enable_text_displayed
995 end
996
997 create hbox
998 hbox.extend (general_customizable_toolbar.widget)
999 hbox.disable_item_expand (general_customizable_toolbar.widget)
1000
1001 -- Generate the toolbar.
1002 general_customizable_toolbar.update_toolbar
1003
1004 -- Cell to fill in empty space and receive the right click menu holder.
1005 create cell
1006 cell.pointer_button_release_actions.extend (agent toolbar_right_click_action)
1007 hbox.extend (cell)
1008
1009 -- Create the vertical layout (separator + toolbar)
1010 create hsep
1011 general_toolbar.set_padding (2)
1012 general_toolbar.extend (hsep)
1013 general_toolbar.disable_item_expand (hsep)
1014 general_toolbar.extend (hbox)
1015
1016 -- Create the command to show/hide this toolbar.
1017 create show_general_toolbar_command.make (general_toolbar, Interface_names.m_general_toolbar)
1018 show_toolbar_commands.extend (show_general_toolbar_command)
1019 if development_window_data.show_general_toolbar then
1020 show_general_toolbar_command.enable_visible
1021 else
1022 show_general_toolbar_command.disable_visible
1023 end
1024
1025 end
1026
1027 build_address_toolbar is
1028 -- Set up the address toolbar (Back, Forward, Current, Class name, feature name, ...)
1029 local
1030 tb: EV_TOOL_BAR
1031 -- address_bar: EV_HORIZONTAL_BOX -- Contains "Class" + Combobox + "Feature" + Combobox + "Format" + Combobox
1032 hsep: EV_HORIZONTAL_SEPARATOR
1033 hbox: EV_HORIZONTAL_BOX -- Contains HistoryToolbar (back, forth, current) + `address_bar'
1034 cell: EV_CELL
1035 accel: EV_ACCELERATOR
1036 do
1037 -- Create the toolbar
1038 create address_toolbar
1039 create hsep
1040 create hbox
1041 -- create address_bar
1042 create tb
1043 address_toolbar.set_padding (2)
1044 address_toolbar.extend (hsep)
1045 address_toolbar.disable_item_expand (hsep)
1046 address_toolbar.extend (hbox)
1047
1048 hbox.extend (tb)
1049 hbox.disable_item_expand (tb)
1050 -- hbox.extend (address_bar)
1051 -- hbox.disable_item_expand (address_bar)
1052
1053 -- Back icon
1054 tb.extend (history_manager.back_command.new_toolbar_item (False))
1055
1056 -- Forward icon
1057 tb.extend (history_manager.forth_command.new_toolbar_item (False))
1058
1059 -- Set up the accelerators.
1060 create accel.make_with_key_combination (
1061 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.Key_right), False, True, False
1062 )
1063 accel.actions.extend (agent on_forth)
1064 window.accelerators.extend (accel)
1065
1066 create accel.make_with_key_combination (
1067 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.Key_left), False, True, False
1068 )
1069 accel.actions.extend (agent on_back)
1070 window.accelerators.extend (accel)
1071
1072 ------------------------------------------
1073 -- Address bar (Class name & feature name)
1074 ------------------------------------------
1075 hbox.extend (address_manager.widget)
1076 -- editor_tool.text_area.add_cursor_observer (address_manager)
1077
1078 -- Create the command to show/hide this toolbar.
1079 create show_address_toolbar_command.make (address_toolbar, Interface_names.m_address_toolbar)
1080 show_toolbar_commands.extend (show_address_toolbar_command)
1081
1082 if development_window_data.show_address_toolbar then
1083 show_address_toolbar_command.enable_visible
1084 else
1085 show_address_toolbar_command.disable_visible
1086 end
1087
1088 -- Cell to fill in empty space and receive the right click menu holder.
1089 create cell
1090 cell.pointer_button_release_actions.extend (agent toolbar_right_click_action)
1091 hbox.extend (cell)
1092 end
1093
1094 build_project_toolbar is
1095 -- Build toolbar corresponding to the project options bar
1096 local
1097 cell: EV_CELL
1098 hsep: EV_HORIZONTAL_SEPARATOR
1099 hbox: EV_HORIZONTAL_BOX
1100 do
1101 create project_toolbar
1102 create hsep
1103 project_toolbar.extend (hsep)
1104 project_toolbar.disable_item_expand (hsep)
1105
1106 -- Generate the toolbar.
1107 create hbox
1108 project_customizable_toolbar := Eb_debugger_manager.new_toolbar
1109 hbox.extend (project_customizable_toolbar.widget)
1110 hbox.disable_item_expand (project_customizable_toolbar.widget)
1111
1112 project_customizable_toolbar.update_toolbar
1113
1114 -- Create the command to show/hide this toolbar.
1115 create show_project_toolbar_command.make (project_toolbar, Interface_names.m_project_toolbar)
1116 show_toolbar_commands.extend (show_project_toolbar_command)
1117 if development_window_data.show_project_toolbar then
1118 show_project_toolbar_command.enable_visible
1119 else
1120 show_project_toolbar_command.disable_visible
1121 end
1122
1123 -- Cell to fill in empty space and receive the right click menu holder.
1124 create cell
1125 cell.pointer_button_release_actions.extend (agent toolbar_right_click_action)
1126 hbox.extend (cell)
1127 project_toolbar.extend (hbox)
1128 end
1129
1130 feature {NONE} -- Menu Building
1131
1132 build_file_menu is
1133 -- Build the file menu.
1134 local
1135 new_project_cmd: EB_NEW_PROJECT_COMMAND
1136 open_project_cmd: EB_OPEN_PROJECT_COMMAND
1137 send_to_menu: EV_MENU
1138 menu_item: EV_MENU_ITEM
1139 command_menu_item: EB_COMMAND_MENU_ITEM
1140 do
1141 create file_menu.make_with_text (Interface_names.m_file)
1142
1143 -- New
1144 command_menu_item := New_development_window_cmd.new_menu_item
1145 add_recyclable (command_menu_item)
1146 file_menu.extend (command_menu_item)
1147
1148 -- New editor
1149 command_menu_item := New_editor_cmd.new_menu_item
1150 add_recyclable (command_menu_item)
1151 file_menu.extend (command_menu_item)
1152
1153 -- New context tool
1154 command_menu_item := New_context_tool_cmd.new_menu_item
1155 add_recyclable (command_menu_item)
1156 file_menu.extend (command_menu_item)
1157
1158 -- Open
1159 command_menu_item := open_cmd.new_menu_item
1160 add_recyclable (command_menu_item)
1161 file_menu.extend (command_menu_item)
1162
1163 -- Close
1164 create menu_item.make_with_text (Interface_names.m_close)
1165 menu_item.select_actions.extend (agent destroy)
1166 file_menu.extend (menu_item)
1167
1168 -- Separator --------------------------------------
1169 file_menu.extend (create {EV_MENU_SEPARATOR})
1170
1171 -- Save
1172 command_menu_item := save_cmd.new_menu_item
1173 add_recyclable (command_menu_item)
1174 file_menu.extend (command_menu_item)
1175
1176 -- Save as
1177 command_menu_item := save_as_cmd.new_menu_item
1178 add_recyclable (command_menu_item)
1179 file_menu.extend (command_menu_item)
1180
1181 -- Sent to
1182 create send_to_menu.make_with_text (Interface_names.m_send_to)
1183 -- External editor
1184 command_menu_item := shell_cmd.new_menu_item
1185 add_recyclable (command_menu_item)
1186 send_to_menu.extend (command_menu_item)
1187 file_menu.extend (send_to_menu)
1188
1189 -- Separator --------------------------------------
1190 file_menu.extend (create {EV_MENU_SEPARATOR})
1191 command_menu_item := print_cmd.new_menu_item
1192 add_recyclable (command_menu_item)
1193 file_menu.extend (command_menu_item)
1194
1195 -- Separator --------------------------------------
1196 file_menu.extend (create {EV_MENU_SEPARATOR})
1197
1198 -- New Project
1199 create new_project_cmd.make_with_parent (window)
1200 create menu_item.make_with_text (Interface_names.m_new_project)
1201 menu_item.select_actions.extend (agent new_project_cmd.execute)
1202 file_menu.extend (menu_item)
1203
1204 -- Open Project
1205 create open_project_cmd.make_with_parent (window)
1206 create menu_item.make_with_text (Interface_names.m_open_project)
1207 menu_item.select_actions.extend (agent open_project_cmd.execute)
1208 file_menu.extend (menu_item)
1209
1210 -- Recent Projects
1211 recent_projects_menu := recent_projects_manager.new_menu
1212 add_recyclable (recent_projects_menu)
1213 file_menu.extend (recent_projects_menu)
1214
1215 -- Separator --------------------------------------
1216 file_menu.extend (create {EV_MENU_SEPARATOR})
1217
1218 -- Exit
1219 command_menu_item := Exit_application_cmd.new_menu_item
1220 add_recyclable (Command_menu_item)
1221 file_menu.extend (command_menu_item)
1222 end
1223
1224 build_class_info_menu: EV_MENU is
1225 -- Build the class format sub-menu.
1226 local
1227 form: EB_CLASS_INFO_FORMATTER
1228 empty_menu: EV_MENU_ITEM
1229 i: INTEGER
1230 do
1231 create Result.make_with_text (Interface_names.m_class_info)
1232 i := 1
1233
1234 create empty_menu.make_with_text (Interface_names.m_formatter_separators @ i)
1235 i := i + 1
1236 empty_menu.disable_sensitive
1237 Result.extend (empty_menu)
1238 from
1239 managed_class_formatters.start
1240 until
1241 managed_class_formatters.after
1242 loop
1243 form := managed_class_formatters.item
1244 if form /= Void then
1245 Result.extend (form.new_menu_item)
1246 else
1247 create empty_menu.make_with_text (Interface_names.m_formatter_separators @ i)
1248 i := i + 1
1249 empty_menu.disable_sensitive
1250 Result.extend (empty_menu)
1251 end
1252 managed_class_formatters.forth
1253 end
1254 end
1255
1256 build_feature_info_menu: EV_MENU is
1257 -- Build the feature format sub-menu.
1258 local
1259 form: EB_FEATURE_INFO_FORMATTER
1260 do
1261 create Result.make_with_text (Interface_names.m_feature_info)
1262 from
1263 managed_feature_formatters.start
1264 until
1265 managed_feature_formatters.after
1266 loop
1267 form := managed_feature_formatters.item
1268 if form /= Void then
1269 Result.extend (form.new_menu_item)
1270 end
1271 managed_feature_formatters.forth
1272 end
1273 end
1274
1275 build_edit_menu is
1276 -- Create and build `edit_menu'
1277 local
1278 command_menu_item: EB_COMMAND_MENU_ITEM
1279 sub_menu: EV_MENU
1280 cmd: EB_EDITOR_COMMAND
1281 os_cmd: EB_ON_SELECTION_COMMAND
1282 editor: EB_SMART_EDITOR
1283 ln_cmd: EB_TOGGLE_LINE_NUMBERS_COMMAND
1284 do
1285 editor := editor_tool.text_area
1286 create command_controller.make
1287
1288 create edit_menu.make_with_text (Interface_names.m_edit)
1289
1290 -- Undo
1291 command_menu_item := undo_cmd.new_menu_item
1292 add_recyclable (command_menu_item)
1293 edit_menu.extend (command_menu_item)
1294
1295 -- Redo
1296 command_menu_item := redo_cmd.new_menu_item
1297 add_recyclable (command_menu_item)
1298 edit_menu.extend (command_menu_item)
1299
1300 -- Separator --------------------------------------
1301 edit_menu.extend (create {EV_MENU_SEPARATOR})
1302
1303 -- Cut
1304 create os_cmd.make (Current)
1305 os_cmd.set_menu_name (Interface_names.M_cut)
1306 os_cmd.set_pixmap (pixmaps.icon_cut)
1307 os_cmd.set_name ("Editor_cut")
1308 os_cmd.set_tooltip (interface_names.f_cut)
1309 os_cmd.add_agent (agent cut_selection)
1310 os_cmd.set_tooltext (Interface_names.b_cut)
1311 toolbarable_commands.extend (os_cmd)
1312 os_cmd.set_needs_editable (True)
1313 command_controller.add_selection_command (os_cmd)
1314 command_menu_item := os_cmd.new_menu_item
1315 add_recyclable (command_menu_item)
1316 edit_menu.extend (command_menu_item)
1317
1318 -- Copy
1319 create os_cmd.make (Current)
1320 os_cmd.set_menu_name (Interface_names.M_copy)
1321 os_cmd.set_pixmap (pixmaps.icon_copy)
1322 os_cmd.set_name ("Editor_copy")
1323 os_cmd.set_tooltip (interface_names.f_copy)
1324 os_cmd.set_tooltext (Interface_names.b_copy)
1325 os_cmd.add_agent (agent copy_selection)
1326 toolbarable_commands.extend (os_cmd)
1327 os_cmd.set_needs_editable (False)
1328 command_controller.add_selection_command (os_cmd)
1329 command_menu_item := os_cmd.new_menu_item
1330 add_recyclable (command_menu_item)
1331 edit_menu.extend (command_menu_item)
1332
1333 -- Paste
1334 command_menu_item := editor_paste_cmd.new_menu_item
1335 add_recyclable (command_menu_item)
1336 edit_menu.extend (command_menu_item)
1337
1338 -- Separator --------------------------------------
1339 edit_menu.extend (create {EV_MENU_SEPARATOR})
1340
1341 -- Select all
1342 create cmd.make
1343 cmd.set_menu_name (Interface_names.m_select_all)
1344 cmd.add_agent (agent select_all)
1345 command_menu_item := cmd.new_menu_item
1346 command_controller.add_edition_command (cmd)
1347 add_recyclable (command_menu_item)
1348 edit_menu.extend (command_menu_item)
1349
1350 -- Separator --------------------------------------
1351 edit_menu.extend (create {EV_MENU_SEPARATOR})
1352
1353 -- Line numbers
1354 create ln_cmd.make
1355 command_menu_item := ln_cmd.new_menu_item
1356 add_recyclable (command_menu_item)
1357 edit_menu.extend (command_menu_item)
1358 window.accelerators.extend (ln_cmd.accelerator)
1359
1360
1361 -- Separator --------------------------------------
1362 edit_menu.extend (create {EV_MENU_SEPARATOR})
1363
1364 -- Search
1365 create cmd.make
1366 cmd.set_menu_name (Interface_names.m_search + "%T" + preferences.editor_data.shortcuts.item ("show_search_panel").display_string)
1367 cmd.add_agent (agent search)
1368 command_menu_item := cmd.new_menu_item
1369 command_controller.add_edition_command (cmd)
1370 add_recyclable (command_menu_item)
1371 edit_menu.extend (command_menu_item)
1372
1373 -- Go to
1374 create cmd.make
1375 cmd.set_menu_name (Interface_names.m_go_to)
1376 cmd.add_agent (agent goto)
1377 cmd.set_needs_editable (True)
1378 command_menu_item := cmd.new_menu_item
1379 command_controller.add_edition_command (cmd)
1380 add_recyclable (command_menu_item)
1381 edit_menu.extend (command_menu_item)
1382
1383 -- Replace
1384 create cmd.make
1385 cmd.set_menu_name (Interface_names.m_replace + "%T" + preferences.editor_data.shortcuts.item ("show_search_and_replace_panel").display_string)
1386 cmd.add_agent (agent editor.replace)
1387 cmd.set_needs_editable (True)
1388 command_menu_item := cmd.new_menu_item
1389 command_controller.add_edition_command (cmd)
1390 add_recyclable (command_menu_item)
1391 edit_menu.extend (command_menu_item)
1392
1393 -- Find sub menu
1394
1395 create sub_menu.make_with_text (Interface_names.m_find)
1396
1397 -- Find next
1398 create cmd.make
1399 cmd.set_menu_name (Interface_names.m_find_next + "%T" + preferences.editor_data.shortcuts.item ("search_last").display_string)
1400 cmd.add_agent (agent find_next)
1401 command_menu_item := cmd.new_menu_item
1402 command_controller.add_edition_command (cmd)
1403 add_recyclable (command_menu_item)
1404 sub_menu.extend (command_menu_item)
1405
1406 -- Find previous
1407 create cmd.make
1408 cmd.set_menu_name (Interface_names.m_find_previous + "%T" + preferences.editor_data.shortcuts.item ("search_backward").display_string)
1409 cmd.add_agent (agent find_previous)
1410 command_menu_item := cmd.new_menu_item
1411 command_controller.add_edition_command (cmd)
1412 add_recyclable (command_menu_item)
1413 sub_menu.extend (command_menu_item)
1414
1415 -- Find selection
1416 create os_cmd.make (Current)
1417 os_cmd.set_menu_name (Interface_names.m_find_selection + "%T" + preferences.editor_data.shortcuts.item ("search_selection").display_string)
1418 os_cmd.add_agent (agent find_selection)
1419 command_menu_item := os_cmd.new_menu_item
1420 command_controller.add_selection_command (os_cmd)
1421 add_recyclable (command_menu_item)
1422 sub_menu.extend (command_menu_item)
1423
1424 edit_menu.extend (sub_menu)
1425
1426
1427 -- Separator --------------------------------------
1428 edit_menu.extend (create {EV_MENU_SEPARATOR})
1429
1430 create sub_menu.make_with_text (Interface_names.m_advanced)
1431
1432 create os_cmd.make (Current)
1433 os_cmd.set_needs_editable (True)
1434 command_controller.add_selection_command (os_cmd)
1435 os_cmd.set_menu_name (Interface_names.m_indent)
1436 os_cmd.add_agent (agent editor.indent_selection)
1437 command_menu_item := os_cmd.new_menu_item
1438 add_recyclable (command_menu_item)
1439 sub_menu.extend (command_menu_item)
1440
1441 create os_cmd.make (Current)
1442 os_cmd.set_needs_editable (True)
1443 command_controller.add_selection_command (os_cmd)
1444 os_cmd.set_menu_name (Interface_names.m_unindent)
1445 os_cmd.add_agent (agent editor.unindent_selection)
1446 command_menu_item := os_cmd.new_menu_item
1447 add_recyclable (command_menu_item)
1448 sub_menu.extend (command_menu_item)
1449
1450 create os_cmd.make (Current)
1451 os_cmd.set_needs_editable (True)
1452 command_controller.add_selection_command (os_cmd)
1453 os_cmd.set_menu_name (Interface_names.m_to_lower)
1454 os_cmd.add_agent (agent editor.set_selection_case (True))
1455 command_menu_item := os_cmd.new_menu_item
1456 add_recyclable (command_menu_item)
1457 sub_menu.extend (command_menu_item)
1458
1459 create os_cmd.make (Current)
1460 os_cmd.set_needs_editable (True)
1461 command_controller.add_selection_command (os_cmd)
1462 os_cmd.set_menu_name (Interface_names.m_to_upper)
1463 os_cmd.add_agent (agent editor.set_selection_case (False))
1464 command_menu_item := os_cmd.new_menu_item
1465 add_recyclable (command_menu_item)
1466 sub_menu.extend (command_menu_item)
1467
1468 create cmd.make
1469 cmd.set_needs_editable (True)
1470 cmd.set_menu_name (Interface_names.m_comment)
1471 cmd.add_agent (agent editor.comment_selection)
1472 command_menu_item := cmd.new_menu_item
1473 command_controller.add_edition_command (cmd)
1474 add_recyclable (command_menu_item)
1475 sub_menu.extend (command_menu_item)
1476
1477 create cmd.make
1478 cmd.set_needs_editable (True)
1479 cmd.set_menu_name (Interface_names.m_uncomment)
1480 cmd.add_agent (agent editor.uncomment_selection)
1481 command_menu_item := cmd.new_menu_item
1482 command_controller.add_edition_command (cmd)
1483 add_recyclable (command_menu_item)
1484 sub_menu.extend (command_menu_item)
1485
1486 -- Separator --------------------------------------
1487 sub_menu.extend (create {EV_MENU_SEPARATOR})
1488
1489 -- Insert if block
1490 create cmd.make
1491 cmd.set_needs_editable (True)
1492 cmd.set_menu_name (Interface_names.m_if_block)
1493 cmd.add_agent (agent editor.embed_in_block("if then", 3))
1494 command_menu_item := cmd.new_menu_item
1495 command_controller.add_edition_command (cmd)
1496 add_recyclable (command_menu_item)
1497 sub_menu.extend (command_menu_item)
1498
1499 -- Insert debug block
1500 create cmd.make
1501 cmd.set_needs_editable (True)
1502 cmd.set_menu_name (Interface_names.m_debug_block)
1503 cmd.add_agent (agent editor.embed_in_block("debug", 5))
1504 command_menu_item := cmd.new_menu_item
1505 command_controller.add_edition_command (cmd)
1506 add_recyclable (command_menu_item)
1507 sub_menu.extend (command_menu_item)
1508
1509
1510 -- Separator --------------------------------------
1511 sub_menu.extend (create {EV_MENU_SEPARATOR})
1512
1513 -- Complete word
1514 create cmd.make
1515 cmd.set_needs_editable (True)
1516 cmd.set_menu_name (Interface_names.m_complete_word + "%T" + preferences.editor_data.shortcuts.item ("autocomplete").display_string)
1517 command_menu_item := cmd.new_menu_item
1518 command_controller.add_edition_command (cmd)
1519 cmd.add_agent (agent editor.complete_feature_name)
1520
1521 add_recyclable (command_menu_item)
1522 sub_menu.extend (command_menu_item)
1523
1524 -- Complete class name
1525 create cmd.make
1526 cmd.set_needs_editable (True)
1527 cmd.set_menu_name (Interface_names.m_complete_class_name + "%T" + preferences.editor_data.shortcuts.item ("class_autocomplete").display_string)
1528 command_menu_item := cmd.new_menu_item
1529 command_controller.add_edition_command (cmd)
1530 cmd.add_agent (agent editor.complete_class_name)
1531
1532 add_recyclable (command_menu_item)
1533 sub_menu.extend (command_menu_item)
1534
1535 sub_menu.extend (create {EV_MENU_SEPARATOR})
1536
1537 -- show/hide formatting marks.
1538 create cmd.make
1539 if editor_tool.text_area.view_invisible_symbols then
1540 cmd.set_menu_name (Interface_names.m_hide_formatting_marks)
1541 else
1542 cmd.set_menu_name (Interface_names.m_show_formatting_marks)
1543 end
1544 formatting_marks_command_menu_item := cmd.new_menu_item
1545 command_controller.add_edition_command (cmd)
1546 cmd.add_agent (agent toggle_formatting_marks)
1547
1548 add_recyclable (formatting_marks_command_menu_item)
1549 sub_menu.extend (formatting_marks_command_menu_item)
1550
1551 edit_menu.extend (sub_menu)
1552 end
1553
1554 build_view_menu is
1555 -- Build the view menu.
1556 local
1557 form: EB_CLASS_INFO_FORMATTER
1558 new_menu_item: EB_COMMAND_MENU_ITEM
1559 new_basic_item: EV_MENU_ITEM
1560 do
1561 Precursor
1562
1563 new_menu_item := toggle_stone_cmd.new_menu_item
1564 view_menu.extend (new_menu_item)
1565 add_recyclable (new_menu_item)
1566
1567 new_menu_item := send_stone_to_context_cmd.new_menu_item
1568 view_menu.extend (new_menu_item)
1569 add_recyclable (new_menu_item)
1570 -- Go to menu
1571 new_basic_item := history_manager.new_menu
1572 view_menu.extend (new_basic_item)
1573
1574 -- Separator --------------------------------------
1575 view_menu.extend (create {EV_MENU_SEPARATOR})
1576 view_menu.extend (build_class_info_menu)
1577 view_menu.extend (build_feature_info_menu)
1578
1579 -- Separator --------------------------------------
1580 view_menu.extend (create {EV_MENU_SEPARATOR})
1581
1582 from
1583 managed_main_formatters.start
1584 until
1585 managed_main_formatters.after
1586 loop
1587 form := managed_main_formatters.item
1588 new_basic_item := form.new_menu_item
1589 new_basic_item.select_actions.put_front (agent form.invalidate)
1590 view_menu.extend (new_basic_item)
1591 --add_recyclable (new_basic_item)
1592 managed_main_formatters.forth
1593 end
1594 end
1595
1596 build_favorites_menu is
1597 -- Build the favorites menu
1598 do
1599 Precursor {EB_TOOL_MANAGER}
1600
1601 create show_favorites_menu_item
1602 update_show_favorites_menu_item
1603 show_favorites_menu_item.select_actions.extend (agent execute_show_favorites)
1604
1605 favorites_menu.start
1606 favorites_menu.put_right (show_favorites_menu_item)
1607 favorites_menu.select_actions.extend (agent update_show_favorites_menu_item)
1608 end
1609
1610 -- Jason Wei modified the following on Aug 31 2005
1611 build_project_menu is
1612 -- Build the project menu.
1613 local
1614 command_menu_item: EB_COMMAND_MENU_ITEM
1615 do
1616 create project_menu.make_with_text (Interface_names.m_project)
1617
1618 -- Melt
1619 command_menu_item := Melt_project_cmd.new_menu_item
1620 add_recyclable (command_menu_item)
1621 project_menu.extend (command_menu_item)
1622
1623 -- Quick melt
1624 command_menu_item := Quick_melt_project_cmd.new_menu_item
1625 add_recyclable (command_menu_item)
1626 project_menu.extend (command_menu_item)
1627
1628 -- Freeze
1629 command_menu_item := Freeze_project_cmd.new_menu_item
1630 add_recyclable (command_menu_item)
1631 project_menu.extend (command_menu_item)
1632
1633 -- Finalize
1634 command_menu_item := Finalize_project_cmd.new_menu_item
1635 add_recyclable (command_menu_item)
1636 project_menu.extend (command_menu_item)
1637
1638 -- Precompile
1639 command_menu_item := precompilation_cmd.new_menu_item
1640 add_recyclable (command_menu_item)
1641 project_menu.extend (command_menu_item)
1642
1643 -- Cancel
1644 command_menu_item := project_cancel_cmd.new_menu_item
1645 add_recyclable (command_menu_item)
1646 project_menu.extend (command_menu_item)
1647
1648 -- Separator -------------------------------------------------
1649 project_menu.extend (create {EV_MENU_SEPARATOR})
1650
1651 -- Compile Workbench C code
1652 command_menu_item := c_workbench_compilation_cmd.new_menu_item
1653 add_recyclable (command_menu_item)
1654 project_menu.extend (command_menu_item)
1655
1656 -- Compile Finalized C code
1657 command_menu_item := c_finalized_compilation_cmd.new_menu_item
1658 add_recyclable (command_menu_item)
1659 project_menu.extend (command_menu_item)
1660
1661 -- Jason Wei
1662 -- Terminate C compilation
1663 command_menu_item := Terminate_c_compilation_cmd.new_menu_item
1664 add_recyclable (command_menu_item)
1665 project_menu.extend (command_menu_item)
1666 -- Jason Wei
1667
1668 -- Execute Finalized code
1669 command_menu_item := run_finalized_cmd.new_menu_item
1670 add_recyclable (command_menu_item)
1671 project_menu.extend (command_menu_item)
1672
1673 -- Separator -------------------------------------------------
1674 project_menu.extend (create {EV_MENU_SEPARATOR})
1675
1676 -- System Tool window
1677 command_menu_item := system_cmd.new_menu_item
1678 add_recyclable (command_menu_item)
1679 project_menu.extend (command_menu_item)
1680
1681 -- System information
1682 command_menu_item := system_info_cmd.new_menu_item
1683 add_recyclable (command_menu_item)
1684 project_menu.extend (command_menu_item)
1685
1686 -- Error information
1687 command_menu_item := display_error_help_cmd.new_menu_item
1688 add_recyclable (command_menu_item)
1689 project_menu.extend (command_menu_item)
1690
1691 if has_documentation_generation or has_xmi_generation then
1692 -- Separator -------------------------------------------------
1693 project_menu.extend (create {EV_MENU_SEPARATOR})
1694 end
1695
1696 if has_documentation_generation then
1697 -- Generate Documentation
1698 command_menu_item := document_cmd.new_menu_item
1699 add_recyclable (command_menu_item)
1700 project_menu.extend (command_menu_item)
1701 end
1702
1703 if has_xmi_generation then
1704 -- Export XMI
1705 command_menu_item := export_cmd.new_menu_item
1706 add_recyclable (command_menu_item)
1707 project_menu.extend (command_menu_item)
1708 end
1709 end
1710
1711 ------- This is the original version
1712 -- build_project_menu is
1713 -- -- Build the project menu.
1714 -- local
1715 -- command_menu_item: EB_COMMAND_MENU_ITEM
1716 -- do
1717 -- create project_menu.make_with_text (Interface_names.m_project)
1718 --
1719 -- -- Melt
1720 -- command_menu_item := Melt_project_cmd.new_menu_item
1721 -- add_recyclable (command_menu_item)
1722 -- project_menu.extend (command_menu_item)
1723 --
1724 -- -- Quick melt
1725 -- command_menu_item := Quick_melt_project_cmd.new_menu_item
1726 -- add_recyclable (command_menu_item)
1727 -- project_menu.extend (command_menu_item)
1728 --
1729 -- -- Freeze
1730 -- command_menu_item := Freeze_project_cmd.new_menu_item
1731 -- add_recyclable (command_menu_item)
1732 -- project_menu.extend (command_menu_item)
1733 --
1734 -- -- Finalize
1735 -- command_menu_item := Finalize_project_cmd.new_menu_item
1736 -- add_recyclable (command_menu_item)
1737 -- project_menu.extend (command_menu_item)
1738 --
1739 -- -- Precompile
1740 -- command_menu_item := precompilation_cmd.new_menu_item
1741 -- add_recyclable (command_menu_item)
1742 -- project_menu.extend (command_menu_item)
1743 --
1744 -- -- Separator -------------------------------------------------
1745 -- project_menu.extend (create {EV_MENU_SEPARATOR})
1746 --
1747 -- -- Compile Workbench C code
1748 -- command_menu_item := c_workbench_compilation_cmd.new_menu_item
1749 -- add_recyclable (command_menu_item)
1750 -- project_menu.extend (command_menu_item)
1751 --
1752 -- -- Compile Finalized C code
1753 -- command_menu_item := c_finalized_compilation_cmd.new_menu_item
1754 -- add_recyclable (command_menu_item)
1755 -- project_menu.extend (command_menu_item)
1756 --
1757 -- -- Execute Finalized code
1758 -- command_menu_item := run_finalized_cmd.new_menu_item
1759 -- add_recyclable (command_menu_item)
1760 -- project_menu.extend (command_menu_item)
1761 --
1762 -- -- Separator -------------------------------------------------
1763 -- project_menu.extend (create {EV_MENU_SEPARATOR})
1764 --
1765 -- -- System Tool window
1766 -- command_menu_item := system_cmd.new_menu_item
1767 -- add_recyclable (command_menu_item)
1768 -- project_menu.extend (command_menu_item)
1769 --
1770 -- -- System information
1771 -- command_menu_item := system_info_cmd.new_menu_item
1772 -- add_recyclable (command_menu_item)
1773 -- project_menu.extend (command_menu_item)
1774 --
1775 -- -- Error information
1776 -- command_menu_item := display_error_help_cmd.new_menu_item
1777 -- add_recyclable (command_menu_item)
1778 -- project_menu.extend (command_menu_item)
1779 --
1780 -- if has_documentation_generation or has_xmi_generation then
1781 -- -- Separator -------------------------------------------------
1782 -- project_menu.extend (create {EV_MENU_SEPARATOR})
1783 -- end
1784 --
1785 -- if has_documentation_generation then
1786 -- -- Generate Documentation
1787 -- command_menu_item := document_cmd.new_menu_item
1788 -- add_recyclable (command_menu_item)
1789 -- project_menu.extend (command_menu_item)
1790 -- end
1791 --
1792 -- if has_xmi_generation then
1793 -- -- Export XMI
1794 -- command_menu_item := export_cmd.new_menu_item
1795 -- add_recyclable (command_menu_item)
1796 -- project_menu.extend (command_menu_item)
1797 -- end
1798 -- end
1799 -- Jason Wei modified the above on Aug 31 2005
1800
1801 build_tools_menu is
1802 -- Create and build `tools_menu'
1803 local
1804 command_menu_item: EB_COMMAND_MENU_ITEM
1805 menu_item: EV_MENU_ITEM
1806 do
1807 create tools_menu.make_with_text (Interface_names.m_tools)
1808
1809 -- New Cluster command.
1810 command_menu_item := new_cluster_cmd.new_menu_item
1811 add_recyclable (command_menu_item)
1812 tools_menu.extend (command_menu_item)
1813
1814 -- New Class command.
1815 command_menu_item := new_class_cmd.new_menu_item
1816 add_recyclable (command_menu_item)
1817 tools_menu.extend (command_menu_item)
1818
1819 -- New Feature command.
1820 command_menu_item := new_feature_cmd.new_menu_item
1821 add_recyclable (command_menu_item)
1822 tools_menu.extend (command_menu_item)
1823
1824 -- Delete class/cluster command.
1825 command_menu_item := delete_class_cluster_cmd.new_menu_item
1826 add_recyclable (command_menu_item)
1827 tools_menu.extend (command_menu_item)
1828
1829 -- Separator --------------------------------------
1830 tools_menu.extend (create {EV_MENU_SEPARATOR})
1831
1832
1833 if has_metrics then
1834 -- Metric tool
1835 create metric_menu.make_with_text (interface_names.metric_metrics)
1836 create menu_item.make_with_text (interface_names.metric_calculate)
1837 metric_menu.extend (menu_item)
1838 create menu_item.make_with_text (interface_names.metric_add)
1839 metric_menu.extend (menu_item)
1840 create menu_item.make_with_text (interface_names.metric_delete)
1841 metric_menu.extend (menu_item)
1842 create menu_item.make_with_text (interface_names.metric_details)
1843 metric_menu.extend (menu_item)
1844 create menu_item.make_with_text (interface_names.metric_new_metrics)
1845 metric_menu.extend (menu_item)
1846 create menu_item.make_with_text (interface_names.metric_management)
1847 metric_menu.extend (menu_item)
1848 create menu_item.make_with_text (interface_names.metric_archive)
1849 metric_menu.extend (menu_item)
1850 metric_menu.disable_sensitive
1851 tools_menu.extend (metric_menu)
1852 end
1853
1854 if has_profiler then
1855 -- Profiler Window
1856 command_menu_item := show_profiler.new_menu_item
1857 add_recyclable (command_menu_item)
1858 tools_menu.extend (command_menu_item)
1859 end
1860
1861 -- Precompile Wizard
1862 command_menu_item := wizard_precompile_cmd.new_menu_item
1863 add_recyclable (command_menu_item)
1864 tools_menu.extend (command_menu_item)
1865
1866 if has_dll_generation then
1867 -- Dynamic Library Window
1868 command_menu_item := show_dynamic_lib_tool.new_menu_item
1869 add_recyclable (command_menu_item)
1870 tools_menu.extend (command_menu_item)
1871 end
1872
1873 -- Separator -------------------------------------------------
1874 tools_menu.extend (create {EV_MENU_SEPARATOR})
1875
1876 -- Preferences
1877 command_menu_item := Show_preferences_cmd.new_menu_item
1878 add_recyclable (command_menu_item)
1879 tools_menu.extend (command_menu_item)
1880
1881 -- External commands editor
1882 command_menu_item := Edit_external_commands_cmd.new_menu_item
1883 add_recyclable (command_menu_item)
1884 tools_menu.extend (command_menu_item)
1885
1886 rebuild_tools_menu
1887 end
1888
1889 feature -- Stone process
1890
1891 stone: STONE
1892 -- Current stone
1893
1894 toggle_unified_stone is
1895 -- Change the stone management mode.
1896 do
1897 unified_stone := not unified_stone
1898 if unified_stone then
1899 send_stone_to_context
1900 send_stone_to_context_cmd.disable_sensitive
1901 context_tool.link_to_development_window
1902 else
1903 if stone /= Void then
1904 send_stone_to_context_cmd.enable_sensitive
1905 end
1906 context_tool.cut_from_development_window
1907 end
1908 end
1909
1910 set_stone (a_stone: STONE) is
1911 -- Change the currently focused stone.
1912 local
1913 cd: STANDARD_DISCARDABLE_CONFIRMATION_DIALOG
1914 cv_cst: CLASSI_STONE
1915 ef_stone: EXTERNAL_FILE_STONE
1916 l: LIST [EB_DEVELOPMENT_WINDOW]
1917 l_filename: STRING
1918 do
1919 cv_cst ?= a_stone
1920 if cv_cst /= Void then
1921 l_filename := cv_cst.class_i.name
1922 else
1923 ef_stone ?= a_stone
1924 if ef_stone /= Void then
1925 l_filename := ef_stone.file_name.string
1926 end
1927 end
1928
1929 if cv_cst /= Void or ef_stone /= Void then
1930 l := Window_manager.development_windows_with_class (l_filename)
1931 if l.is_empty or else l.has (Current) then
1932 -- We're not editing the class in another window.
1933 set_stone_after_first_check (a_stone)
1934 else
1935 create cd.make_initialized (2,
1936 preferences.dialog_data.already_editing_class_string,
1937 warning_messages.w_class_already_edited,
1938 Interface_names.l_do_not_show_again,
1939 preferences.preferences)
1940 cd.set_ok_action (agent set_stone_after_first_check (a_stone))
1941 cd.show_modal_to_window (window)
1942 end
1943 else
1944 set_stone_after_first_check (a_stone)
1945 end
1946 end
1947
1948 set_stone_after_first_check (a_stone: STONE) is
1949 -- Display text associated with `a_stone', if any and if possible
1950 local
1951 feature_stone: FEATURE_STONE
1952 old_class_stone: CLASSI_STONE
1953 test_stone: CLASSI_STONE
1954 same_class: BOOLEAN
1955 conv_ferrst: FEATURE_ERROR_STONE
1956 ef_stone: EXTERNAL_FILE_STONE
1957 cluster_st: CLUSTER_STONE
1958 new_class_stone: CLASSI_STONE
1959 conv_ace: ACE_SYNTAX_STONE
1960 conv_errst: ERROR_STONE
1961 conv_brkstone: BREAKABLE_STONE
1962 do
1963 old_class_stone ?= stone
1964 feature_stone ?= a_stone
1965 ef_stone ?= a_stone
1966 new_class_stone ?= a_stone
1967 cluster_st ?= a_stone
1968
1969 -- Update the history.
1970 conv_brkstone ?= a_stone
1971 conv_errst ?= a_stone
1972 conv_ace ?= a_stone
1973 if
1974 conv_brkstone = Void and
1975 conv_errst = Void and
1976 conv_ace = Void and
1977 ef_stone = Void
1978 then
1979 if
1980 new_class_stone /= Void
1981 then
1982 history_manager.extend (new_class_stone)
1983 elseif
1984 cluster_st /= Void
1985 then
1986 history_manager.extend (cluster_st)
1987 end
1988 end
1989
1990 if old_class_stone /= Void then
1991 create test_stone.make (old_class_stone.class_i)
1992 same_class := test_stone.same_as (a_stone)
1993 -- We need to compare classes. If `old_class_stone' is a FEATURE_STONE
1994 -- `same_as' will compare features. Therefore, we need `test_stone' to be sure
1995 -- we have a CLASSI_STONE.
1996 if same_class and then feature_stone /= Void then
1997 same_class := False
1998 -- if the stone corresponding to a feature of currently opened class is dropped
1999 -- we attempt to scroll to the feature without asking to save the file
2000 -- except if it is during a resynchronization, in which case we do not scroll at all.
2001 if editor_tool.text_area.text_is_fully_loaded then
2002 if not during_synchronization then
2003 scroll_to_feature (feature_stone.e_feature, new_class_stone.class_i)
2004 feature_stone_already_processed := True
2005 else
2006 feature_stone_already_processed := True
2007 end
2008 conv_ferrst ?= feature_stone
2009 if feature_stone_already_processed and conv_ferrst /= Void then
2010 -- Scroll to the line of the error.
2011 if not during_synchronization then
2012 editor_tool.text_area.display_line_when_ready (conv_ferrst.line_number, True)
2013 end
2014 end
2015 end
2016 end
2017 elseif ef_stone /= Void then
2018 end
2019
2020 -- first, let's check if there is already something in this window
2021 -- if there's nothing, there's no need to save anything...
2022 if stone = Void or else not changed or else feature_stone_already_processed or else same_class then
2023 set_stone_after_check (a_stone)
2024 feature_stone_already_processed := False
2025 else
2026 -- there is something to be saved
2027 -- if user chooses to save, current file will be parsed
2028 -- if there is a syntax_error, new file is not loaded
2029 save_and (agent set_stone_after_check (a_stone))
2030 if text_saved and then not syntax_is_correct then
2031 text_saved := False
2032 during_synchronization := True
2033 set_stone_after_check (stone)
2034 during_synchronization := False
2035 address_manager.refresh
2036 end
2037 end
2038 end
2039
2040 force_stone (s: STONE) is
2041 -- make `s' the new value of `stone', and
2042 -- change the display accordingly. Try to
2043 -- extract a class from `s' whenever possible.
2044 do
2045 if s.is_storable then
2046 set_stone (s)
2047 if not unified_stone then
2048 context_tool.advanced_set_stone (s)
2049 end
2050 end
2051 end
2052
2053 process_class (s: CLASSI_STONE) is
2054 -- Process class stone
2055 do
2056 set_stone (s)
2057 end
2058
2059 process_feature_error (s: FEATURE_ERROR_STONE) is
2060 -- Process feature error stone.
2061 local
2062 cl_stone: CLASSC_STONE
2063 e_class: CLASS_C
2064 do
2065 set_default_format
2066 e_class := s.e_feature.written_class
2067 create cl_stone.make (e_class)
2068 set_stone (cl_stone)
2069 editor_tool.text_area.deselect_all
2070 if s.line_number > 0 then
2071 editor_tool.text_area.highlight_selected (s.line_number, s.line_number)
2072 end
2073 end
2074
2075
2076 process_class_syntax (s: CL_SYNTAX_STONE) is
2077 -- Process class syntax.
2078 local
2079 cl_stone: CLASSC_STONE
2080 do
2081 -- call set_stone to ensure the proper class is displayed
2082 create cl_stone.make (s.e_class)
2083 set_stone (cl_stone)
2084 editor_tool.text_area.deselect_all
2085 editor_tool.text_area.highlight_when_ready (s.line, s.line)
2086 end
2087
2088 refresh is
2089 -- Synchronize clickable elements with text, if possible.
2090 do
2091 --| FIXME ARNAUD
2092 -- synchronise_stone
2093 --| END FIXME
2094 --| FIXME XR: Refresh current display in the editor.
2095 editor_tool.text_area.update_click_list (False)
2096 update_save_symbol
2097 address_manager.refresh
2098 -- The cluster manager should already be refreshed by the window manager.
2099 -- cluster_manager.refresh
2100 -- context_tool.refresh
2101 end
2102
2103 quick_refresh_editors is
2104 -- Redraw editors' drawing area.
2105 do
2106 editor_tool.text_area.refresh
2107 context_tool.quick_refresh_editors
2108 end
2109
2110 quick_refresh_margins is
2111 -- Redraw the main editor's drawing area.
2112 do
2113 editor_tool.text_area.margin.refresh
2114 context_tool.quick_refresh_margins
2115 end
2116
2117 set_default_format is
2118 -- Default format of windows.
2119 --| FIXME ARNAUD: To be implemented.
2120 -- local
2121 -- f: EB_FORMATTER
2122 do
2123 -- if stone /= Void then
2124 -- if stone.class_i.hide_implementation then
2125 -- f := format_list.precompiled_default_format
2126 -- else
2127 -- f := format_list.default_format
2128 -- end
2129 -- else
2130 -- f := format_list.default_format
2131 -- end
2132 -- set_last_format (f)
2133 --| END FIXME
2134 end
2135
2136 feature -- Position provider
2137
2138 position: like position_internal is
2139 -- Currently shown text position in the editor
2140 do
2141 Result := editor_tool.text_area.first_line_displayed
2142 end
2143
2144 pos_container: like pos_container_internal is
2145 -- Current selected formatter
2146 local
2147 l_end : BOOLEAN
2148 do
2149 from
2150 managed_main_formatters.start
2151 until
2152 managed_main_formatters.after or l_end
2153 loop
2154 if managed_main_formatters.item.selected then
2155 l_end := true
2156 Result := managed_main_formatters.item
2157 end
2158 managed_main_formatters.forth
2159 end
2160 end
2161
2162 feature -- Resource Update
2163
2164 update is
2165 -- Update Current with the registered resources.
2166 do
2167 lock_update
2168 -- Show/hide general toolbar
2169 if development_window_data.show_general_toolbar then
2170 show_general_toolbar_command.enable_visible
2171 else
2172 show_general_toolbar_command.disable_visible
2173 end
2174
2175 -- Show/hide address toolbar
2176 if development_window_data.show_address_toolbar then
2177 show_address_toolbar_command.enable_visible
2178 else
2179 show_address_toolbar_command.disable_visible
2180 end
2181
2182 -- Show/hide project toolbar
2183 if development_window_data.show_project_toolbar then
2184 show_project_toolbar_command.enable_visible
2185 else
2186 show_project_toolbar_command.disable_visible
2187 end
2188
2189 left_panel.load_from_resource (development_window_data.left_panel_layout)
2190 right_panel.load_from_resource (development_window_data.right_panel_layout)
2191 splitter_position := development_window_data.left_panel_width
2192 update_splitters
2193 unlock_update
2194 end
2195
2196 update_splitters is
2197 -- Refresh the position of the splitter on screen according to
2198 -- our internal values.
2199 do
2200 -- Set the interior layout
2201 if panel.full then
2202 panel.set_split_position (splitter_position.max (panel.minimum_split_position))
2203 end
2204 end
2205
2206 register is
2207 -- Register to preferences we want notification of.
2208 do
2209 end
2210
2211 unregister is
2212 -- unregister to preferences we want notification of.
2213 do
2214 end
2215
2216 reset is
2217 -- Reset the window contents
2218 do
2219 Precursor
2220 address_manager.reset
2221
2222 --| FIXME ARNAUD, multiformat not yet implemented.
2223 -- format_list.enable_imp_formats_sensitive
2224 --| END FIXME
2225 end
2226
2227 rebuild_tools_menu is
2228 -- Refresh the list of external commands.
2229 local
2230 ms: LIST [EB_COMMAND_MENU_ITEM]
2231 l_sep: EV_MENU_SEPARATOR
2232 do
2233 -- Remove all the external commands, which are at the end of the menu.
2234 from
2235 tools_menu.go_i_th (tools_menu.count + 1 - number_of_displayed_external_commands)
2236 until
2237 tools_menu.after
2238 loop
2239 tools_menu.remove
2240 end
2241 ms := Edit_external_commands_cmd.menus
2242 number_of_displayed_external_commands := ms.count
2243
2244 if not ms.is_empty and not tools_menu.is_empty then
2245 l_sep ?= tools_menu.last
2246 if l_sep = Void then
2247 create l_sep
2248 tools_menu.extend (l_sep)
2249 number_of_displayed_external_commands := number_of_displayed_external_commands + 1
2250 end
2251 end
2252
2253 from
2254 ms.start
2255 until
2256 ms.after
2257 loop
2258 tools_menu.extend (ms.item)
2259 add_recyclable (ms.item)
2260 ms.forth
2261 end
2262 end
2263
2264 syntax_is_correct: BOOLEAN is
2265 -- file was successfully parsed.
2266 do
2267 Result := editor_tool.text_area.syntax_is_correct
2268 end
2269
2270 on_project_created is
2271 -- Inform tools that the current project has been loaded or re-loaded.
2272 do
2273 build_menu_bar
2274 enable_commands_on_project_created
2275 context_tool.on_project_created
2276 address_manager.on_project_created
2277 if has_dll_generation then
2278 show_dynamic_lib_tool.enable_sensitive
2279 end
2280 if has_profiler then
2281 show_profiler.enable_sensitive
2282 end
2283 end
2284
2285 on_project_loaded is
2286 -- Inform tools that the current project has been loaded or re-loaded.
2287 do
2288 -- cluster_manager.on_project_loaded
2289 enable_commands_on_project_loaded
2290 cluster_tool.on_project_loaded
2291 context_tool.on_project_loaded
2292 breakpoints_tool.on_project_loaded
2293 end
2294
2295 on_project_unloaded is
2296 -- Inform tools that the current project will soon been unloaded.
2297 do
2298 -- cluster_manager.on_project_unloaded
2299 disable_commands_on_project_unloaded
2300 cluster_tool.on_project_unloaded
2301 context_tool.on_project_unloaded
2302 address_manager.on_project_unloaded
2303 build_menu_bar
2304 if has_dll_generation then
2305 show_dynamic_lib_tool.disable_sensitive
2306 end
2307 if has_profiler then
2308 show_profiler.disable_sensitive
2309 end
2310 end
2311
2312 on_c_compilation_starts is
2313 -- Enable commands when freezing or finalizing starts.
2314 do
2315 c_workbench_compilation_cmd.disable_sensitive
2316 c_finalized_compilation_cmd.disable_sensitive
2317 end
2318
2319 on_c_compilation_stops is
2320 -- Disable commands when freezing or finalizing stops.
2321 do
2322 c_workbench_compilation_cmd.enable_sensitive
2323 c_finalized_compilation_cmd.enable_sensitive
2324 end
2325
2326 save_before_compiling is
2327 -- save the text but do not update clickable positions
2328 do
2329 save_only := True
2330 save_text
2331 end
2332
2333 perform_check_before_save is
2334 -- Perform any pre-save operations/checks
2335 local
2336 dial: EV_CONFIRMATION_DIALOG
2337 do
2338 debug ("EDITOR")
2339 if editor_tool.text_area.current_text /= Void and then changed then
2340 io.error.put_string ("%N Warning: Attempting to save a non editable format%N")
2341 end
2342 end
2343 -- Remove trailing blanks.
2344 if preferences.editor_data.auto_remove_trailing_blank_when_saving then
2345 editor_tool.text_area.text_displayed.remove_trailing_blanks
2346 else
2347 editor_tool.text_area.text_displayed.remove_trailing_fake_blanks
2348 end
2349 editor_tool.text_area.refresh_now
2350
2351 if editor_tool.text_area.open_backup then
2352 create dial.make_with_text(Warning_messages.w_save_backup)
2353 dial.set_buttons_and_actions(<<"Continue", "Cancel">>, <<agent continue_save, agent cancel_save>>)
2354 dial.set_default_push_button(dial.button("Continue"))
2355 dial.set_default_cancel_button(dial.button("Cancel"))
2356 dial.set_title ("Save Backup")
2357 dial.show_modal_to_window (window)
2358 else
2359 check_passed := True
2360 end
2361 end
2362
2363 continue_save is
2364 -- continue saving
2365 do
2366 check_passed := True
2367 end
2368
2369 cancel_save is
2370 -- cancel saving
2371 do
2372 check_passed := False
2373 end
2374
2375 process is
2376 -- process the user entry in the address bar
2377 local
2378 l_class_stone: CLASSI_STONE
2379 l_multi_search_tool: EB_MULTI_SEARCH_TOOL
2380 do
2381 save_canceled := False
2382 l_class_stone ?= stone
2383 if l_class_stone /= Void then
2384 l_multi_search_tool ?= search_tool
2385 if l_multi_search_tool /= Void then
2386 l_multi_search_tool.class_changed (l_class_stone.class_i)
2387 end
2388 end
2389 end
2390
2391 on_text_saved is
2392 -- Notify the editor that the text has been saved
2393 local
2394 str: STRING
2395 do
2396 Precursor
2397 editor_tool.on_text_saved
2398 text_saved := True
2399 if not save_only then
2400 editor_tool.text_area.update_click_list (True)
2401 end
2402 save_only := False
2403 str := title.twin
2404 if str @ 1 = '*' then
2405 str.keep_tail (str.count - 2)
2406 set_title (str)
2407 end
2408 update_formatters
2409 if editor_tool.text_area.syntax_is_correct then
2410 status_bar.display_message ("")
2411 else
2412 status_bar.display_message (Interface_names.L_syntax_error)
2413 end
2414 text_edited := False
2415 end
2416
2417 on_focus is
2418 -- Focus gained
2419 local
2420 editor: TEXT_PANEL
2421 do
2422 editor ?= editor_tool.text_area
2423 if editor /= Void then
2424 editor.on_focus
2425 end
2426 end
2427
2428 save_and (an_action: PROCEDURE [ANY, TUPLE]) is
2429 local
2430 save_dialog: EB_CONFIRM_SAVE_DIALOG
2431 do
2432 save_canceled := True
2433 text_saved := False
2434 create save_dialog.make_and_launch (Current,Current)
2435 if not save_canceled and then syntax_is_correct then
2436 an_action.call(Void)
2437 end
2438 end
2439
2440 feature -- Window management
2441
2442 show_window is
2443 -- Show the window
2444 do
2445 show
2446 end
2447
2448 raise_window is
2449 -- Show the window and set the focus to it.
2450 do
2451 show
2452 --| FIXME, set the focus.
2453 end
2454
2455 hide_window is
2456 -- Hide the window
2457 do
2458 hide
2459 end
2460
2461 destroy_window is
2462 -- Destroy the window.
2463 do
2464 destroy
2465 end
2466
2467 give_focus is
2468 -- Give the focus to the address manager.
2469 do
2470 address_manager.set_focus
2471 end
2472
2473 save_layout is
2474 -- Store layout of `current'.
2475 do
2476 save_layout_to_window_data (development_window_data)
2477 -- Commit saves
2478 preferences.preferences.save_preferences
2479 end
2480
2481 save_layout_to_session (a_session: ES_SESSION) is
2482 -- Save session data of `Current' to session object `a_session'.
2483 local
2484 a_window_data: EB_DEVELOPMENT_WINDOW_SESSION_DATA
2485 a_class_i: CLASSI_STONE
2486 do
2487 create a_window_data.make_from_window_data (preferences.development_window_data)
2488
2489 a_class_i ?= stone
2490 if a_class_i /= Void then
2491 a_window_data.save_filename (a_class_i.file_name)
2492 a_window_data.save_editor_position (editor_tool.text_area.current_cursor_position)
2493 end
2494
2495 if context_tool /= Void then
2496 a_window_data.save_context_data (
2497 context_tool.address_manager.cluster_label_text,
2498 context_tool.address_manager.class_label_text,
2499 context_tool.address_manager.feature_label_text,
2500 context_tool.notebook.selected_item_index
2501 )
2502 end
2503
2504 save_layout_to_window_data (a_window_data)
2505
2506 -- Add the session data of `Current' to the session object.
2507 a_session.window_session_data.extend (a_window_data)
2508 end
2509
2510 save_layout_to_window_data (a_window_data: EB_DEVELOPMENT_WINDOW_DATA) is
2511 -- Store window data of `Current' in `a_window_data'.
2512 require
2513 a_window_data_not_void: a_window_data /= Void
2514 do
2515 -- Now save the windows's layout, but only if the
2516 -- debugger is not displayed in `Current'. By saving the layout,
2517 -- we ensure that future windows may use exactly the same layout.
2518 -- If the debugger is displayed, the previous layout is already saved,
2519 -- and this is the one that must be used, as only one debugger is ever displayed.
2520 if
2521 (Eb_debugger_manager.application_is_executing and Eb_debugger_manager.debugging_window /= Current)
2522 or not Eb_debugger_manager.application_is_executing
2523 then
2524 a_window_data.save_left_panel_layout (left_panel.save_to_resource)
2525 a_window_data.save_right_panel_layout (right_panel.save_to_resource)
2526 a_window_data.save_left_panel_width (panel.split_position)
2527 -- Save width & height.
2528 a_window_data.save_size (window.width, window.height)
2529 a_window_data.save_window_state (window.is_minimized, window.is_maximized)
2530 a_window_data.save_position (window.x_position, window.y_position)
2531 end
2532 a_window_data.save_show_search_options (search_tool.options_shown)
2533 end
2534
2535
2536 feature -- Tools & Controls
2537
2538 editor_tool: EB_EDITOR_TOOL
2539
2540 favorites_tool: EB_FAVORITES_TOOL
2541
2542 cluster_tool: EB_CLUSTER_TOOL
2543
2544 search_tool: EB_MULTI_SEARCH_TOOL
2545
2546 features_tool: EB_FEATURES_TOOL
2547
2548 breakpoints_tool: ES_BREAKPOINTS_TOOL
2549
2550 windows_tool: EB_WINDOWS_TOOL
2551
2552 context_tool: EB_CONTEXT_TOOL
2553 -- Context explorer for current class and system.
2554
2555 address_manager: EB_ADDRESS_MANAGER
2556 -- Text field in the toolbar
2557 -- Allow user to enter the name
2558 -- of the class he wants to edit.
2559
2560 project_manager: EB_PROJECT_MANAGER is
2561 -- Project manager associated to the project the user is working on.
2562 do
2563 Result := Eiffel_project.manager
2564 end
2565
2566 managed_class_formatters: ARRAYED_LIST [EB_CLASS_INFO_FORMATTER]
2567 -- All formatters that operate on a class.
2568
2569 managed_feature_formatters: ARRAYED_LIST [EB_FEATURE_INFO_FORMATTER]
2570 -- All formatters that operate on a class.
2571
2572 managed_main_formatters: ARRAYED_LIST [EB_CLASS_TEXT_FORMATTER]
2573 -- All formatters that can be displayed in the main editor frame.
2574
2575 unified_stone: BOOLEAN
2576 -- Is the stone common with the context tool or not?
2577
2578 arguments_dialog: EB_ARGUMENT_DIALOG
2579 -- The arguments dialog for current, if any
2580
2581 goto_dialog: EB_GOTO_DIALOG
2582 -- The goto dialog for line number access
2583
2584 feature -- Multiple editor management
2585
2586 add_editor_to_list (an_editor: EB_EDITOR) is
2587 -- adds `an_editor' to `editors'
2588 do
2589 editors.extend (an_editor)
2590 end
2591
2592 current_editor: EB_EDITOR is
2593 -- current editor, if none, main editor
2594 do
2595 if current_editor_index /= 0 then
2596 Result := editors @ current_editor_index
2597 else
2598 Result := editors.first
2599 end
2600 end
2601
2602 set_current_editor (an_editor: EB_EDITOR) is
2603 -- set `an_editor' as main editor
2604 local
2605 old_index: INTEGER
2606 new_index: INTEGER
2607 do
2608 old_index := current_editor_index
2609 new_index := editors.index_of (an_editor, 1)
2610 if
2611 editors.valid_index (new_index) and
2612 old_index /= new_index
2613 then
2614 current_editor_index := new_index
2615 update_paste_cmd
2616 -- Last thing, update the menu entry for the formatting marks.
2617 if current_editor.view_invisible_symbols then
2618 formatting_marks_command_menu_item.set_text (Interface_names.m_hide_formatting_marks)
2619 else
2620 formatting_marks_command_menu_item.set_text(Interface_names.m_show_formatting_marks)
2621 end
2622 command_controller.set_current_editor (an_editor)
2623 end
2624 end
2625
2626 update_paste_cmd is
2627 -- Update `editor_paste_cmd'. To be performed when an editor grabs the focus.
2628 do
2629 if
2630 not current_editor.is_empty and then
2631 current_editor.is_editable and then
2632 current_editor.clipboard.has_text
2633 then
2634 editor_paste_cmd.enable_sensitive
2635 else
2636 editor_paste_cmd.disable_sensitive
2637 end
2638 end
2639
2640 feature {NONE} -- Multiple editor management
2641
2642 editors: ARRAYED_LIST [EB_EDITOR]
2643 -- editor contained in `Current'
2644
2645 current_editor_index: INTEGER
2646 -- Index in `editors' of the editor that has the focus.
2647
2648 feature {EB_FEATURES_TOOL, EB_FEATURES_TREE, DOTNET_CLASS_AS, DOTNET_CLASS_CONTEXT} -- Feature Clauses
2649
2650 set_feature_clauses (a_features: ARRAYED_LIST [DOTNET_FEATURE_CLAUSE_AS [CONSUMED_ENTITY]]; a_type: STRING) is
2651 -- Set 'features' to 'a_features' and store in hash table with key 'a_type' denoting name of consumed
2652 -- type pertinent to 'a_features'.
2653 require
2654 a_features_not_void: a_features /= Void
2655 do
2656 if feature_clauses = Void then
2657 create feature_clauses.make (5)
2658 end
2659 feature_clauses.put (a_features, a_type)
2660 end
2661
2662 set_feature_locating (a_locating: BOOLEAN) is
2663 -- Set `feature_locating' with `a_locating'.
2664 do
2665 feature_locating := a_locating
2666 end
2667
2668 get_feature_clauses (a_type: STRING): ARRAYED_LIST [DOTNET_FEATURE_CLAUSE_AS [CONSUMED_ENTITY]] is
2669 -- Get list of feature clauses relevant to .NET type with name 'a_type'.
2670 require
2671 a_type_not_void: a_type /= Void
2672 has_type_clauses: feature_clauses.has (a_type)
2673 do
2674 Result := feature_clauses.item (a_type)
2675 ensure
2676 result_not_void: Result /= Void
2677 end
2678
2679 feature_clauses: HASH_TABLE [ARRAYED_LIST [DOTNET_FEATURE_CLAUSE_AS [CONSUMED_ENTITY]], STRING]
2680 -- List of features clauses for Current window hashed by the .NET name of the consumed_type.
2681
2682 feature_positions: HASH_TABLE [INTEGER, E_FEATURE]
2683 -- Features indexed by line position in class text (for .NET features).
2684
2685 feature_locating: BOOLEAN
2686 -- Is feature tool locating a feature?
2687
2688 feature {EB_WINDOW_MANAGER} -- Window management / Implementation
2689
2690 destroy_imp is
2691 -- Destroy window.
2692 do
2693 -- To avoid reentrance
2694 if not is_destroying then
2695 is_destroying := True
2696 -- If a launched application is still running, kill it.
2697 if
2698 Eb_debugger_manager.application_is_executing
2699 and then Eb_debugger_manager.debugging_window = Current
2700 then
2701 Eb_debugger_manager.Application.kill
2702 else
2703 development_window_data.save_left_panel_layout (left_panel.save_to_resource)
2704 development_window_data.save_right_panel_layout (right_panel.save_to_resource)
2705 end
2706 development_window_data.save_left_panel_width (panel.split_position)
2707 -- Save width & height.
2708 development_window_data.save_size (window.width, window.height)
2709 development_window_data.save_window_state (window.is_minimized, window.is_maximized)
2710 development_window_data.save_position (window.x_position, window.y_position)
2711 left_panel.wipe_out
2712 right_panel.wipe_out
2713 development_window_data.save_show_search_options (search_tool.options_shown)
2714 hide
2715
2716 -- Commit saves
2717 preferences.preferences.save_preferences
2718
2719 toolbars_area.wipe_out
2720 address_manager.recycle
2721 project_customizable_toolbar.recycle
2722 Precursor {EB_TOOL_MANAGER}
2723
2724 managed_class_formatters.wipe_out
2725 managed_feature_formatters.wipe_out
2726 managed_main_formatters.wipe_out
2727 toolbarable_commands.wipe_out
2728 editors.wipe_out
2729 stone := Void
2730 end
2731 end
2732
2733 feature -- C output pixmap management
2734
2735 start_c_output_pixmap_timer is
2736 -- Start timer to draw c output pixmap.
2737 do
2738 if context_tool /= Void then
2739 context_tool.start_c_output_pixmap_timer
2740 end
2741 end
2742
2743 stop_c_output_pixmap_timer is
2744 -- Stop timer to draw c output pixmap.
2745 do
2746 if context_tool /= Void then
2747 context_tool.stop_c_output_pixmap_timer
2748 end
2749 end
2750
2751 feature {NONE} -- Implementation
2752
2753 set_stone_after_check (a_stone: STONE) is
2754 local
2755 old_stone: STONE
2756 new_class_stone: CLASSI_STONE
2757 old_class_stone: CLASSI_STONE
2758 conv_classc: CLASSC_STONE
2759 conv_brkstone: BREAKABLE_STONE
2760 cluster_st: CLUSTER_STONE
2761 old_cluster_st: CLUSTER_STONE
2762 feature_stone: FEATURE_STONE
2763 conv_ferrst: FEATURE_ERROR_STONE
2764
2765 ef_stone: EXTERNAL_FILE_STONE
2766 f: FILE
2767
2768 l_format_context: FORMAT_CONTEXT
2769 conv_errst: ERROR_STONE
2770 cl_syntax_stone: CL_SYNTAX_STONE
2771 error_line: INTEGER
2772 class_file: RAW_FILE
2773 class_text_exists: BOOLEAN
2774 same_class: BOOLEAN
2775 test_stone: CLASSI_STONE
2776 conv_ace: ACE_SYNTAX_STONE
2777 externali: EXTERNAL_CLASS_I
2778 external_cons: CONSUMED_TYPE
2779 str: STRING
2780 dotnet_class: BOOLEAN
2781 l_short_formatter: EB_SHORT_FORMATTER
2782 l_flat_formatter: EB_FLAT_SHORT_FORMATTER
2783 l_main_formatter: EB_CLASS_TEXT_FORMATTER
2784 app_exec: APPLICATION_EXECUTION
2785 do
2786 -- the text does not change if the text was saved with syntax errors
2787 cur_wid := window
2788 if cur_wid = Void then
2789 --| Do nothing.
2790 else
2791 if old_cur = Void then
2792 old_cur := cur_wid.pointer_style
2793 end
2794 -- cur_wid.enable_capture
2795 cur_wid.set_pointer_style (Wait_cursor)
2796 end
2797
2798 conv_brkstone ?= a_stone
2799 conv_errst ?= a_stone
2800 conv_ace ?= a_stone
2801 ef_stone ?= a_stone
2802 if conv_brkstone /= Void then
2803 app_exec := Debugger_manager.application
2804 if app_exec.is_breakpoint_enabled (conv_brkstone.routine, conv_brkstone.index) then
2805 app_exec.remove_breakpoint (conv_brkstone.routine, conv_brkstone.index)
2806 else
2807 app_exec.set_breakpoint (conv_brkstone.routine, conv_brkstone.index)
2808 end
2809 Debugger_manager.notify_breakpoints_changes
2810 elseif conv_errst /= Void then
2811 display_error_help_cmd.execute_with_stone (conv_errst)
2812 elseif conv_ace /= Void then
2813 --| FIXME XR: What should we do?!
2814 elseif ef_stone /= Void then
2815 f := ef_stone.file
2816 f.make_open_read (f.name)
2817 f.read_stream (f.count)
2818 f.close
2819 editor_tool.text_area.load_text (f.last_string)
2820 else
2821 -- Remember previous stone.
2822 old_stone := stone
2823 old_class_stone ?= stone
2824 old_cluster_st ?= stone
2825
2826 -- New stone properties
2827 new_class_stone ?= a_stone
2828
2829 -- Set the stone.
2830 old_set_stone (a_stone)
2831 cluster_st ?= a_stone
2832
2833 new_feature_cmd.disable_sensitive
2834 toggle_feature_alias_cmd.disable_sensitive
2835 toggle_feature_signature_cmd.disable_sensitive
2836 toggle_feature_assigner_cmd.disable_sensitive
2837
2838 -- We update the state of the `Add to Favorites' command.
2839 if new_class_stone /= Void then
2840 favorites_menu.first.enable_sensitive
2841 else
2842 favorites_menu.first.disable_sensitive
2843 end
2844
2845 -- Update the address manager if needed.
2846 address_manager.refresh
2847 if new_class_stone /= Void then
2848 -- Text is now editable.
2849 editor_tool.text_area.set_read_only (False)
2850
2851 -- class stone was dropped
2852 create class_file.make (new_class_stone.class_i.file_name)
2853 class_text_exists := class_file.exists
2854 feature_stone ?= a_stone
2855 --| We have to create a classi_stone to check whether the stones are really similar.
2856 --| Otherwise a redefinition of same_as may be called.
2857 create test_stone.make (new_class_stone.class_i)
2858 if test_stone.same_as (old_class_stone) then
2859 same_class := True
2860 end
2861 if not feature_stone_already_processed then
2862 if same_class and then text_saved then
2863 -- nothing changed in the editor
2864 -- we only have to update click_list
2865 if editor_tool.text_area.is_editable then
2866 editor_tool.text_area.update_click_list (False)
2867 end
2868 else
2869 if changed then
2870 -- user has already chosen not to save the file
2871 -- do not ask again
2872 Feature_positions.wipe_out
2873 editor_tool.text_area.no_save_before_next_load
2874 end
2875 end
2876 end
2877
2878 conv_classc ?= new_class_stone
2879
2880 -- First choose possible formatter
2881 l_main_formatter ?= new_class_stone.pos_container
2882 if l_main_formatter /= Void and not during_synchronization then
2883 if
2884 not (conv_classc /= Void and class_text_exists and (not changed or not same_class))
2885 then
2886 l_main_formatter.enable_select
2887 elseif feature_stone = Void then
2888 if l_main_formatter /= pos_container then
2889 l_main_formatter.enable_select
2890 end
2891 if new_class_stone.position > 0 then
2892 editor_tool.text_area.display_line_at_top_when_ready (new_class_stone.position)
2893 end
2894 end
2895 end
2896
2897 if conv_classc = Void or else
2898 conv_classc.e_class.is_external or else
2899 feature_stone /= Void and not
2900 feature_stone_already_processed and not
2901 (same_class and context_tool.sending_stone) then
2902 -- If a classi_stone or a feature_stone or a external call
2903 -- has been dropped, check to see if a .NET class.
2904 if class_text_exists then
2905 if new_class_stone.class_i.is_external_class then
2906 externali ?= new_class_stone.class_i
2907 check
2908 externali_not_void: externali /= Void
2909 end
2910 external_cons := externali.external_consumed_type
2911 if external_cons /= Void then
2912 -- A .NET class.
2913 dotnet_class := True
2914 l_short_formatter ?= managed_main_formatters.i_th (4)
2915 l_flat_formatter ?= managed_main_formatters.i_th (5)
2916 if l_short_formatter /= Void then
2917 l_short_formatter.set_dotnet_mode (True)
2918 end
2919 if l_flat_formatter /= Void then
2920 l_flat_formatter.set_dotnet_mode (True)
2921 end
2922 end
2923 elseif feature_stone /= Void then
2924 from
2925 managed_main_formatters.start
2926 until
2927 managed_main_formatters.after
2928 loop
2929 managed_main_formatters.item.set_stone (new_class_stone)
2930 managed_main_formatters.forth
2931 end
2932 else
2933 managed_main_formatters.first.set_stone (new_class_stone)
2934 managed_main_formatters.first.execute
2935 end
2936 else
2937 editor_tool.text_area.clear_window
2938 editor_tool.text_area.display_message (
2939 Warning_messages.w_file_not_exist (
2940 new_class_stone.class_i.file_name))
2941 end
2942 end
2943 if conv_classc = Void then
2944 --| The dropped class is not compiled.
2945 --| Display only the textual formatter.
2946 if dotnet_class then
2947 managed_main_formatters.i_th (4).set_stone (new_class_stone)
2948 managed_main_formatters.i_th (5).set_stone (new_class_stone)
2949 managed_main_formatters.i_th (4).execute
2950 end
2951 address_manager.disable_formatters
2952 else
2953 --| We have a compiled class.
2954 if
2955 class_text_exists and then
2956 Eiffel_project.Workbench.last_reached_degree <= 2
2957 then
2958 new_feature_cmd.enable_sensitive
2959 toggle_feature_alias_cmd.enable_sensitive
2960 toggle_feature_signature_cmd.enable_sensitive
2961 toggle_feature_assigner_cmd.enable_sensitive
2962 end
2963
2964 --address_manager.enable_formatters
2965 update_formatters
2966 if not class_text_exists then
2967 --| Disable the textual formatter.
2968 managed_main_formatters.first.disable_sensitive
2969 from
2970 managed_main_formatters.start
2971 until
2972 managed_main_formatters.after
2973 loop
2974 managed_main_formatters.item.set_stone (new_class_stone)
2975 managed_main_formatters.forth
2976 end
2977 managed_main_formatters.i_th (2).execute
2978 else
2979 if not changed or not same_class then
2980 --| Enable all formatters.
2981 if
2982 (not feature_stone_already_processed or
2983 not managed_main_formatters.first.selected) and
2984 feature_stone = Void
2985 then
2986 from
2987 managed_main_formatters.start
2988 until
2989 managed_main_formatters.after
2990 loop
2991 managed_main_formatters.item.set_stone (new_class_stone)
2992 managed_main_formatters.forth
2993 end
2994 end
2995 else
2996 if not feature_stone_already_processed then
2997 address_manager.disable_formatters
2998 from
2999 managed_main_formatters.start
3000 until
3001 managed_main_formatters.after
3002 loop
3003 managed_main_formatters.item.set_stone (new_class_stone)
3004 managed_main_formatters.forth
3005 end
3006 end
3007 end
3008 end
3009 end
3010 if managed_main_formatters.first.selected then
3011 editor_tool.text_area.set_read_only (false)
3012 else
3013 editor_tool.text_area.set_read_only (true)
3014 end
3015 else
3016 -- not a class text : cannot be edited
3017 editor_tool.text_area.set_read_only (True)
3018 address_manager.disable_formatters
3019
3020 --| Disable all formatters.
3021 from
3022 managed_main_formatters.start
3023 until
3024 managed_main_formatters.after
3025 loop
3026 managed_main_formatters.item.set_stone (Void)
3027 managed_main_formatters.forth
3028 end
3029 if cluster_st /= Void then
3030 --| FIXME XR: Really manage cluster display in the main editor
3031 l_format_context := formatted_context_for_cluster (cluster_st.cluster_i)
3032 editor_tool.text_area.process_text (l_format_context.text)
3033 if cluster_st.position > 0 then
3034 editor_tool.text_area.display_line_at_top_when_ready (cluster_st.position)
3035 end
3036 --| END FIXME
3037 end
3038 end
3039 if class_text_exists then
3040 if feature_stone /= Void and not feature_stone_already_processed and not (same_class and context_tool.sending_stone) then
3041 conv_ferrst ?= feature_stone
3042 if conv_ferrst /= Void then
3043 error_line := conv_ferrst.line_number
3044 else
3045 -- if a feature_stone has been dropped
3046 -- scroll to the corresponding feature in the basic text format
3047 if not during_synchronization then
3048 scroll_to_feature (feature_stone.e_feature, new_class_stone.class_i)
3049 end
3050 end
3051 else
3052 cl_syntax_stone ?= a_stone
3053 if cl_syntax_stone /= Void then
3054 error_line := cl_syntax_stone.line
3055 end
3056 end
3057 if error_line > 0 then
3058 -- Scroll to the line of the error.
3059 editor_tool.text_area.display_line_when_ready (error_line, True)
3060 end
3061 end
3062 -- Update the title of the window
3063 if a_stone /= Void then
3064 if changed then
3065 str := a_stone.header.twin
3066 str.prepend ("* ")
3067 set_title (str)
3068 else
3069 set_title (a_stone.header)
3070 end
3071 else
3072 set_title (Interface_names.t_empty_development_window)
3073 end
3074
3075 -- Refresh the tools.
3076 features_tool.set_stone (a_stone)
3077 cluster_tool.set_stone (a_stone)
3078 -- Update the context tool.
3079 if unified_stone then
3080 context_tool.set_stone (a_stone)
3081 end
3082
3083 end
3084 if
3085 stone /= Void and then
3086 not unified_stone
3087 then
3088 send_stone_to_context_cmd.enable_sensitive
3089 else
3090 send_stone_to_context_cmd.disable_sensitive
3091 end
3092 if cur_wid = Void then
3093 --| Do nothing.
3094 else
3095 cur_wid.set_pointer_style (old_cur)
3096 old_cur := Void
3097 -- cur_wid.disable_capture
3098 cur_wid := Void
3099 end
3100 end
3101
3102 formatted_context_for_cluster (a_cluster: CLUSTER_I): FORMAT_CONTEXT is
3103 -- Formatted context representing the list of classes inside `a_cluster'.
3104 require
3105 a_cluster_not_void: a_cluster /= Void
3106 local
3107 l_assembly: ASSEMBLY_I
3108 l_sorted_cluster: EB_SORTED_CLUSTER
3109 l_format_context: FORMAT_CONTEXT
3110 l_indexes: INDEXING_CLAUSE_AS
3111 l_classes: LIST [CLASS_I]
3112 l_subclu: LIST [EB_SORTED_CLUSTER]
3113 l_cl_i: CLASS_I
3114 l_list_cl_i: LIST [CLASS_I]
3115 l_cluster: CLUSTER_I
3116 l_assert_level: ASSERTION_I
3117 do
3118 create l_format_context.make_for_case
3119
3120 l_format_context.put_text_item (ti_indexing_keyword)
3121 l_format_context.put_new_line
3122 l_format_context.indent
3123 if a_cluster.is_assembly then
3124 l_assembly ?= a_cluster
3125 check l_assembly /= Void end
3126 l_format_context.put_text_item (create {INDEXING_TAG_TEXT}.make ("assembly_name"))
3127 l_format_context.put_text_item_without_tabs (ti_colon)
3128 l_format_context.put_space
3129 l_format_context.put_quoted_string_item (l_assembly.assembly_name)
3130 l_format_context.put_new_line
3131 l_format_context.put_text_item (create {INDEXING_TAG_TEXT}.make ("assembly_path"))
3132 l_format_context.put_text_item_without_tabs (ti_colon)
3133 l_format_context.put_space
3134 l_format_context.put_quoted_string_item (l_assembly.assembly_path)
3135 l_format_context.put_new_line
3136
3137 end
3138 l_format_context.put_text_item (create {INDEXING_TAG_TEXT}.make ("cluster"))
3139 l_format_context.put_text_item_without_tabs (ti_colon)
3140 l_format_context.put_space
3141 l_format_context.put_quoted_string_item (a_cluster.cluster_name)
3142
3143 l_format_context.put_new_line
3144 l_format_context.put_text_item (create {INDEXING_TAG_TEXT}.make ("cluster_path"))
3145 l_format_context.put_text_item_without_tabs (ti_colon)
3146 l_format_context.put_space
3147 l_format_context.put_quoted_string_item (a_cluster.path)
3148 l_format_context.put_new_line
3149 l_indexes := a_cluster.indexes
3150 if l_indexes /= Void then
3151 l_format_context.format_indexing_with_no_keyword (l_indexes)
3152 l_format_context.put_new_line
3153 end
3154
3155 if a_cluster.parent_cluster /= Void then
3156 l_format_context.put_text_item (create {INDEXING_TAG_TEXT}.make ("parent cluster"))
3157 l_format_context.put_text_item_without_tabs (ti_colon)
3158 l_format_context.put_new_line
3159 l_format_context.indent
3160 l_format_context.put_manifest_string (" - ")
3161
3162 l_format_context.put_clusteri (a_cluster.parent_cluster)
3163 l_format_context.put_new_line
3164 l_format_context.exdent
3165 end
3166
3167 create l_sorted_cluster.make (a_cluster)
3168
3169 if not l_sorted_cluster.clusters.is_empty then
3170 l_format_context.put_text_item (create {INDEXING_TAG_TEXT}.make ("sub cluster(s)"))
3171 l_format_context.put_text_item_without_tabs (ti_colon)
3172 l_format_context.put_new_line
3173 l_format_context.indent
3174 from
3175 l_subclu := l_sorted_cluster.clusters
3176 l_subclu.start
3177 until
3178 l_subclu.after
3179 loop
3180 l_cluster := l_subclu.item.actual_cluster
3181 l_format_context.put_manifest_string (" - ")
3182 l_format_context.put_clusteri (l_cluster)
3183 l_format_context.put_space
3184 l_format_context.put_text_item_without_tabs (ti_L_parenthesis)
3185 l_format_context.put_comment_text (l_cluster.classes.count.out)
3186 l_format_context.put_text_item_without_tabs (ti_R_parenthesis)
3187 l_format_context.put_new_line
3188 l_subclu.forth
3189 end
3190 l_format_context.exdent
3191 end
3192
3193 if not l_sorted_cluster.classes.is_empty then
3194 l_format_context.put_text_item (create {INDEXING_TAG_TEXT}.make ("class(es)"))
3195 l_format_context.put_text_item_without_tabs (ti_colon)
3196 l_format_context.put_new_line
3197 l_format_context.indent
3198 from
3199 l_classes := l_sorted_cluster.classes
3200 l_classes.start
3201 until
3202 l_classes.after
3203 loop
3204 l_cl_i := l_classes.item
3205 l_assert_level := l_cl_i.assertion_level
3206 l_format_context.put_manifest_string (" - ")
3207 l_format_context.put_classi (l_cl_i)
3208 l_format_context.put_text_item_without_tabs (ti_colon)
3209 if l_cl_i.compiled then
3210 if l_assert_level.check_all then
3211 l_format_context.put_space
3212 l_format_context.put_text_item_without_tabs (ti_All_keyword)
3213 elseif l_assert_level.level = 0 then
3214 l_format_context.put_space
3215 l_format_context.put_comment_text (once "None")
3216 else
3217 if l_assert_level.check_precond then
3218 l_format_context.put_space
3219 l_format_context.put_text_item_without_tabs (ti_Require_keyword)
3220 end
3221 if l_assert_level.check_postcond then
3222 l_format_context.put_space
3223 l_format_context.put_text_item_without_tabs (ti_Ensure_keyword)
3224 end
3225 if l_assert_level.check_check then
3226 l_format_context.put_space
3227 l_format_context.put_text_item_without_tabs (ti_Check_keyword)
3228 end
3229 if l_assert_level.check_loop then
3230 l_format_context.put_space
3231 l_format_context.put_text_item_without_tabs (ti_Loop_keyword)
3232 end
3233 if l_assert_level.check_invariant then
3234 l_format_context.put_space
3235 l_format_context.put_text_item_without_tabs (ti_Invariant_keyword)
3236 end
3237 end
3238 else
3239 l_format_context.put_comment_text (" Not in system.")
3240 end
3241 l_format_context.put_new_line
3242 l_classes.forth
3243 end
3244 l_format_context.exdent
3245 end
3246
3247 if not a_cluster.overriden_classes.is_empty then
3248 l_format_context.put_text_item (create {INDEXING_TAG_TEXT}.make ("overriden class(es)"))
3249 l_format_context.put_text_item_without_tabs (ti_colon)
3250 l_format_context.put_new_line
3251 l_format_context.indent
3252 from
3253 l_classes := a_cluster.overriden_classes.linear_representation
3254 l_classes.start
3255 until
3256 l_classes.after
3257 loop
3258 l_cl_i := l_classes.item
3259 l_format_context.put_manifest_string (" - ")
3260 l_format_context.put_classi (l_cl_i)
3261 l_list_cl_i := eiffel_universe.classes_with_name (l_cl_i.name)
3262 if l_list_cl_i /= Void and then not l_list_cl_i.is_empty then
3263 l_format_context.put_text_item_without_tabs (ti_colon)
3264 l_format_context.put_comment_text (" overriden by")
3265 from
3266 l_list_cl_i.start
3267 until
3268 l_list_cl_i.after
3269 loop
3270 l_cluster := l_list_cl_i.item.cluster
3271 if l_cluster /= a_cluster then
3272 l_format_context.put_space
3273 l_format_context.put_text_item_without_tabs (ti_double_quote)
3274 l_format_context.put_clusteri (l_list_cl_i.item.cluster)
3275 l_format_context.put_text_item_without_tabs (ti_double_quote)
3276 end
3277 l_list_cl_i.forth
3278 end
3279 end
3280 l_format_context.put_new_line
3281 l_classes.forth
3282 end
3283 l_format_context.exdent
3284 l_format_context.put_new_line
3285 end
3286
3287 l_format_context.exdent
3288 l_format_context.put_new_line
3289 Result := l_format_context
3290 ensure
3291 result_not_void: Result /= Void
3292 end
3293
3294 scroll_to_feature (feat_as: E_FEATURE; displayed_class: CLASS_I) is
3295 -- highlight the feature correspnding to `feat_as' in the class represented by `displayed_class'
3296 require
3297 class_is_not_void: displayed_class /= Void
3298 feat_as_is_not_void: feat_as /= Void
3299 local
3300 begin_index, offset: INTEGER
3301 tmp_text: STRING
3302 do
3303 if not feat_as.is_il_external then
3304 if not managed_main_formatters.first.selected then
3305 if feat_as.ast /= Void then
3306 editor_tool.text_area.find_feature_named (feat_as.name)
3307 end
3308 else
3309 if feat_as.ast /= Void then
3310 begin_index := feat_as.ast.start_position
3311 tmp_text := displayed_class.text.substring (1, begin_index)
3312 offset := tmp_text.occurrences('%R')
3313 editor_tool.text_area.scroll_to_when_ready (begin_index.item - offset)
3314 end
3315 end
3316 else
3317 if not managed_main_formatters.first.selected then
3318 managed_main_formatters.first.execute
3319 end
3320 -- FIXME NC: Doesn't work properly for .NET features
3321 -- .NET formatted feature.
3322 begin_index := feature_positions.item (feat_as)
3323 if platform_constants.is_windows then
3324 tmp_text := displayed_class.text.substring (1, begin_index)
3325 offset := tmp_text.occurrences('%N')
3326 end
3327 editor_tool.text_area.scroll_to_when_ready (begin_index // 2) -- - offset)
3328 end
3329 end
3330
3331 check_passed: BOOLEAN
3332
3333 save_canceled: BOOLEAN
3334 -- did user cancel save ?
3335
3336 save_only: BOOLEAN
3337 -- skip parse and update after save ?
3338
3339 text_saved: BOOLEAN
3340 -- has the user chosen to save the file
3341
3342 is_destroying: BOOLEAN
3343 -- Is `current' being currently destroyed?
3344
3345 feature_stone_already_processed: BOOLEAN
3346 -- Is the processed stone a feature stone and has it
3347 -- been already processed by the editor ?
3348
3349 feature {NONE} -- Implementation
3350
3351 update_save_symbol is
3352 do
3353 Precursor {EB_FILEABLE}
3354 if changed then
3355 save_cmd.enable_sensitive
3356 address_manager.disable_formatters
3357 else
3358 save_cmd.disable_sensitive
3359 update_formatters
3360 end
3361 if is_empty then
3362 print_cmd.disable_sensitive
3363 save_as_cmd.disable_sensitive
3364 else
3365 print_cmd.enable_sensitive
3366 save_as_cmd.enable_sensitive
3367 end
3368 end
3369
3370 is_stone_external: BOOLEAN
3371 -- Does 'stone' contain a .NET consumed type?
3372
3373 update_formatters is
3374 -- Give a correct sensitivity to formatters.
3375 local
3376 cist: CLASSI_STONE
3377 cst: CLASSC_STONE
3378 type_changed: BOOLEAN
3379 do
3380 cst ?= stone
3381 cist ?= stone
3382 -- Check to if formatting context has changed.
3383 if cst /= Void then
3384 type_changed := (cst.e_class.is_true_external and not is_stone_external) or
3385 (not cst.e_class.is_true_external and is_stone_external)
3386 elseif cist /= Void then
3387 type_changed := (cist.class_i.is_external_class and not is_stone_external) or
3388 (not cist.class_i.is_external_class and is_stone_external)
3389 end
3390
3391 if type_changed then
3392 -- Toggle stone flag.
3393 is_stone_external := not is_stone_external
3394 end
3395
3396 if cst /= Void then
3397 address_manager.enable_formatters
3398 if is_stone_external then
3399 -- Change formatters to .NET sensitivity (from normal).
3400 enable_dotnet_formatters
3401 if type_changed then
3402 managed_main_formatters.i_th (4).enable_select
3403 end
3404 else
3405 if changed then
3406 address_manager.disable_formatters
3407 else
3408 --managed_main_formatters.first.disable_sensitive
3409 end
3410 end
3411 elseif cist /= Void and is_stone_external then
3412 -- Change formatters to .NET sensitivity (from normal).
3413 enable_dotnet_formatters
3414 if type_changed then
3415 managed_main_formatters.i_th (4).enable_select
3416 end
3417 else
3418 address_manager.disable_formatters
3419 if cist /= stone then
3420 managed_main_formatters.first.execute
3421 end
3422 end
3423 end
3424
3425 enable_dotnet_formatters is
3426 -- Enable only the .NET class text formatters.
3427 do
3428 from
3429 managed_main_formatters.start
3430 until
3431 managed_main_formatters.after
3432 loop
3433 if managed_main_formatters.item.is_dotnet_formatter then
3434 managed_main_formatters.item.enable_sensitive
3435 else
3436 managed_main_formatters.item.disable_sensitive
3437 end
3438 managed_main_formatters.forth
3439 end
3440 end
3441
3442
3443 on_text_reset is
3444 -- The main editor has just been wiped out
3445 -- before loading a new file.
3446 local
3447 str: STRING
3448 do
3449 str := title.twin
3450 if str @ 1 = '*' then
3451 str.keep_tail (str.count - 2)
3452 set_title (str)
3453 end
3454 address_manager.disable_formatters
3455 status_bar.reset
3456 status_bar.remove_cursor_position
3457 text_edited := False
3458 end
3459
3460 on_cursor_moved is
3461 -- The cursor has moved, reflect the change in the status bar.
3462 -- And reflect location editing in the text in features tool and address bar.
3463 do
3464 refresh_cursor_position
3465 if context_refreshing_timer = Void then
3466 create context_refreshing_timer.make_with_interval (100)
3467 context_refreshing_timer.actions.extend (agent refresh_context_info)
3468 end
3469 if feature_locating then
3470 context_refreshing_timer.set_interval (0)
3471 else
3472 context_refreshing_timer.set_interval (100)
3473 end
3474
3475 end
3476
3477 on_text_fully_loaded is
3478 -- The main editor has just been reloaded.
3479 do
3480 update_paste_cmd
3481 update_formatters
3482 if editor_tool.text_area.syntax_is_correct then
3483 status_bar.reset
3484 else
3485 status_bar.display_message (Interface_names.L_syntax_error)
3486 end
3487 refresh_cursor_position
3488 text_edited := False
3489 end
3490
3491 on_text_back_to_its_last_saved_state is
3492 local
3493 str: STRING
3494 do
3495 str := title.twin
3496 if str @ 1 = '*' then
3497 str.keep_tail (str.count - 2)
3498 set_title (str)
3499 end
3500 update_formatters
3501 text_edited := False
3502 end
3503
3504 text_edited: BOOLEAN
3505 -- Do we know that the text was edited?
3506 -- If so, no need to update the display each time it is edited.
3507
3508 on_text_edited (unused: BOOLEAN) is
3509 -- The text in the editor is modified, add the '*' in the title.
3510 -- Gray out the formatters.
3511 local
3512 str: STRING
3513 cst: CLASSI_STONE
3514 do
3515 if not text_edited then
3516 str := title.twin
3517 if str @ 1 /= '*' then
3518 str.prepend ("* ")
3519 set_title (str)
3520 end
3521 address_manager.disable_formatters
3522 cst ?= stone
3523 if cst /= Void then
3524 Eiffel_project.Manager.class_is_edited (cst.class_i)
3525 end
3526 text_edited := True
3527 end
3528 status_bar.display_message ("")
3529 end
3530
3531 on_back is
3532 -- User pressed Alt+left.
3533 -- Go back in the history (or the context history).
3534 do
3535 if context_tool_has_focus then
3536 if context_tool.history_manager.is_back_possible then
3537 context_tool.history_manager.back_command.execute
3538 end
3539 elseif history_manager.is_back_possible then
3540 history_manager.back_command.execute
3541 end
3542 end
3543
3544 on_forth is
3545 -- User pressed Alt+right.
3546 -- Go forth in the history (or the context history).
3547 do
3548 if context_tool_has_focus then
3549 if context_tool.history_manager.is_forth_possible then
3550 context_tool.history_manager.forth_command.execute
3551 end
3552 elseif history_manager.is_forth_possible then
3553 history_manager.forth_command.execute
3554 end
3555 end
3556
3557 context_tool_has_focus: BOOLEAN is
3558 -- Does the context tool or one of its children has the focus?
3559 local
3560 fw: EV_WIDGET
3561 cont: EV_CONTAINER
3562 wid: EV_WIDGET
3563 do
3564 fw := (create {EV_ENVIRONMENT}).application.focused_widget
3565 wid := context_tool.explorer_bar_item.widget
3566 if wid = fw then
3567 Result := True
3568 elseif fw = Void then
3569 Result := False
3570 else
3571 from
3572 cont := fw.parent
3573 until
3574 cont = wid or cont = Void
3575 loop
3576 cont := cont.parent
3577 end
3578 if cont = wid then
3579 Result := True
3580 end
3581 end
3582 end
3583
3584 saved_cursor: CURSOR
3585 -- Saved cursor position for displaying the stack.
3586
3587 can_drop (st: ANY): BOOLEAN is
3588 -- Can the user drop the stone `st'?
3589 local
3590 conv_ace: ACE_SYNTAX_STONE
3591 do
3592 conv_ace ?= st
3593 Result := conv_ace = Void
3594 end
3595
3596 send_stone_to_context is
3597 -- Send current stone to the context tool.
3598 -- Used by `send_stone_to_context_cmd'.
3599 do
3600 if stone /= Void then
3601 context_tool.set_stone (stone)
3602 end
3603 end
3604
3605 destroy is
3606 -- check if current text has been saved and destroy
3607 local
3608 dialog_w: EV_WARNING_DIALOG
3609 do
3610 if Window_manager.development_windows_count > 1 and then process_manager.is_external_command_running and then Current = external_output_manager.target_development_window then
3611 process_manager.confirm_external_command_termination (agent terminate_external_command_and_destroy, agent do_nothing, window)
3612 else
3613 if editor_tool /= Void and then editor_tool.text_area /= Void and then changed and then not confirmed then
3614 if Window_manager.development_windows_count > 1 then
3615 create dialog_w.make_with_text (Warning_messages.w_save_before_closing)
3616 dialog_w.set_buttons_and_actions (<<"Yes", "No", "Cancel">>, <<agent save_and_destroy, agent force_destroy, agent do_nothing>>)
3617 dialog_w.set_default_push_button (dialog_w.button("Yes"))
3618 dialog_w.set_default_cancel_button (dialog_w.button("Cancel"))
3619 dialog_w.show_modal_to_window (window)
3620 else
3621 -- We let the window manager handle the saving, along with other windows
3622 -- (not development windows)
3623 force_destroy
3624 end
3625 else
3626 Precursor {EB_TOOL_MANAGER}
3627 if context_refreshing_timer /= Void then
3628 context_refreshing_timer.destroy
3629 context_refreshing_timer := Void
3630 end
3631 end
3632 end
3633 end
3634
3635 terminate_external_command_and_destroy is
3636 -- Terminate running external command and destroy.
3637 do
3638 process_manager.terminate_external_command
3639 destroy
3640 ensure
3641 external_command_not_running: not process_manager.is_external_command_running
3642 end
3643
3644 save_and_destroy is
3645 do
3646 save_text
3647 destroy
3648 end
3649
3650 force_destroy is
3651 -- Destroy without asking.
3652 do
3653 confirmed := True
3654 destroy
3655 confirmed := False
3656 end
3657
3658 confirmed: BOOLEAN
3659 -- Did the user say he wanted to exit?
3660
3661 show_dynamic_library_dialog is
3662 -- Create a new dynamic library window and display it.
3663 do
3664 Window_manager.create_dynamic_lib_window
3665 end
3666
3667 context_refreshing_timer: EV_TIMEOUT
3668
3669 recycle is
3670 -- Call the precursors.
3671 do
3672 Precursor {EB_TOOL_MANAGER}
3673 command_controller.recycle
3674 end
3675
3676 feature {NONE} -- Implementation: Editor commands
3677
3678 refresh_cursor_position is
3679 -- Display the current cursor position in the status bar.
3680 require
3681 text_loaded: not is_empty
3682 local
3683 l, c, v: INTEGER
3684 do
3685 l := editor_tool.text_area.cursor_y_position
3686 c := editor_tool.text_area.cursor_x_position
3687 v := editor_tool.text_area.cursor_visible_x_position
3688 status_bar.set_cursor_position (l, c, v)
3689 end
3690
3691 refresh_context_info is
3692 -- Refresh address bar and features tool to relect
3693 -- where in the code the cursor is located.
3694 local
3695 l_feature: FEATURE_AS
3696 l_classc_stone: CLASSC_STONE
3697 do
3698 context_refreshing_timer.set_interval (0)
3699 l_classc_stone ?= stone
3700 if l_classc_stone /= Void then
3701 l_feature := editor_tool.text_area.text_displayed.current_feature_containing
3702 if l_feature /= Void then
3703 set_editing_location_by_feature (l_feature)
3704 else
3705 set_editing_location_by_feature (Void)
3706 end
3707 end
3708 end
3709
3710 set_editing_location_by_feature (a_feature: FEATURE_AS) is
3711 -- Set editing location, feature tool and combo box changes according to `a_feature'.
3712 local
3713 l_efeature: E_FEATURE
3714 l_class_i: CLASS_I
3715 l_classc: CLASS_C
3716 do
3717 if a_feature /= Void then
3718 address_manager.set_feature_text_simply (a_feature.feature_names.first.internal_name)
3719 l_class_i := eiffel_universe.class_named (class_name, cluster)
3720 if l_class_i /= Void and then l_class_i.is_compiled then
3721 l_classc := l_class_i.compiled_class
3722 if l_classc.has_feature_table then
3723 l_efeature := l_classc.feature_with_name (a_feature.feature_names.first.internal_name)
3724 end
3725 end
3726 else
3727 address_manager.set_feature_text_simply (once "")
3728 end
3729 seek_item_in_feature_tool (l_efeature)
3730 end
3731
3732 seek_item_in_feature_tool (a_feature: E_FEATURE) is
3733 -- Seek and select item contains data of `a_feature' in features tool.
3734 -- If `a_feature' is void, deselect item in features tool.
3735 local
3736 l_node: EV_TREE_NODE
3737 l_selected_node: EV_TREE_NODE
3738 do
3739 l_selected_node := features_tool.tree.selected_item
3740 if a_feature /= Void then
3741 l_node := features_tool.tree.retrieve_item_recursively_by_data (a_feature, true)
3742 if l_node /= Void then
3743 l_node.enable_select
3744 if features_tool.tree.is_displayed then
3745 features_tool.tree.ensure_item_visible (l_node)
3746 end
3747 else
3748 if l_selected_node /= Void then
3749 l_selected_node.disable_select
3750 end
3751 end
3752 else
3753 if l_selected_node /= Void then
3754 l_selected_node.disable_select
3755 end
3756 end
3757 end
3758
3759 select_all is
3760 -- Select the whole text in the focused editor.
3761 do
3762 current_editor.select_all
3763 end
3764
3765 search is
3766 -- Search some text in the focused editor.
3767 local
3768 cv_ced: EB_CLICKABLE_EDITOR
3769 do
3770 cv_ced ?= current_editor
3771 if cv_ced /= Void then
3772 cv_ced.search
3773 end
3774 end
3775
3776 goto is
3777 -- Display a dialog to select a line to go to in the editor.
3778 local
3779 ed: EB_EDITOR
3780 do
3781 ed ?= current_editor
3782 if ed /= Void then
3783 create goto_dialog.make (ed)
3784 goto_dialog.show_modal_to_window (Current.window)
3785 end
3786 end
3787
3788 toggle_line_number_display is
3789 -- Toggle line number display on/off in editor
3790 do
3791 preferences.editor_data.show_line_numbers_preference.set_value (not preferences.editor_data.show_line_numbers)
3792 end
3793
3794 find_next is
3795 -- Find the next occurrence of the search text.
3796 local
3797 cv_ced: EB_CLICKABLE_EDITOR
3798 do
3799 if search_tool.currently_searched /= Void then
3800 cv_ced ?= current_editor
3801 if cv_ced /= Void then
3802 cv_ced.find_next
3803 end
3804 else
3805 search_tool.show_and_set_focus
3806 end
3807 end
3808
3809 find_previous is
3810 -- Find the previous occurrence of the search text.
3811 local
3812 cv_ced: EB_CLICKABLE_EDITOR
3813 do
3814 if search_tool.currently_searched /= Void then
3815 cv_ced ?= current_editor
3816 if cv_ced /= Void then
3817 cv_ced.find_previous
3818 end
3819 else
3820 search_tool.show_and_set_focus
3821 end
3822 end
3823
3824 find_selection is
3825 -- Find the next occurrence of the selection.
3826 local
3827 cv_ced: EB_CLICKABLE_EDITOR
3828 do
3829 cv_ced ?= current_editor
3830 if cv_ced /= Void then
3831 cv_ced.find_selection
3832 end
3833 end
3834
3835 cut_selection is
3836 -- Cut the selection in the current editor.
3837 do
3838 current_editor.cut_selection
3839 end
3840
3841 copy_selection is
3842 -- Cut the selection in the current editor.
3843 do
3844 current_editor.copy_selection
3845 end
3846
3847 toggle_formatting_marks is
3848 -- Show/Hide formatting marks in the editor and update related menu item.
3849 do
3850 current_editor.toggle_view_invisible_symbols
3851 if current_editor.view_invisible_symbols then
3852 formatting_marks_command_menu_item.set_text (Interface_names.m_hide_formatting_marks)
3853 else
3854 formatting_marks_command_menu_item.set_text(Interface_names.m_show_formatting_marks)
3855 end
3856 end
3857
3858 feature {NONE} -- Implementation / Menus
3859
3860 number_of_displayed_external_commands: INTEGER
3861 -- Number of external commands in the tools menu.
3862
3863 old_cur: EV_CURSOR
3864 -- Cursor saved while displaying the hourglass cursor.
3865
3866 cur_wid: EV_WIDGET
3867 -- Widget on which the hourglass cursor was set.
3868
3869 project_menu: EV_MENU
3870 -- Menu for entries relative to the Project.
3871
3872 recent_projects_menu: EB_RECENT_PROJECTS_MANAGER_MENU
3873 -- SubMenu for recent projects.
3874
3875 during_synchronization: BOOLEAN
3876 -- Are we during a resynchronization?
3877
3878 formatting_marks_command_menu_item: EB_COMMAND_MENU_ITEM
3879 -- Menu item used to shw/hide formatting marks.
3880
3881 undo_accelerator: EV_ACCELERATOR
3882 -- Accelerator for Ctrl+Z
3883
3884 redo_accelerator: EV_ACCELERATOR
3885 -- Accelerator for Ctrl+Y
3886
3887 feature {EB_TOOL} -- Implementation / Commands
3888
3889 shell_cmd: EB_OPEN_SHELL_COMMAND
3890 -- Command to use an external editor.
3891
3892 undo_cmd: EB_UNDO_COMMAND
3893 -- Command to undo in the editor.
3894
3895 redo_cmd: EB_REDO_COMMAND
3896 -- Command to redo in the editor.
3897
3898 editor_cut_cmd: EB_ON_SELECTION_COMMAND
3899 -- Command to cut text in the editor.
3900
3901 editor_copy_cmd: EB_ON_SELECTION_COMMAND
3902 -- Command to copy text in the editor.
3903
3904 editor_paste_cmd: EB_EDITOR_PASTE_COMMAND
3905 -- Command to paste text in the editor.
3906
3907 melt_cmd: EB_MELT_PROJECT_COMMAND
3908 -- Command to start compilation.
3909
3910 feature{EB_TOOL, EB_C_COMPILER_LAUNCHER}
3911
3912 c_workbench_compilation_cmd: EB_C_COMPILATION_COMMAND
3913 -- Command to compile the workbench C code.
3914
3915 c_finalized_compilation_cmd: EB_C_COMPILATION_COMMAND
3916 -- Command to compile the finalized C code.
3917
3918 feature{EB_TOOL}
3919
3920 new_cluster_cmd: EB_NEW_CLUSTER_COMMAND
3921 -- Command to create a new cluster.
3922
3923 new_class_cmd: EB_NEW_CLASS_COMMAND
3924 -- Command to create a new class.
3925
3926 new_feature_cmd: EB_NEW_FEATURE_COMMAND
3927 -- Command to execute the feature wizard.
3928
3929 toggle_feature_alias_cmd: EB_TOGGLE_FEATURE_ALIAS_COMMAND
3930 -- Show/Hide alias name of feature node in eb_feature_tool
3931
3932 toggle_feature_signature_cmd: EB_TOGGLE_FEATURE_SIGNATURE_COMMAND
3933 -- Show/Hide signature of feature node in eb_feature_tool
3934
3935 toggle_feature_assigner_cmd: EB_TOGGLE_FEATURE_ASSIGNER_COMMAND
3936 -- Show/Hide assigner name of feature node in eb_feature_tool
3937
3938 toggle_stone_cmd: EB_UNIFY_STONE_CMD
3939 -- Command to toggle between the stone management modes.
3940
3941 delete_class_cluster_cmd: EB_DELETE_CLASS_CLUSTER_COMMAND
3942 -- Command to remove a class or a cluster from the system
3943 -- (permanent deletion).
3944
3945 show_profiler: EB_SHOW_PROFILE_TOOL
3946 -- What allows us to display the profiler window.
3947
3948 toolbarable_commands: ARRAYED_LIST [EB_TOOLBARABLE_COMMAND]
3949 -- All commands that can be put in a toolbar.
3950
3951 command_controller: EB_EDITOR_COMMAND_CONTROLLER
3952 -- Object that takes care of updating the sensitivity of all editor commands.
3953
3954 save_as_cmd: EB_SAVE_FILE_AS_COMMAND
3955 -- Command to save a class with a different file name.
3956
3957 feature{EB_TOOL, EB_EXTERNAL_OUTPUT_TOOL}
3958
3959 Edit_external_commands_cmd: EB_EXTERNAL_COMMANDS_EDITOR is
3960 -- Command that lets the user add new external commands to the tools menu.
3961 once
3962 create Result.make
3963 Result.enable_sensitive
3964 end
3965
3966 feature{EB_TOOL}
3967
3968 system_info_cmd: EB_STANDARD_CMD is
3969 -- Command to display information about the system (root class,...)
3970 do
3971 Result := Eb_debugger_manager.system_info_cmd
3972 end
3973
3974 display_error_help_cmd: EB_ERROR_INFORMATION_CMD is
3975 -- Command to pop up a dialog giving help on compilation errors.
3976 do
3977 Result := Eb_debugger_manager.display_error_help_cmd
3978 end
3979
3980 send_stone_to_context_cmd: EB_STANDARD_CMD
3981 -- Command to send the current stone to the context tool.
3982
3983 print_cmd: EB_PRINT_COMMAND
3984 -- Command to print the content of editor with focus
3985
3986 eac_browser_cmd: EB_OPEN_EAC_BROWSER_CMD is
3987 -- Command to display the eac browser
3988 do
3989 Result := Eb_debugger_manager.eac_browser_cmd
3990 end
3991
3992 show_favorites_menu_item: EV_MENU_ITEM
3993 -- Show/Hide favorites menu item.
3994
3995 update_show_favorites_menu_item is
3996 -- Update `show_favorites_menu_item' menu label.
3997 do
3998 if favorites_tool.shown then
3999 show_favorites_menu_item.set_text (Interface_names.m_hide_favorites)
4000 else
4001 show_favorites_menu_item.set_text (Interface_names.m_show_favorites)
4002 end
4003 end
4004
4005 execute_show_favorites is
4006 -- Show `favorites_tool' if it is closed, close
4007 -- it in the opposite case.
4008 do
4009 update_show_favorites_menu_item
4010 if favorites_tool.shown then
4011 favorites_tool.close
4012 else
4013 favorites_tool.show
4014 end
4015 end
4016
4017 feature {EB_TOOL_WINDOW, EB_EXPLORER_BAR, EB_DEBUGGER_MANAGER} -- Floating tool handling
4018
4019 all_tool_windows: ARRAYED_LIST [EB_TOOL_WINDOW]
4020 -- All tool windows under the control of `Current'.
4021
4022 add_tool_window (a_tool_window: EB_TOOL_WINDOW) is
4023 -- Add `a_tool_window' to `all_tool_windows', ensuring it is
4024 -- then under the control of `Current'.
4025 require
4026 a_tool_window_not_void: a_tool_window /= Void
4027 do
4028 if all_tool_windows = Void then
4029 create all_tool_windows.make (2)
4030 end
4031 all_tool_windows.extend (a_tool_window)
4032 ensure
4033 extended: all_tool_windows.has (a_tool_window)
4034 end
4035
4036 remove_tool_window (a_widget: EV_WIDGET) is
4037 -- Remove tool window associate with `a_widget'.
4038 require
4039 a_widget_not_void: a_widget /= Void
4040 do
4041 if all_tool_windows /= Void then
4042 from
4043 all_tool_windows.start
4044 until
4045 all_tool_windows.off
4046 loop
4047 if all_tool_windows.item.tool = a_widget then
4048 all_tool_windows.remove
4049 all_tool_windows.finish
4050 end
4051 all_tool_windows.forth
4052 end
4053 end
4054 end
4055
4056 remove_all_tool_windows is
4057 -- Ensure `all_tool_windows' is empty if non Void.
4058 do
4059 if all_tool_windows /= Void then
4060 all_tool_windows.wipe_out
4061 end
4062 ensure
4063 tool_windows_empty: all_tool_windows /= Void implies all_tool_windows.is_empty
4064 end
4065
4066 window_moved (x_pos, y_pos: INTEGER) is
4067 -- `Current' has been moved, so move all associated tool windows within `all_tool_windows'.
4068 local
4069 tool_window: EB_TOOL_WINDOW
4070 do
4071 if all_tool_windows /= Void then
4072 from
4073 all_tool_windows.start
4074 until
4075 all_tool_windows.off
4076 loop
4077 tool_window := all_tool_windows.item
4078 check
4079 not_destroyed: not tool_window.window.is_destroyed
4080 end
4081 if preferences.development_window_data.dock_tracking then
4082 tool_window.window.move_actions.block
4083 tool_window.window.set_x_position (x_pos + tool_window.x_position)
4084 tool_window.window.set_y_position (y_pos + tool_window.y_position)
4085 tool_window.window.move_actions.resume
4086 else
4087 -- If we are not performing dock tracking, we must update the relative position
4088 -- of the tool window, so that if dock tracking is enabled, the relative
4089 -- positions are correct.
4090 tool_window.set_x_position ( tool_window.window.screen_x - x_pos)
4091 tool_window.set_y_position ( tool_window.window.screen_y - y_pos)
4092 end
4093 all_tool_windows.forth
4094 end
4095 end
4096 end
4097
4098 feature {NONE} -- Execution
4099
4100 toolbar_right_click_action (a_x, a_y, a_button: INTEGER; a_x_tilt, a_y_tilt, a_pressure: DOUBLE; a_screen_x, a_screen_y: INTEGER) is
4101 -- Action called when the user right-click in the toolbar.
4102 -- Display a popup menu to show/hide toolbars and customize the general toolbar.
4103 local
4104 popup_menu: EV_MENU
4105 do
4106 if a_button = 3 then
4107 popup_menu := build_toolbar_menu
4108 popup_menu.show
4109 end
4110 end
4111
4112 enable_commands_on_project_created is
4113 -- Enable commands when a new project has been created (not yet compiled)
4114 do
4115 system_info_cmd.enable_sensitive
4116 if
4117 stone /= Void and then
4118 not unified_stone
4119 then
4120 send_stone_to_context_cmd.enable_sensitive
4121 end
4122 end
4123
4124 enable_commands_on_project_loaded is
4125 -- Enable commands when a new project has been created and compiled
4126 do
4127 if has_profiler then
4128 show_profiler.enable_sensitive
4129 end
4130 if has_dll_generation then
4131 show_dynamic_lib_tool.enable_sensitive
4132 end
4133 open_cmd.enable_sensitive
4134 new_class_cmd.enable_sensitive
4135 new_cluster_cmd.enable_sensitive
4136 system_info_cmd.enable_sensitive
4137 if unified_stone then
4138 send_stone_to_context_cmd.disable_sensitive
4139 elseif stone /= Void then
4140 send_stone_to_context_cmd.enable_sensitive
4141 end
4142 new_class_cmd.enable_sensitive
4143 new_cluster_cmd.enable_sensitive
4144 delete_class_cluster_cmd.enable_sensitive
4145 c_workbench_compilation_cmd.enable_sensitive
4146 c_finalized_compilation_cmd.enable_sensitive
4147 end
4148
4149 disable_commands_on_project_unloaded is
4150 -- Enable commands when a project has been closed.
4151 do
4152 if has_dll_generation then
4153 show_dynamic_lib_tool.disable_sensitive
4154 end
4155 if has_profiler then
4156 show_profiler.disable_sensitive
4157 end
4158 open_cmd.disable_sensitive
4159 new_class_cmd.disable_sensitive
4160 new_cluster_cmd.disable_sensitive
4161 if not project_manager.is_created then
4162 system_info_cmd.disable_sensitive
4163 send_stone_to_context_cmd.disable_sensitive
4164 end
4165 delete_class_cluster_cmd.disable_sensitive
4166 c_workbench_compilation_cmd.disable_sensitive
4167 c_finalized_compilation_cmd.disable_sensitive
4168 end
4169
4170 feature {NONE} -- Access
4171
4172 development_window_data: EB_DEVELOPMENT_WINDOW_DATA is
4173 -- Meta data describing `Current'.
4174 do
4175 if internal_development_window_data /= Void then
4176 Result := internal_development_window_data
4177 else
4178 Result := preferences.development_window_data
4179 end
4180 end
4181
4182 internal_development_window_data: EB_DEVELOPMENT_WINDOW_SESSION_DATA;
4183 -- Internal custom meta data for `Current'.
4184
4185 indexing
4186 copyright: "Copyright (c) 1984-2006, Eiffel Software"
4187 license: "GPL version 2 see http://www.eiffel.com/licensing/gpl.txt)"
4188 licensing_options: "http://www.eiffel.com/licensing"
4189 copying: "[
4190 This file is part of Eiffel Software's Eiffel Development Environment.
4191
4192 Eiffel Software's Eiffel Development Environment is free
4193 software; you can redistribute it and/or modify it under
4194 the terms of the GNU General Public License as published
4195 by the Free Software Foundation, version 2 of the License
4196 (available at the URL listed under "license" above).
4197
4198 Eiffel Software's Eiffel Development Environment is
4199 distributed in the hope that it will be useful, but
4200 WITHOUT ANY WARRANTY; without even the implied warranty
4201 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
4202 See the GNU General Public License for more details.
4203
4204 You should have received a copy of the GNU General Public
4205 License along with Eiffel Software's Eiffel Development
4206 Environment; if not, write to the Free Software Foundation,
4207 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
4208 ]"
4209 source: "[
4210 Eiffel Software
4211 356 Storke Road, Goleta, CA 93117 USA
4212 Telephone 805-685-1006, Fax 805-685-6869
4213 Website http://www.eiffel.com
4214 Customer support http://support.eiffel.com
4215 ]"
4216
4217 end -- class EB_DEVELOPMENT_WINDOW

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23