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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62171 - (hide annotations)
Tue Aug 1 01:27:17 2006 UTC (13 years, 6 months ago) by larryl
File size: 55134 byte(s)
First commit docking tabbed Eiffel Studio.
1 manus 26913 indexing
2     description : "Window holding a project tool"
3 manus 56535 legal: "See notice at end of class."
4     status: "See notice at end of class."
5 manus 26913 date : "$Date$"
6     revision : "$Revision$"
7    
8     class
9     EB_DEVELOPMENT_WINDOW
10    
11     inherit
12     EB_TOOL_MANAGER
13 larryl 62171 rename
14     file_menu as file_menu_not_use,
15     edit_menu as edit_menu_not_use,
16     tools_menu as tools_menu_not_use,
17     window_menu as window_menu_not_use,
18     help_menu as help_menu_not_use
19     export
20     {EB_STONE_CHECKER, EB_DEVELOPMENT_WINDOW_BUILDER, EB_DEVELOPMENT_WINDOW_PART}
21     Warning_messages, Interface_names,
22     init_commands, Pixmaps,
23     general_customizable_toolbar
24     {EB_DEVELOPMENT_WINDOW_DIRECTOR}
25     make
26     {EB_DEVELOPMENT_WINDOW_COMMANDS}
27     Debugger_manager
28     {EB_STONE_FIRST_CHECKER}
29     Ev_application
30 manus 26913 redefine
31     make,
32     refresh,
33 xavier 27860 recycle,
34 manus 26913 destroy_imp,
35 tedf 55179 destroy,
36     position,
37     pos_container
38 manus 26913 end
39    
40     EB_FILEABLE
41 tedf 55179 export {NONE}
42     set_position,
43     set_pos_container
44 manus 26913 redefine
45     set_stone,
46     reset,
47     stone,
48     on_text_saved,
49     perform_check_before_save,
50     check_passed,
51 tedf 55179 update_save_symbol,
52     position,
53     pos_container
54 manus 26913 select
55     set_stone
56     end
57    
58     EB_FILEABLE
59     rename
60     set_stone as old_set_stone
61     export {NONE}
62 tedf 55179 set_position,
63     set_pos_container
64 larryl 62171 {EB_STONE_CHECKER}
65     old_set_stone
66 manus 26913 redefine
67     reset,
68     stone,
69     on_text_saved,
70     perform_check_before_save,
71     check_passed,
72 tedf 55179 update_save_symbol,
73     position,
74     pos_container
75 manus 26913 end
76    
77     -- Shared tools & contexts
78    
79     SHARED_EIFFEL_PROJECT
80    
81     PROJECT_CONTEXT
82    
83     EB_SHARED_MANAGERS
84 larryl 62171 export
85     {EB_DEVELOPMENT_WINDOW_BUILDER, EB_DEVELOPMENT_WINDOW_PART} Refactoring_manager
86     end
87 manus 26913
88     EB_SHARED_GRAPHICAL_COMMANDS
89    
90 neilc 49534 EB_SHARED_PREFERENCES
91 xavier 30020 export
92     {NONE} all
93     end
94 manus 26913
95     EV_STOCK_PIXMAPS
96    
97     EB_CONFIRM_SAVE_CALLBACK
98    
99     -- Errors
100     EB_GRAPHICAL_ERROR_MANAGER
101    
102     EV_KEY_CONSTANTS
103     export
104     {NONE} All
105     end
106 manus 51111
107 neilc 49534 EIFFEL_ENV
108     export
109     {NONE} All
110     end
111 manus 51111
112 larryl 62171 EB_PIXMAPABLE_ITEM_PIXMAP_FACTORY
113     export
114     {EB_STONE_FIRST_CHECKER} pixmap_from_class_i
115     end
116    
117 manus 47824 SHARED_TEXT_ITEMS
118     export
119     {NONE} All
120     end
121 manus 26913
122 manus 61261 REFACTORING_HELPER
123     export
124     {NONE} all
125     end
126    
127 larryl 62171 create {EB_DEVELOPMENT_WINDOW_DIRECTOR}
128     make
129 manus 26913
130     feature {NONE} -- Initialization
131    
132     make is
133 larryl 62171 -- Creation method.
134 manus 26913 do
135 larryl 62171 create commands.make (Current)
136     create menus.make (Current)
137     create agents.make (Current)
138     create tools.make (Current)
139     create uis.make (Current)
140 manus 26913 end
141     feature -- Access
142    
143 manus 57886 group: CONF_GROUP is
144     -- Group of current class. Void if none.
145 manus 26913 local
146     classi_stone: CLASSI_STONE
147     cluster_stone: CLUSTER_STONE
148     do
149 manus 57886 classi_stone ?= stone
150     if classi_stone /= Void then
151     Result := classi_stone.group
152     end
153     cluster_stone ?= stone
154     if cluster_stone /= Void then
155     Result := cluster_stone.group
156     end
157 manus 26913 end
158    
159     class_name: STRING is
160     -- Name of the current class, Void if none.
161     local
162     class_stone: CLASSI_STONE
163     do
164     class_stone ?= stone
165     if class_stone /= Void then
166     Result := class_stone.class_name
167     end
168     end
169    
170 larryl 62171 feature -- Querys
171    
172     docking_manager: SD_DOCKING_MANAGER
173     -- Docking manager, one instance per one EB_DEVELOPMENT_WINDOW.
174    
175     editors_manager: EB_EDITORS_MANAGER
176     -- Editors manager
177    
178     feature -- Settings
179    
180     set_docking_manager (a_manager: SD_DOCKING_MANAGER) is
181     -- Set `docking_manager'
182 manus 26913 do
183 larryl 62171 docking_manager := a_manager
184     ensure
185     set: docking_manager = a_manager
186 manus 26913 end
187 manus 51111
188 larryl 62171 set_editors_manager (a_manager: like editors_manager) is
189     -- Set `editors_manager'
190 xavier 30005 do
191 larryl 62171 editors_manager := a_manager
192     ensure
193     set: editors_manager = a_manager
194 xavier 30005 end
195    
196 larryl 62171 feature -- Status setting
197    
198     set_focus_to_main_editor is
199     -- Set focus to main current editor.
200 xavier 30005 do
201 larryl 62171 if editors_manager.current_editor /= Void then
202     editors_manager.select_editor (editors_manager.current_editor)
203     end
204 xavier 30005 end
205    
206 manus 26913 feature -- Window Settings
207    
208     set_initialized is
209     -- Set `initialized' to True.
210     do
211     initialized := True
212     end
213    
214     feature -- Window Properties
215    
216     changed: BOOLEAN is
217     -- Has something been changed and not yet been saved?
218     do
219 larryl 62171 if editors_manager.current_editor /= Void then
220     Result := editors_manager.current_editor.changed
221     end
222 manus 26913 end
223    
224 larryl 62171 any_editor_changed: BOOLEAN
225     -- Has any editor been changed?
226     do
227     Result := editors_manager.changed
228     end
229    
230 manus 26913 is_empty: BOOLEAN is
231     -- Does `Current's text is empty?
232     do
233 larryl 62171 Result := editors_manager = Void or else editors_manager.current_editor = Void or else editors_manager.current_editor.is_empty
234 manus 26913 end
235    
236     text: STRING is
237     -- Text representing Current
238     do
239 larryl 62171 if editors_manager.current_editor /= Void then
240     Result := editors_manager.current_editor.text
241     end
242 manus 26913 end
243    
244     pixmap: EV_PIXMAP is
245     -- Pixmap representing Current window.
246     do
247 paulb 60407 Result := pixmaps.icon_pixmaps.general_dialog_icon
248 manus 26913 end
249    
250 larryl 62171 close_focusing_content is
251     -- Close focusing content.
252     local
253     l_content: SD_CONTENT
254     l_tools: ARRAYED_LIST [EB_TOOL]
255     l_tool: EB_TOOL
256     l_comb: EV_COMBO_BOX
257     l_is_comb: BOOLEAN
258 manus 26913 do
259 larryl 62171 l_content := docking_manager.focused_content
260     l_comb ?= ev_application.focused_widget
261     l_is_comb := l_comb /= Void
262     if l_content /= Void then
263     l_tools := tools.all_tools
264     from
265     l_tools.start
266     until
267     l_tools.after or l_tool /= Void
268     loop
269     if l_tools.item.content = l_content then
270     l_tool := l_tools.item
271     end
272     l_tools.forth
273     end
274     if l_tool /= Void and then (l_tool.has_focus or not l_is_comb) then
275     l_tool.close
276     else
277     if editors_manager.current_editor /= Void and then
278     editors_manager.current_editor.docking_content = l_content and then
279     (editors_manager.current_editor.has_focus or not l_is_comb)
280     then
281     editors_manager.close_editor (editors_manager.current_editor)
282     end
283     end
284 manus 26913 end
285     end
286    
287     feature -- Update
288    
289     synchronize is
290     -- Synchronize stones.
291     local
292     st: STONE
293 patrickr 56804 l_text_area: EB_SMART_EDITOR
294 manus 26913 do
295     during_synchronization := True
296     favorites_manager.refresh
297 larryl 62171
298     tools.synchronize
299    
300     if has_case then
301     tools.metric_tool.set_recompiled (True)
302     end
303     if not unified_stone then
304    
305     end
306     tools.class_tool.invalidate
307     tools.features_relation_tool.invalidate
308     if has_case then
309     tools.diagram_tool.synchronize
310     end
311    
312     tools.cluster_tool.synchronize
313 manus 26913 history_manager.synchronize
314 larryl 62171 tools.features_tool.synchronize
315     tools.breakpoints_tool.synchronize
316 alexk 53977 -- Update main views
317     managed_main_formatters.i_th (2).invalidate
318     managed_main_formatters.i_th (3).invalidate
319     managed_main_formatters.i_th (4).invalidate
320     managed_main_formatters.i_th (5).invalidate
321 manus 26913 if stone /= Void then
322     st := stone.synchronized_stone
323     end
324 larryl 62171 l_text_area := editors_manager.current_editor
325     if l_text_area /= Void then
326     l_text_area.update_click_list (False)
327     if l_text_area.file_loaded then
328     l_text_area.check_document_modifications_and_reload
329     end
330 patrickr 56804 end
331 larryl 62171
332 manus 26913 set_stone (st)
333     update_save_symbol
334     address_manager.refresh
335     during_synchronization := False
336 larryl 62171 tools.search_tool.rebuild_scope_list
337 manus 26913 end
338 manus 55527
339 manus 26913 synchronize_routine_tool_to_default is
340     -- Synchronize the editor tool to the debug format.
341     do
342     --| FIXME ARNAUD: To be implemented
343     end
344    
345     clear_object_tool is
346     -- Clear the contents of the object tool if shown.
347     do
348     --| FIXME ARNAUD: To be implemented
349     end
350    
351     feature -- Stone process
352    
353     stone: STONE
354     -- Current stone
355    
356     toggle_unified_stone is
357     -- Change the stone management mode.
358     do
359     unified_stone := not unified_stone
360     if unified_stone then
361     send_stone_to_context
362 larryl 62171 commands.send_stone_to_context_cmd.disable_sensitive
363     -- To be implemented.
364     -- tools.context_tool.link_to_development_window
365 manus 26913 else
366     if stone /= Void then
367 larryl 62171 commands.send_stone_to_context_cmd.enable_sensitive
368 manus 26913 end
369 larryl 62171 -- To be implemented.
370     -- tools.context_tool.cut_from_development_window
371 manus 26913 end
372     end
373    
374     set_stone (a_stone: STONE) is
375 xavier 29993 -- Change the currently focused stone.
376     local
377 xavier 30037 cd: STANDARD_DISCARDABLE_CONFIRMATION_DIALOG
378 xavier 29993 cv_cst: CLASSI_STONE
379 neilc 49534 ef_stone: EXTERNAL_FILE_STONE
380 xavier 29993 l: LIST [EB_DEVELOPMENT_WINDOW]
381 larryl 62171 l_filename: FILE_NAME
382 xavier 29993 do
383     cv_cst ?= a_stone
384     if cv_cst /= Void then
385 larryl 62171 l_filename := cv_cst.file_name
386 neilc 49534 else
387     ef_stone ?= a_stone
388     if ef_stone /= Void then
389 larryl 62171 l_filename := ef_stone.file_name
390 neilc 49534 end
391     end
392 manus 51111
393 neilc 49534 if cv_cst /= Void or ef_stone /= Void then
394     l := Window_manager.development_windows_with_class (l_filename)
395     if l.is_empty or else l.has (Current) then
396 xavier 29993 -- We're not editing the class in another window.
397     set_stone_after_first_check (a_stone)
398     else
399 manus 51111 create cd.make_initialized (2,
400     preferences.dialog_data.already_editing_class_string,
401     warning_messages.w_class_already_edited,
402     Interface_names.l_do_not_show_again,
403     preferences.preferences)
404 manus 36309 cd.set_ok_action (agent set_stone_after_first_check (a_stone))
405 xavier 29993 cd.show_modal_to_window (window)
406     end
407 manus 50607 else
408     set_stone_after_first_check (a_stone)
409 xavier 29993 end
410 larryl 62171 update_save_symbol
411 xavier 29993 end
412    
413 manus 50607 set_stone_after_first_check (a_stone: STONE) is
414     -- Display text associated with `a_stone', if any and if possible
415     local
416 larryl 62171 l_checker: EB_STONE_FIRST_CHECKER
417 manus 50607 do
418 larryl 62171 create l_checker.make (Current)
419     l_checker.set_stone_after_first_check (a_stone)
420 neilc 49534 end
421 manus 50607
422     force_stone (s: STONE) is
423     -- make `s' the new value of `stone', and
424     -- change the display accordingly. Try to
425     -- extract a class from `s' whenever possible.
426     do
427     if s.is_storable then
428     set_stone (s)
429     if not unified_stone then
430 larryl 62171 -- To be implemented.
431     -- tools.context_tool.advanced_set_stone (s)
432 manus 50607 end
433 manus 26913 end
434     end
435    
436 manus 50607 refresh is
437     -- Synchronize clickable elements with text, if possible.
438     do
439     --| FIXME ARNAUD
440     -- synchronise_stone
441     --| END FIXME
442     --| FIXME XR: Refresh current display in the editor.
443 larryl 62171 if editors_manager.current_editor /= Void then
444     editors_manager.current_editor.update_click_list (False)
445     end
446 manus 50607 update_save_symbol
447     address_manager.refresh
448     -- The cluster manager should already be refreshed by the window manager.
449 larryl 62171 -- cluster_manager.refresh
450    
451     tools.refresh
452 manus 50607 end
453 manus 26913
454 manus 52526 quick_refresh_editors is
455     -- Redraw editors' drawing area.
456 manus 50607 do
457 larryl 62171 if editors_manager.current_editor /= Void then
458     editors_manager.current_editor.refresh
459     end
460     tools.output_tool.quick_refresh_editor
461     tools.external_output_tool.quick_refresh_editor
462     tools.c_output_tool.quick_refresh_editor
463     tools.class_tool.quick_refresh_editor
464     tools.features_relation_tool.quick_refresh_editor
465    
466     tools.errors_tool.quick_refresh_editor
467     tools.warnings_tool.quick_refresh_editor
468 manus 50607 end
469 manus 26913
470 manus 52526 quick_refresh_margins is
471     -- Redraw the main editor's drawing area.
472     do
473 larryl 62171 if editors_manager.current_editor /= Void then
474     editors_manager.current_editor.margin.refresh
475     end
476     tools.output_tool.quick_refresh_margin
477     tools.external_output_tool.quick_refresh_margin
478     tools.c_output_tool.quick_refresh_margin
479     tools.class_tool.quick_refresh_margin
480     tools.features_relation_tool.quick_refresh_margin
481 manus 52526
482 larryl 62171 tools.errors_tool.quick_refresh_margin
483     tools.warnings_tool.quick_refresh_margin
484 manus 50607 end
485 manus 26913
486 tedf 55179 feature -- Position provider
487    
488     position: like position_internal is
489     -- Currently shown text position in the editor
490     do
491 larryl 62171 if editors_manager.current_editor /= Void then
492     Result := editors_manager.current_editor.first_line_displayed
493     end
494 manus 55527 end
495    
496 tedf 55179 pos_container: like pos_container_internal is
497     -- Current selected formatter
498     do
499 tedf 60107 Result := selected_formatter
500 tedf 55179 end
501    
502 manus 51111 feature -- Resource Update
503 manus 26913
504 larryl 62171 update_viewpoints is
505     -- Update viewpoints
506     local
507     l_formatter: EB_FORMATTER
508     l_end_loop: BOOLEAN
509     l_index: INTEGER
510 manus 50607 do
511 larryl 62171 view_points_combo.disable_sensitive
512     if view_points_combo.has_renamed_view_point then
513     l_index := managed_main_formatters.index
514     from
515     managed_main_formatters.start
516     managed_main_formatters.forth
517     until
518     managed_main_formatters.after or l_end_loop
519     loop
520     l_formatter := managed_main_formatters.item
521     if l_formatter.selected and l_formatter.button.is_sensitive then
522     l_end_loop := True
523     view_points_combo.enable_sensitive
524     end
525     managed_main_formatters.forth
526     end
527     managed_main_formatters.go_i_th (l_index)
528 manus 50607 end
529 manus 26913 end
530    
531 manus 50607 update_splitters is
532 manus 51111 -- Refresh the position of the splitter on screen according to
533 manus 50607 -- our internal values.
534     do
535 manus 26913 end
536    
537 manus 50607 register is
538     -- Register to preferences we want notification of.
539     do
540 manus 26913 end
541    
542 manus 50607 unregister is
543     -- unregister to preferences we want notification of.
544     do
545 manus 26913 end
546    
547 manus 50607 reset is
548     -- Reset the window contents
549     do
550     Precursor
551     address_manager.reset
552 manus 26913
553 manus 50607 --| FIXME ARNAUD, multiformat not yet implemented.
554     -- format_list.enable_imp_formats_sensitive
555     --| END FIXME
556     end
557 neilc 49534
558 manus 50607 syntax_is_correct: BOOLEAN is
559 larryl 62171 -- Current editor was successfully parsed?
560 manus 50607 do
561 larryl 62171 if editors_manager.current_editor /= Void then
562     Result := editors_manager.current_editor.syntax_is_correct
563     else
564     Result := True
565 manus 50607 end
566    
567 manus 26913 end
568    
569 manus 50607 save_before_compiling is
570     -- save the text but do not update clickable positions
571     do
572     save_only := True
573 larryl 62171 save_all
574 manus 26913 end
575    
576 manus 50607 perform_check_before_save is
577     -- Perform any pre-save operations/checks
578 larryl 62171 do
579     -- FIXIT: temp comment by larry
580     -- May be problems here of tabbed editor
581     if editors_manager.current_editor /= Void then
582     perform_check_before_save_with (editors_manager.current_editor)
583     end
584     end
585    
586     perform_check_before_save_with (a_editor: EB_SMART_EDITOR) is
587     -- Perform any pre-save operations with `a_editor'
588     require
589     a_editor_not_void: a_editor /= Void
590 manus 50607 local
591     dial: EV_CONFIRMATION_DIALOG
592     do
593 tedf 56466 -- Remove trailing blanks.
594 tedf 55338 if preferences.editor_data.auto_remove_trailing_blank_when_saving then
595 larryl 62171 a_editor.text_displayed.remove_trailing_blanks
596 tedf 56466 else
597 larryl 62171 a_editor.text_displayed.remove_trailing_fake_blanks
598 tedf 55302 end
599 larryl 62171 a_editor.refresh_now
600 tedf 56466
601 larryl 62171 if a_editor.open_backup then
602     dial := uis.save_backup_dialog
603 manus 50607 dial.show_modal_to_window (window)
604     else
605     check_passed := True
606     end
607 manus 26913 end
608 manus 50607
609     continue_save is
610 larryl 62171 -- Continue saving
611 manus 50607 do
612 manus 26913 check_passed := True
613     end
614    
615 manus 50607 cancel_save is
616 larryl 62171 -- Cancel saving
617 manus 50607 do
618     check_passed := False
619     end
620 manus 26913
621 manus 50607 process is
622     -- process the user entry in the address bar
623 tedf 55839 local
624     l_class_stone: CLASSI_STONE
625     l_multi_search_tool: EB_MULTI_SEARCH_TOOL
626 manus 50607 do
627     save_canceled := False
628 tedf 55839 l_class_stone ?= stone
629     if l_class_stone /= Void then
630 larryl 62171 l_multi_search_tool ?= tools.search_tool
631 tedf 55839 if l_multi_search_tool /= Void then
632     l_multi_search_tool.class_changed (l_class_stone.class_i)
633     end
634     end
635 manus 50607 end
636 manus 26913
637 larryl 62171 save_and (an_action: PROCEDURE [ANY, TUPLE]) is
638     -- Save and `an_actions'.
639     local
640     save_dialog: EB_CONFIRM_SAVE_DIALOG
641     do
642     save_canceled := True
643     text_saved := False
644     create save_dialog.make_and_launch (Current,Current)
645     if not save_canceled and then syntax_is_correct then
646     an_action.call(Void)
647     end
648     end
649    
650     set_classi_changed (a_class: CLASS_I) is
651     -- Change a_class in shared project.
652     do
653     Eiffel_project.Workbench.change_class (a_class)
654     a_class.set_date
655     end
656    
657 manus 50607 on_text_saved is
658     -- Notify the editor that the text has been saved
659     local
660     str: STRING
661     do
662     Precursor
663 larryl 62171 if editors_manager.current_editor /= Void then
664     editors_manager.current_editor.on_text_saved
665     if not save_only then
666     editors_manager.current_editor.update_click_list (True)
667     end
668     end
669 manus 50607 text_saved := True
670     save_only := False
671     str := title.twin
672     if str @ 1 = '*' then
673     str.keep_tail (str.count - 2)
674     set_title (str)
675     end
676     update_formatters
677 tedf 59959 lock_update
678 larryl 62171 tools.features_tool.synchronize
679 tedf 59959 refresh_cursor_position
680     refresh_context_info
681     unlock_update
682 larryl 62171 if editors_manager.current_editor.syntax_is_correct then
683 manus 50607 status_bar.display_message ("")
684     else
685     status_bar.display_message (Interface_names.L_syntax_error)
686     end
687     text_edited := False
688 manus 26913 end
689    
690 larryl 62171 disable_editors_command is
691     -- Disable `a_command'.
692     require
693     editors_manager_not_void: editors_manager /= Void
694     commands_not_void: commands /= Void and then commands.editor_commands /= Void
695 neilc 51830 local
696 larryl 62171 l_commands: ARRAYED_LIST [EB_GRAPHICAL_COMMAND]
697 neilc 51796 do
698 larryl 62171 l_commands := commands.editor_commands
699     if editors_manager.editors.count = 0 then
700 tedf 60107 from
701 larryl 62171 l_commands.start
702 tedf 60107 until
703 larryl 62171 l_commands.after
704 tedf 60107 loop
705 larryl 62171 l_commands.item.disable_sensitive
706     l_commands.forth
707 tedf 60107 end
708     end
709     end
710    
711 manus 51111 feature -- Window management
712 manus 26913
713 manus 50607 show_window is
714     -- Show the window
715     do
716     show
717     end
718 manus 26913
719 manus 50607 raise_window is
720     -- Show the window and set the focus to it.
721     do
722     show
723     --| FIXME, set the focus.
724     end
725 manus 26913
726 manus 50607 hide_window is
727     -- Hide the window
728     do
729     hide
730     end
731 manus 26913
732 manus 50607 destroy_window is
733     -- Destroy the window.
734     do
735     destroy
736     end
737 manus 26913
738 manus 50607 give_focus is
739     -- Give the focus to the address manager.
740     do
741 larryl 62171 if address_manager.widget.is_displayed then
742     address_manager.set_focus
743     end
744 manus 26913 end
745 manus 51111
746 manus 50607 save_layout is
747     -- Store layout of `current'.
748     do
749 king 55319 save_layout_to_window_data (development_window_data)
750     -- Commit saves
751 jfiat 56527 preferences.preferences.save_preferences
752 king 55319 end
753    
754     save_layout_to_session (a_session: ES_SESSION) is
755     -- Save session data of `Current' to session object `a_session'.
756     local
757     a_window_data: EB_DEVELOPMENT_WINDOW_SESSION_DATA
758     a_class_i: CLASSI_STONE
759     do
760     create a_window_data.make_from_window_data (preferences.development_window_data)
761 manus 55527
762 king 55319 a_class_i ?= stone
763     if a_class_i /= Void then
764     a_window_data.save_filename (a_class_i.file_name)
765 larryl 62171 if editors_manager.current_editor /= Void then
766     a_window_data.save_editor_position (editors_manager.current_editor.text_displayed.current_line_number)
767     end
768 king 55319 end
769 manus 55527
770 larryl 62171 save_editors_to_session_data (a_window_data)
771    
772     save_editors_docking_layout
773    
774     if tools.class_tool /= Void then
775     a_window_data.save_context_data (tools.features_relation_tool.address_manager.cluster_label_text, tools.features_relation_tool.address_manager.class_label_text, tools.features_relation_tool.address_manager.feature_label_text, 1)
776 king 55319 end
777    
778 larryl 62171 -- Add the session data of `Current' to the session object.
779 king 55319 a_session.window_session_data.extend (a_window_data)
780     end
781    
782     save_layout_to_window_data (a_window_data: EB_DEVELOPMENT_WINDOW_DATA) is
783     -- Store window data of `Current' in `a_window_data'.
784     require
785     a_window_data_not_void: a_window_data /= Void
786     do
787 manus 50607 -- Now save the windows's layout, but only if the
788     -- debugger is not displayed in `Current'. By saving the layout,
789     -- we ensure that future windows may use exactly the same layout.
790 king 55319 -- If the debugger is displayed, the previous layout is already saved,
791 manus 50607 -- and this is the one that must be used, as only one debugger is ever displayed.
792 jfiat 56447 if
793     (Eb_debugger_manager.application_is_executing and Eb_debugger_manager.debugging_window /= Current)
794     or not Eb_debugger_manager.application_is_executing
795     then
796 manus 50607 -- Save width & height.
797 king 55319 a_window_data.save_size (window.width, window.height)
798     a_window_data.save_window_state (window.is_minimized, window.is_maximized)
799     a_window_data.save_position (window.x_position, window.y_position)
800 manus 50607 end
801     end
802 manus 26913
803 larryl 62171 save_editors_to_session_data (a_window_data: EB_DEVELOPMENT_WINDOW_SESSION_DATA) is
804     -- Save editor number, open classes and open clusters.
805     do
806     a_window_data.save_open_classes (editors_manager.open_classes)
807     a_window_data.save_open_clusters (editors_manager.open_clusters)
808     end
809 manus 55527
810 larryl 62171 save_tools_docking_layout is
811     -- Save all tools docking layout.
812     do
813     docking_manager.save_tools_config (docking_config_tools_file)
814     end
815 manus 26913
816 larryl 62171 save_editors_docking_layout is
817     -- Save all editors docking layout.
818     do
819     docking_manager.save_editors_config (docking_config_editors_file)
820     end
821 manus 26913
822 larryl 62171 open_tools_docking_layout is
823     -- Open tools docking layout.
824     local
825     l_result: BOOLEAN
826     do
827     l_result := docking_manager.open_tools_config (docking_config_tools_file)
828     end
829 manus 26913
830 larryl 62171 open_editos_docking_layout is
831     -- Open editors docking layout.
832     do
833     docking_manager.open_editors_config (docking_config_editors_file)
834     end
835 patrickr 61081
836 larryl 62171 internal_construct_standard_layout_by_code is
837     -- After docking manager have all widgets, set all tools to standard default layout.
838     local
839     l_tool: EB_TOOL
840     l_tool_bar_content: SD_TOOL_BAR_CONTENT
841     do
842     -- Right tools
843     l_tool := tools.output_tool
844     l_tool.content.set_top ({SD_ENUMERATION}.bottom)
845     l_tool := tools.diagram_tool
846     l_tool.content.set_tab_with (tools.output_tool.content, False)
847     l_tool := tools.class_tool
848     l_tool.content.set_tab_with (tools.diagram_tool.content, False)
849     l_tool := tools.features_relation_tool
850     l_tool.content.set_tab_with (tools.class_tool.content, False)
851     l_tool := tools.errors_tool
852     l_tool.content.set_tab_with (tools.features_relation_tool.content, False)
853     l_tool := tools.warnings_tool
854     l_tool.content.set_tab_with (tools.errors_tool.content, False)
855 manus 26913
856 larryl 62171 -- Left tools
857     l_tool := tools.features_tool
858     l_tool.content.set_top ({SD_ENUMERATION}.left)
859     l_tool := tools.cluster_tool
860     l_tool.content.set_relative (tools.features_tool.content, {SD_ENUMERATION}.bottom)
861 manus 26913
862 larryl 62171 -- Tool bars
863     l_tool_bar_content := docking_manager.tool_bar_manager.content_by_title (interface_names.m_general_toolbar)
864     check not_void: l_tool_bar_content /= Void end
865     l_tool_bar_content.set_top ({SD_ENUMERATION}.top)
866 manus 26913
867 larryl 62171 l_tool_bar_content := docking_manager.tool_bar_manager.content_by_title (interface_names.m_address_toolbar)
868     check not_void: l_tool_bar_content /= Void end
869     l_tool_bar_content.set_top ({SD_ENUMERATION}.top)
870 manus 55527
871 larryl 62171 l_tool_bar_content := docking_manager.tool_bar_manager.content_by_title (interface_names.m_project_toolbar)
872     check not_void: l_tool_bar_content /= Void end
873     l_tool_bar_content.set_top ({SD_ENUMERATION}.top)
874 manus 26913
875 larryl 62171 l_tool_bar_content := docking_manager.tool_bar_manager.content_by_title (interface_names.m_refactoring_toolbar)
876     check not_void: l_tool_bar_content /= Void end
877     l_tool_bar_content.set_top ({SD_ENUMERATION}.top)
878 manus 26913
879 larryl 62171 end
880    
881     restore_tools_docking_layout is
882     -- Restore docking layout information.
883     local
884     l_raw_file: RAW_FILE
885     l_result: BOOLEAN
886     do
887     create l_raw_file.make (docking_config_tools_file)
888     if l_raw_file.exists then
889     l_result := docking_manager.open_tools_config (docking_config_tools_file)
890     end
891    
892     if not l_result then
893     restore_standard_tools_docking_layout
894     end
895     end
896    
897     restore_editors_docking_layout is
898     -- Restore docking layout information.
899     local
900     l_raw_file: RAW_FILE
901     l_result: BOOLEAN
902     do
903     create l_raw_file.make (docking_config_editors_file)
904     if l_raw_file.exists then
905     l_result := docking_manager.open_tools_config (docking_config_editors_file)
906     end
907     end
908    
909     restore_standard_tools_docking_layout is
910     -- Restore statndard layout.
911     local
912     l_file: RAW_FILE
913     l_result: BOOLEAN
914     l_restried: BOOLEAN
915     l_fn: FILE_NAME
916     do
917     if not l_restried then
918     l_fn := docking_standard_layout_path.twin
919     l_fn.set_file_name ("standard_layout.wb")
920     create l_file.make_open_read (l_fn )
921     if l_file.exists then
922     l_result := docking_manager.open_config (l_fn)
923     end
924     check l_result end
925     else
926     internal_construct_standard_layout_by_code
927     end
928     rescue
929     l_restried := True
930     retry
931     end
932    
933     docking_config_tools_file: FILE_NAME is
934     -- Docking config file name.
935     local
936     l_env: EIFFEL_ENV
937     once
938     create l_env
939     create Result.make_from_string (l_env.docking_standard_layout_path)
940     Result.set_file_name ("layout.wb")
941     end
942    
943     docking_config_editors_file: FILE_NAME is
944     -- Docking config file name.
945     do
946     create Result.make_from_string (project_location.location)
947     Result.set_file_name ("layout.wb")
948     end
949    
950     docking_debug_config_file: FILE_NAME is
951     -- Docking config file when debugging.
952     local
953     l_env: EIFFEL_ENV
954     once
955     create l_env
956     create Result.make_from_string (l_env.docking_standard_layout_path)
957     Result.set_file_name ("debug_layout.wb")
958     end
959    
960     feature -- Tools & Controls
961    
962 manus 50607 address_manager: EB_ADDRESS_MANAGER
963     -- Text field in the toolbar
964     -- Allow user to enter the name
965     -- of the class he wants to edit.
966 manus 26913
967 manus 50607 project_manager: EB_PROJECT_MANAGER is
968     -- Project manager associated to the project the user is working on.
969     do
970     Result := Eiffel_project.manager
971     end
972 manus 26913
973 manus 50607 managed_class_formatters: ARRAYED_LIST [EB_CLASS_INFO_FORMATTER]
974     -- All formatters that operate on a class.
975 manus 26913
976 manus 50607 managed_feature_formatters: ARRAYED_LIST [EB_FEATURE_INFO_FORMATTER]
977     -- All formatters that operate on a class.
978 manus 26913
979 manus 50607 managed_main_formatters: ARRAYED_LIST [EB_CLASS_TEXT_FORMATTER]
980     -- All formatters that can be displayed in the main editor frame.
981 manus 26913
982 manus 50607 unified_stone: BOOLEAN
983     -- Is the stone common with the context tool or not?
984 manus 51111
985 larryl 62171 view_points_combo: EB_VIEWPOINT_COMBO_BOX
986 manus 51111
987     feature -- Multiple editor management
988 manus 26913
989 larryl 62171 update_paste_cmd is
990     -- Update `editor_paste_cmd'. To be performed when an editor grabs the focus.
991 manus 50607 do
992 larryl 62171 if
993     not uis.current_editor.is_empty and then
994     uis.current_editor.is_editable and then
995     uis.current_editor.clipboard.has_text
996     then
997     commands.editor_paste_cmd.enable_sensitive
998     else
999     commands.editor_paste_cmd.disable_sensitive
1000     end
1001 manus 50607 end
1002 neilc 49534
1003 larryl 62171 feature {EB_EDITOR_TOOL, EB_EDITORS_MANAGER, EB_STONE_CHECKER} -- Tabbed editor
1004    
1005     is_dropping_on_editor: BOOLEAN
1006     -- Is pick and droping on an editor?
1007    
1008     set_dropping_on_editor (a_dropping: BOOLEAN) is
1009     -- Set `Is dropping_on_editor' with `a_dropping'.
1010 manus 50607 do
1011 larryl 62171 is_dropping_on_editor := a_dropping
1012 manus 26913 end
1013 manus 51111
1014 larryl 62171 refresh_tab (a_stone: STONE) is
1015     -- Refresh pixmap and title of current editor's tab.
1016 manus 50607 local
1017 larryl 62171 l_class_stone: CLASSI_STONE
1018     l_cluster_stone: CLUSTER_STONE
1019     l_group: CONF_GROUP
1020 manus 50607 do
1021 larryl 62171 if editors_manager.current_editor /= Void then
1022     if a_stone /= Void then
1023     l_class_stone ?= a_stone
1024     l_cluster_stone ?= a_stone
1025     if l_class_stone /= Void then
1026     editors_manager.current_editor.docking_content.set_pixmap (pixmap_from_class_i (l_class_stone.class_i))
1027     editors_manager.current_editor.docking_content.set_short_title (l_class_stone.class_name)
1028     editors_manager.current_editor.docking_content.set_long_title (l_class_stone.class_name)
1029     editors_manager.current_editor.set_title_saved (not changed)
1030     elseif l_cluster_stone /= Void then
1031     l_group := l_cluster_stone.group
1032     editors_manager.current_editor.docking_content.set_pixmap (pixmap_from_group (l_group))
1033     editors_manager.current_editor.docking_content.set_short_title (l_group.name)
1034     editors_manager.current_editor.docking_content.set_long_title (l_group.name)
1035     end
1036 manus 50607 end
1037 xavier 27840 end
1038 manus 50607
1039 xavier 27860 end
1040 neilc 49534
1041 larryl 62171 feature {EB_FEATURES_TOOL, EB_FEATURES_TREE, DOTNET_CLASS_AS,
1042     DOTNET_CLASS_CONTEXT, EB_STONE_CHECKER, EB_DEVELOPMENT_WINDOW_PART} -- Feature Clauses
1043 manus 51111
1044 manus 50607 set_feature_clauses (a_features: ARRAYED_LIST [DOTNET_FEATURE_CLAUSE_AS [CONSUMED_ENTITY]]; a_type: STRING) is
1045     -- Set 'features' to 'a_features' and store in hash table with key 'a_type' denoting name of consumed
1046     -- type pertinent to 'a_features'.
1047     require
1048     a_features_not_void: a_features /= Void
1049     do
1050     if feature_clauses = Void then
1051     create feature_clauses.make (5)
1052     end
1053     feature_clauses.put (a_features, a_type)
1054 neilc 49534 end
1055 manus 51111
1056 tedf 56237 set_feature_locating (a_locating: BOOLEAN) is
1057     -- Set `feature_locating' with `a_locating'.
1058     do
1059     feature_locating := a_locating
1060     end
1061    
1062 manus 50607 get_feature_clauses (a_type: STRING): ARRAYED_LIST [DOTNET_FEATURE_CLAUSE_AS [CONSUMED_ENTITY]] is
1063     -- Get list of feature clauses relevant to .NET type with name 'a_type'.
1064     require
1065     a_type_not_void: a_type /= Void
1066     has_type_clauses: feature_clauses.has (a_type)
1067     do
1068     Result := feature_clauses.item (a_type)
1069     ensure
1070     result_not_void: Result /= Void
1071 neilc 33858 end
1072 manus 51111
1073 manus 50607 feature_clauses: HASH_TABLE [ARRAYED_LIST [DOTNET_FEATURE_CLAUSE_AS [CONSUMED_ENTITY]], STRING]
1074     -- List of features clauses for Current window hashed by the .NET name of the consumed_type.
1075 manus 51111
1076 tedf 56237 feature_locating: BOOLEAN
1077     -- Is feature tool locating a feature?
1078    
1079 manus 51111 feature {EB_WINDOW_MANAGER} -- Window management / Implementation
1080 manus 26913
1081 manus 50607 destroy_imp is
1082     -- Destroy window.
1083     do
1084     -- To avoid reentrance
1085     if not is_destroying then
1086     is_destroying := True
1087 larryl 62171
1088 manus 50607 -- Save width & height.
1089 king 55319 development_window_data.save_size (window.width, window.height)
1090     development_window_data.save_window_state (window.is_minimized, window.is_maximized)
1091     development_window_data.save_position (window.x_position, window.y_position)
1092 larryl 62171
1093 manus 50607 hide
1094 manus 26913
1095 manus 50607 -- Commit saves
1096 jfiat 56527 preferences.preferences.save_preferences
1097 manus 26913
1098 jfiat 59618 estudio_debug_cmd.unattach_window (window)
1099 manus 50607 toolbars_area.wipe_out
1100     address_manager.recycle
1101 larryl 62171
1102 manus 50607 Precursor {EB_TOOL_MANAGER}
1103 larryl 62171 menus.view_menu.destroy
1104    
1105 manus 50607 managed_class_formatters.wipe_out
1106     managed_feature_formatters.wipe_out
1107     managed_main_formatters.wipe_out
1108 larryl 62171 commands.toolbarable_commands.wipe_out
1109     uis.editors.wipe_out
1110    
1111     editors_manager.recycle
1112     editors_manager := Void
1113 manus 50607 stone := Void
1114 neilc 49534 end
1115     end
1116    
1117 larryl 62171 feature {EB_STONE_FIRST_CHECKER, EB_DEVELOPMENT_WINDOW_MAIN_BUILDER} -- Implementation
1118 jasonw 56493
1119 larryl 62171 set_stone_after_check (a_stone: STONE) is
1120     -- Set stone after check
1121     local
1122     l_checker: EB_STONE_CHECKER
1123 jasonw 56493 do
1124 larryl 62171 create l_checker.make (Current)
1125     l_checker.set_stone_after_check (a_stone)
1126 jasonw 56493 end
1127    
1128 larryl 62171 check_passed: BOOLEAN
1129     -- If check passed?
1130 jasonw 56493
1131 larryl 62171 save_canceled: BOOLEAN
1132     -- did user cancel save ?
1133 neilc 49534
1134 larryl 62171 save_only: BOOLEAN
1135     -- skip parse and update after save ?
1136 manus 51111
1137 larryl 62171 is_destroying: BOOLEAN
1138     -- Is `current' being currently destroyed?
1139 manus 51111
1140 larryl 62171 on_cursor_moved is
1141     -- The cursor has moved, reflect the change in the status bar.
1142     -- And reflect location editing in the text in features tool and address bar.
1143 manus 50607 do
1144 larryl 62171 refresh_cursor_position
1145     if context_refreshing_timer = Void then
1146     create context_refreshing_timer.make_with_interval (100)
1147     context_refreshing_timer.actions.extend (agent refresh_context_info)
1148 neilc 49534 end
1149 larryl 62171 if feature_locating then
1150     context_refreshing_timer.set_interval (0)
1151 manus 50607 else
1152 larryl 62171 context_refreshing_timer.set_interval (100)
1153 neilc 49534 end
1154 manus 26913 end
1155    
1156 larryl 62171 all_editor_closed is
1157     -- All editor closed.
1158 jfiat 54401 do
1159 larryl 62171 disable_editors_command
1160     tools.features_tool.set_stone (Void)
1161     set_title (window_manager.new_title)
1162     end
1163 manus 55527
1164 larryl 62171 feature {EB_STONE_CHECKER, EB_STONE_FIRST_CHECKER, EB_DEVELOPMENT_WINDOW_PART} -- Internal issues with EB_STONE_CHECKER
1165 jfiat 54401
1166 larryl 62171 is_text_loaded: BOOLEAN is
1167     -- Text is loaded in current editor?
1168     do
1169     if editors_manager.current_editor /= Void then
1170     Result := editors_manager.current_editor.is_text_loaded (stone)
1171     else
1172     Result := True
1173 jfiat 59332 end
1174 jfiat 54401 end
1175 manus 55527
1176 larryl 62171 set_feature_stone_already_processed (a_bool: like feature_stone_already_processed) is
1177     -- Set `feature_stone_already_processed'
1178 manus 50607 do
1179 larryl 62171 feature_stone_already_processed := a_bool
1180     ensure
1181     set: feature_stone_already_processed = a_bool
1182 manus 26913 end
1183    
1184 larryl 62171 feature_stone_already_processed: BOOLEAN
1185     -- Is the processed stone a feature stone and has it
1186     -- been already processed by the editor ?
1187 manus 26913
1188 larryl 62171 set_text_saved (a_bool: like text_saved) is
1189     -- Set `text_saved'
1190     do
1191     text_saved := a_bool
1192     ensure
1193     set: text_saved = a_bool
1194     end
1195 manus 26913
1196 manus 50607 text_saved: BOOLEAN
1197     -- has the user chosen to save the file
1198 manus 26913
1199 larryl 62171 set_during_synchronization (a_bool: BOOLEAN) is
1200     -- Set `during_synchronization'
1201 manus 50607 do
1202 larryl 62171 during_synchronization := a_bool
1203     ensure
1204     set: during_synchronization = a_bool
1205 manus 26913 end
1206    
1207 larryl 62171 during_synchronization: BOOLEAN
1208     -- Are we during a resynchronization?
1209 neilc 33294
1210 manus 50607 update_formatters is
1211     -- Give a correct sensitivity to formatters.
1212     local
1213     cist: CLASSI_STONE
1214     cst: CLASSC_STONE
1215     type_changed: BOOLEAN
1216 larryl 62171 cluster_st: CLUSTER_STONE
1217 manus 50607 do
1218     cst ?= stone
1219     cist ?= stone
1220     -- Check to if formatting context has changed.
1221     if cst /= Void then
1222     type_changed := (cst.e_class.is_true_external and not is_stone_external) or
1223     (not cst.e_class.is_true_external and is_stone_external)
1224     elseif cist /= Void then
1225     type_changed := (cist.class_i.is_external_class and not is_stone_external) or
1226     (not cist.class_i.is_external_class and is_stone_external)
1227     end
1228 manus 51111
1229 manus 50607 if type_changed then
1230     -- Toggle stone flag.
1231     is_stone_external := not is_stone_external
1232 manus 51111 end
1233 neilc 33365
1234 manus 50607 if cst /= Void then
1235     address_manager.enable_formatters
1236     if is_stone_external then
1237     -- Change formatters to .NET sensitivity (from normal).
1238     enable_dotnet_formatters
1239     if type_changed then
1240     managed_main_formatters.i_th (4).enable_select
1241     end
1242     else
1243     if changed then
1244 manus 51111 address_manager.disable_formatters
1245 manus 50607 else
1246     --managed_main_formatters.first.disable_sensitive
1247     end
1248     end
1249     elseif cist /= Void and is_stone_external then
1250 neilc 33365 -- Change formatters to .NET sensitivity (from normal).
1251 manus 38124 enable_dotnet_formatters
1252     if type_changed then
1253     managed_main_formatters.i_th (4).enable_select
1254     end
1255     else
1256 manus 50607 address_manager.disable_formatters
1257 larryl 62171 cluster_st ?= stone
1258     if cist /= stone and cluster_st = Void then
1259 manus 50607 managed_main_formatters.first.execute
1260 manus 38124 end
1261 neilc 33365 end
1262     end
1263    
1264 larryl 62171 scroll_to_feature (feat_as: E_FEATURE; displayed_class: CLASS_I) is
1265     -- Highlight the feature correspnding to `feat_as' in the class represented by `displayed_class'
1266     require
1267     class_is_not_void: displayed_class /= Void
1268     feat_as_is_not_void: feat_as /= Void
1269 tedf 58064 local
1270 larryl 62171 begin_index, offset: INTEGER
1271     tmp_text: STRING
1272 manus 50607 do
1273 larryl 62171 if editors_manager.current_editor /= Void then
1274     if not feat_as.is_il_external then
1275     if not managed_main_formatters.first.selected then
1276     if feat_as.ast /= Void then
1277     editors_manager.current_editor.find_feature_named (feat_as.name)
1278     end
1279     else
1280     if feat_as.ast /= Void then
1281     begin_index := feat_as.ast.start_position
1282     tmp_text := displayed_class.text.substring (1, begin_index)
1283     offset := tmp_text.occurrences('%R')
1284     editors_manager.current_editor.scroll_to_when_ready (begin_index.item - offset)
1285     end
1286     end
1287 manus 50607 else
1288 larryl 62171 -- Nothing for .NET features for now.
1289     fixme ("It should be implemented.")
1290 manus 50607 end
1291 xavier 27866 end
1292     end
1293    
1294 larryl 62171 feature {EB_DEVELOPMENT_WINDOW_PART, EB_STONE_FIRST_CHECKER, EB_DEVELOPMENT_WINDOW_BUILDER} -- Implementation
1295 manus 26913
1296 larryl 62171 update_save_symbol is
1297     -- Update save symbol.
1298 manus 50607 do
1299 larryl 62171 Precursor {EB_FILEABLE}
1300     if editors_manager.current_editor /= Void then
1301     if changed then
1302     save_cmd.enable_sensitive
1303     address_manager.disable_formatters
1304     editors_manager.current_editor.set_title_saved (false)
1305     else
1306     save_cmd.disable_sensitive
1307     update_formatters
1308     editors_manager.current_editor.set_title_saved (true)
1309     end
1310 tedf 55756 end
1311 larryl 62171 if is_empty then
1312     commands.print_cmd.disable_sensitive
1313     commands.save_as_cmd.disable_sensitive
1314 tedf 56237 else
1315 larryl 62171 commands.print_cmd.enable_sensitive
1316     commands.save_as_cmd.enable_sensitive
1317 tedf 56237 end
1318 larryl 62171 if any_editor_changed then
1319     save_all_cmd.enable_sensitive
1320 manus 50607 else
1321 larryl 62171 save_all_cmd.disable_sensitive
1322 manus 50607 end
1323 larryl 62171 if editors_manager.editors.count > 0 then
1324     commands.shell_cmd.enable_sensitive
1325     else
1326     commands.shell_cmd.disable_sensitive
1327 etienne 27144 end
1328 manus 51111 end
1329 manus 50607
1330 larryl 62171 is_stone_external: BOOLEAN
1331     -- Does 'stone' contain a .NET consumed type?
1332 manus 50607
1333 larryl 62171 locate_editor_stoned (a_stone: STONE) is
1334     -- Select the editor with `a_stone'
1335     require
1336     a_stone_attached: a_stone /= Void
1337 manus 50607 local
1338 larryl 62171 l_editor: EB_SMART_EDITOR
1339 manus 50607 do
1340 larryl 62171 l_editor ?= a_stone.pos_editor
1341     if l_editor = Void then
1342     l_editor := editors_manager.editor_with_stone (a_stone)
1343 manus 26913 end
1344 larryl 62171 if l_editor = Void then
1345     editors_manager.create_editor
1346     l_editor := editors_manager.last_created_editor
1347 jasonw 57090 end
1348 larryl 62171 editors_manager.editor_switched_actions.block
1349     editors_manager.select_editor (l_editor)
1350     editors_manager.editor_switched_actions.resume
1351 manus 26913 end
1352    
1353 larryl 62171 enable_dotnet_formatters is
1354     -- Enable only the .NET class text formatters.
1355     local
1356     l_formatters: like managed_main_formatters
1357 manus 50607 do
1358 larryl 62171 l_formatters := managed_main_formatters.twin
1359     from
1360     l_formatters.start
1361     until
1362     l_formatters.after
1363     loop
1364     if l_formatters.item.is_dotnet_formatter then
1365     l_formatters.item.enable_sensitive
1366     else
1367     l_formatters.item.disable_sensitive
1368 manus 50607 end
1369 larryl 62171 l_formatters.forth
1370 xavier 27498 end
1371     end
1372    
1373 larryl 62171 text_edited: BOOLEAN
1374     -- Do we know that the text was edited?
1375     -- If so, no need to update the display each time it is edited.
1376 xavier 27498
1377 manus 50607 saved_cursor: CURSOR
1378     -- Saved cursor position for displaying the stack.
1379 manus 26913
1380 jasonw 56245 terminate_external_command_and_destroy is
1381     -- Terminate running external command and destroy.
1382     do
1383     process_manager.terminate_external_command
1384     destroy
1385     ensure
1386     external_command_not_running: not process_manager.is_external_command_running
1387     end
1388    
1389 manus 50607 save_and_destroy is
1390 larryl 62171 -- Save text then destroy.
1391 manus 50607 do
1392     save_text
1393     destroy
1394     end
1395 manus 26913
1396 manus 50607 force_destroy is
1397     -- Destroy without asking.
1398     do
1399     confirmed := True
1400     destroy
1401     confirmed := False
1402     end
1403 manus 26913
1404 manus 50607 confirmed: BOOLEAN
1405     -- Did the user say he wanted to exit?
1406 manus 26913
1407 tedf 55756 context_refreshing_timer: EV_TIMEOUT
1408 tedf 60107 -- Timer to refresh feature tree address bar.
1409 manus 26913
1410 tedf 60107 selected_formatter: EB_CLASS_TEXT_FORMATTER is
1411     -- Current selected formatter
1412     local
1413     l_end : BOOLEAN
1414     l_index: INTEGER
1415     l_formatter: like managed_main_formatters
1416     do
1417     l_formatter := managed_main_formatters
1418     l_index := l_formatter.index
1419     from
1420     l_formatter.start
1421     until
1422     l_formatter.after or l_end
1423     loop
1424     if l_formatter.item.selected then
1425     l_end := true
1426     Result := l_formatter.item
1427     end
1428     l_formatter.forth
1429     end
1430     l_formatter.go_i_th (l_index)
1431     end
1432    
1433 tedf 59163 feature -- Recycle
1434    
1435 manus 50607 recycle is
1436 larryl 62171 -- Recycle all.
1437 manus 50607 do
1438 tedf 59163 recycle_command
1439     recycle_formatters
1440     recycle_menu
1441 manus 50607 Precursor {EB_TOOL_MANAGER}
1442 larryl 62171 commands.save_as_cmd.recycle
1443 tedf 59163 open_cmd.recycle
1444     save_cmd.recycle
1445 larryl 62171 commands.set_save_as_cmd (Void)
1446 tedf 59163 open_cmd := Void
1447     save_cmd := Void
1448 manus 50607 command_controller.recycle
1449 patrickr 56781 if refactoring_manager /= Void then
1450     refactoring_manager.destroy
1451     end
1452 larryl 62171
1453     tools.set_favorites_tool (Void)
1454 tedf 59163 history_manager := Void
1455 larryl 62171 tools.set_features_tool (Void)
1456     tools.set_breakpoints_tool (Void)
1457 tedf 59163 favorites_manager := Void
1458     cluster_manager := Void
1459 larryl 62171 tools.set_search_tool (Void)
1460    
1461     editors_manager.recycle
1462     editors_manager := Void
1463 manus 50607 end
1464 manus 26913
1465 tedf 59163 recycle_command is
1466     -- Recycle command
1467     do
1468 larryl 62171 commands.recycle_commands
1469 tedf 59163 end
1470    
1471     recycle_formatters is
1472     -- Recycle formatters
1473     do
1474     from
1475     managed_class_formatters.start
1476     until
1477     managed_class_formatters.after
1478     loop
1479     if managed_class_formatters.item /= Void then
1480     managed_class_formatters.item.recycle
1481     end
1482     managed_class_formatters.forth
1483     end
1484    
1485     from
1486     managed_feature_formatters.start
1487     until
1488     managed_feature_formatters.after
1489     loop
1490     if managed_feature_formatters.item /= Void then
1491     managed_feature_formatters.item.recycle
1492     end
1493     managed_feature_formatters.forth
1494     end
1495    
1496     from
1497     managed_main_formatters.start
1498     until
1499     managed_main_formatters.after
1500     loop
1501     if managed_main_formatters.item /= Void then
1502     managed_main_formatters.item.recycle
1503     end
1504     managed_main_formatters.forth
1505     end
1506     end
1507    
1508     recycle_menu is
1509 larryl 62171 -- Recycle menus.
1510 tedf 59163 do
1511 larryl 62171 menus.recycle_menus
1512     end
1513 tedf 59163
1514 larryl 62171 feature {EB_DEVELOPMENT_WINDOW_BUILDER} -- Initliazed by EB_DEVELOPMENT_WINDOW_BUILDER
1515    
1516     show_dynamic_library_dialog is
1517     -- Create a new dynamic library window and display it.
1518     do
1519     Window_manager.create_dynamic_lib_window
1520 tedf 59163 end
1521    
1522 larryl 62171 send_stone_to_context is
1523     -- Send current stone to the context tool.
1524     -- Used by `send_stone_to_context_cmd'.
1525     do
1526     if stone /= Void then
1527     tools.set_stone (stone)
1528     end
1529     end
1530 tedf 59163
1531 larryl 62171 feature {EB_DEVELOPMENT_WINDOW_MENU_BUILDER, EB_DEVELOPMENT_WINDOW_PART,
1532     EB_DEVELOPMENT_WINDOW_MAIN_BUILDER} -- Implementation: Editor commands
1533 xavier 27840
1534 manus 50607 refresh_cursor_position is
1535     -- Display the current cursor position in the status bar.
1536     require
1537     text_loaded: not is_empty
1538     local
1539 king 55319 l, c, v: INTEGER
1540 manus 50607 do
1541 larryl 62171 if editors_manager.current_editor /= Void then
1542     l := editors_manager.current_editor.cursor_y_position
1543     c := editors_manager.current_editor.cursor_x_position
1544     v := editors_manager.current_editor.cursor_visible_x_position
1545     end
1546 king 55319 status_bar.set_cursor_position (l, c, v)
1547 manus 50607 end
1548 manus 55527
1549 tedf 54985 refresh_context_info is
1550     -- Refresh address bar and features tool to relect
1551     -- where in the code the cursor is located.
1552     local
1553     l_feature: FEATURE_AS
1554     l_classc_stone: CLASSC_STONE
1555     do
1556 larryl 62171 -- we may have been called from a timer and have to deactivate the timer
1557     if context_refreshing_timer /= Void then
1558     context_refreshing_timer.set_interval (0)
1559     end
1560 tedf 54985 l_classc_stone ?= stone
1561     if l_classc_stone /= Void then
1562 larryl 62171 if editors_manager.current_editor /= Void then
1563     l_feature := editors_manager.current_editor.text_displayed.current_feature_containing
1564     end
1565 tedf 54985 if l_feature /= Void then
1566     set_editing_location_by_feature (l_feature)
1567     else
1568     set_editing_location_by_feature (Void)
1569     end
1570     end
1571     end
1572 manus 55527
1573 tedf 54985 set_editing_location_by_feature (a_feature: FEATURE_AS) is
1574     -- Set editing location, feature tool and combo box changes according to `a_feature'.
1575     local
1576     l_efeature: E_FEATURE
1577     l_class_i: CLASS_I
1578     l_classc: CLASS_C
1579     do
1580     if a_feature /= Void then
1581     address_manager.set_feature_text_simply (a_feature.feature_names.first.internal_name)
1582 manus 60057 l_class_i := eiffel_universe.safe_class_named (class_name, group)
1583 tedf 55352 if l_class_i /= Void and then l_class_i.is_compiled then
1584 tedf 54985 l_classc := l_class_i.compiled_class
1585 jfiat 55044 if l_classc.has_feature_table then
1586     l_efeature := l_classc.feature_with_name (a_feature.feature_names.first.internal_name)
1587 tedf 59696 if l_efeature /= Void and then l_efeature.written_in /= l_classc.class_id then
1588     l_efeature := Void
1589     end
1590 jfiat 55044 end
1591 tedf 54985 end
1592 tedf 59696 if l_efeature /= Void then
1593     seek_item_in_feature_tool (l_efeature)
1594     else
1595 larryl 62171 tools.features_tool.seek_ast_item_in_feature_tool (a_feature.feature_names.first.internal_name)
1596 tedf 59696 end
1597 tedf 54985 else
1598     address_manager.set_feature_text_simply (once "")
1599 tedf 59696 seek_item_in_feature_tool (Void)
1600 tedf 54985 end
1601 larryl 62171
1602 tedf 54985 end
1603 manus 55527
1604 tedf 54985 seek_item_in_feature_tool (a_feature: E_FEATURE) is
1605     -- Seek and select item contains data of `a_feature' in features tool.
1606     -- If `a_feature' is void, deselect item in features tool.
1607     do
1608 larryl 62171 tools.features_tool.seek_item_in_feature_tool (a_feature)
1609 tedf 54985 end
1610 xavier 29812
1611 manus 50607 select_all is
1612     -- Select the whole text in the focused editor.
1613 larryl 62171 local
1614     l_editor: EB_EDITOR
1615 manus 50607 do
1616 larryl 62171 l_editor := uis.current_editor
1617     if l_editor /= Void and then not l_editor.is_recycled and then not l_editor.is_empty then
1618     l_editor.select_all
1619 tedf 61412 end
1620 manus 50607 end
1621 neilc 49534
1622 manus 50607 search is
1623     -- Search some text in the focused editor.
1624     local
1625     cv_ced: EB_CLICKABLE_EDITOR
1626     do
1627 larryl 62171 cv_ced ?= uis.current_editor
1628 manus 50607 if cv_ced /= Void then
1629     cv_ced.search
1630     end
1631 xavier 27840 end
1632    
1633 manus 50607 goto is
1634     -- Display a dialog to select a line to go to in the editor.
1635     local
1636     ed: EB_EDITOR
1637 larryl 62171 l_dialog: EB_GOTO_DIALOG
1638 manus 50607 do
1639 larryl 62171 ed ?= uis.current_editor
1640 manus 50607 if ed /= Void then
1641 larryl 62171 create l_dialog.make (ed)
1642     uis.set_goto_dialog (l_dialog)
1643     l_dialog.show_modal_to_window (Current.window)
1644 manus 50607 end
1645 xavier 28693 end
1646    
1647 manus 50607 toggle_line_number_display is
1648     -- Toggle line number display on/off in editor
1649     do
1650 paulb 52854 preferences.editor_data.show_line_numbers_preference.set_value (not preferences.editor_data.show_line_numbers)
1651 xavier 28280 end
1652    
1653 manus 50607 find_next is
1654     -- Find the next occurrence of the search text.
1655     local
1656     cv_ced: EB_CLICKABLE_EDITOR
1657     do
1658 larryl 62171 if tools.search_tool.currently_searched /= Void then
1659     cv_ced ?= uis.current_editor
1660 manus 50607 if cv_ced /= Void then
1661     cv_ced.find_next
1662     end
1663     else
1664 larryl 62171 tools.search_tool.show_and_set_focus
1665 xavier 28280 end
1666     end
1667    
1668 manus 50607 find_previous is
1669     -- Find the previous occurrence of the search text.
1670     local
1671     cv_ced: EB_CLICKABLE_EDITOR
1672     do
1673 larryl 62171 if tools.search_tool.currently_searched /= Void then
1674     cv_ced ?= uis.current_editor
1675 manus 50607 if cv_ced /= Void then
1676     cv_ced.find_previous
1677     end
1678     else
1679 larryl 62171 tools.search_tool.show_and_set_focus
1680 manus 50607 end
1681     end
1682    
1683 tedf 61590 find_next_selection is
1684 manus 50607 -- Find the next occurrence of the selection.
1685     local
1686     cv_ced: EB_CLICKABLE_EDITOR
1687     do
1688 larryl 62171 cv_ced ?= editors_manager.current_editor
1689 xavier 28280 if cv_ced /= Void then
1690 tedf 61590 cv_ced.find_next_selection
1691 xavier 28280 end
1692     end
1693    
1694 tedf 61590 find_previous_selection is
1695     -- Find the next occurrence of the selection.
1696     local
1697     cv_ced: EB_CLICKABLE_EDITOR
1698     do
1699 larryl 62171 cv_ced ?= editors_manager.current_editor
1700 tedf 61590 if cv_ced /= Void then
1701     cv_ced.find_previous_selection
1702     end
1703     end
1704    
1705 manus 50607 cut_selection is
1706     -- Cut the selection in the current editor.
1707     do
1708 larryl 62171 uis.current_editor.cut_selection
1709 xavier 28303 end
1710    
1711 manus 50607 copy_selection is
1712     -- Cut the selection in the current editor.
1713     do
1714 larryl 62171 uis.current_editor.copy_selection
1715 manus 50607 end
1716 xavier 28303
1717 manus 50607 toggle_formatting_marks is
1718     -- Show/Hide formatting marks in the editor and update related menu item.
1719     do
1720 larryl 62171 uis.current_editor.toggle_view_invisible_symbols
1721     if uis.current_editor.view_invisible_symbols then
1722 manus 51111 formatting_marks_command_menu_item.set_text (Interface_names.m_hide_formatting_marks)
1723 manus 50607 else
1724 manus 51111 formatting_marks_command_menu_item.set_text(Interface_names.m_show_formatting_marks)
1725 manus 50607 end
1726 xavier 27860 end
1727    
1728 larryl 62171 feature {EB_DEVELOPMENT_WINDOW_MAIN_BUILDER} -- Implementation / Menus
1729 manus 26913
1730 larryl 62171 set_undo_accelerator (a_accelerator: like undo_accelerator) is
1731     -- Set `undo_accelerator'
1732     do
1733     undo_accelerator := a_accelerator
1734     ensure
1735     set: undo_accelerator = a_accelerator
1736     end
1737 xavier 30005
1738 manus 50607 undo_accelerator: EV_ACCELERATOR
1739     -- Accelerator for Ctrl+Z
1740 manus 26913
1741 larryl 62171 set_redo_accelerator (a_accelerator: like redo_accelerator) is
1742     -- Set `redo_accelerator'
1743     do
1744     redo_accelerator := a_accelerator
1745     ensure
1746     set: redo_accelerator = a_accelerator
1747     end
1748    
1749 manus 50607 redo_accelerator: EV_ACCELERATOR
1750     -- Accelerator for Ctrl+Y
1751 manus 26913
1752 larryl 62171 feature {EB_DEVELOPMENT_WINDOW_BUILDER, EB_ADDRESS_MANAGER} -- Builder issues
1753 manus 26913
1754 larryl 62171 set_tools_initialized (a_bool: like tools_initialized) is
1755     -- Set `tools_initialized'
1756     do
1757     tools_initialized := a_bool
1758     ensure
1759     set: tools_initialized = a_bool
1760     end
1761 manus 26913
1762 larryl 62171 set_toolbars_area (a_area: like toolbars_area) is
1763     -- Set `toolbars_area'
1764     do
1765     toolbars_area := a_area
1766     ensure
1767     set: toolbars_area = a_area
1768     end
1769 manus 26913
1770 larryl 62171 set_view_points_combo (a_view_points_combo: like view_points_combo) is
1771     -- Set `view_points_combo'
1772     do
1773     view_points_combo := a_view_points_combo
1774     ensure
1775     set: view_points_combo = a_view_points_combo
1776     end
1777 manus 26913
1778 larryl 62171 set_managed_class_formatters (a_formatters: like managed_class_formatters) is
1779     -- Set `managed_class_formatters'
1780     do
1781     managed_class_formatters := a_formatters
1782     ensure
1783     set: managed_class_formatters = a_formatters
1784     end
1785 manus 26913
1786 larryl 62171 set_managed_feature_formatters (a_formatters: like managed_feature_formatters) is
1787     -- Set `managed_feature_formatters'
1788     do
1789     managed_feature_formatters := a_formatters
1790     ensure
1791     set: managed_feature_formatters = a_formatters
1792     end
1793 manus 26913
1794 larryl 62171 set_managed_main_formatters (a_formatters: like managed_main_formatters) is
1795     -- Set `managed_main_formatters'
1796     do
1797     managed_main_formatters := a_formatters
1798     ensure
1799     set: managed_main_formatters = a_formatters
1800     end
1801 jasonw 54933
1802 larryl 62171 set_help_engine (a_engine: like help_engine) is
1803     -- Set `help_engine'
1804     do
1805     help_engine := a_engine
1806     ensure
1807     set: help_engine = a_engine
1808     end
1809 manus 26913
1810 larryl 62171 set_container (a_container: like container) is
1811     -- Set `container'
1812     do
1813     container := a_container
1814     ensure
1815     set: container = a_container
1816     end
1817 manus 26913
1818 larryl 62171 set_panel (a_panel: like panel) is
1819     -- Set `panel'
1820     do
1821     panel := a_panel
1822     ensure
1823     set: panel = a_panel
1824 manus 50607 end
1825 manus 26913
1826 larryl 62171 set_status_bar (a_bar: like status_bar) is
1827     -- Set `status_bar'
1828 manus 50607 do
1829 larryl 62171 status_bar := a_bar
1830     ensure
1831     set: status_bar = a_bar
1832 manus 50607 end
1833 neilc 49534
1834 larryl 62171 set_window (a_window: like window) is
1835     -- Set `window'
1836 manus 50607 do
1837 larryl 62171 window := a_window
1838     ensure
1839     set: window = a_window
1840 manus 50607 end
1841 neilc 49534
1842 larryl 62171 on_viewpoint_changed is
1843     -- Switch viewpoint.
1844     local
1845     l_formatter: EB_CLASS_TEXT_FORMATTER
1846     l_line: INTEGER
1847 manus 50607 do
1848 larryl 62171 l_formatter := selected_formatter
1849     if l_formatter.button.is_sensitive and then
1850     l_formatter /= managed_main_formatters.first and then
1851     editors_manager.current_editor /= Void
1852     then
1853     l_line := editors_manager.current_editor.first_line_displayed
1854     l_formatter.execute
1855     editors_manager.current_editor.display_line_at_top_when_ready (l_line)
1856     end
1857 manus 51111 end
1858 neilc 49534
1859 larryl 62171 feature {EB_DEVELOPMENT_WINDOW_BUILDER, EB_DEVELOPMENT_WINDOW_PART} -- EB_DEVELOPMENT_WINDOW_MENU_BUILDER issues
1860 manus 55527
1861 larryl 62171 destroy is
1862     -- check if current text has been saved and destroy
1863     local
1864     dialog_w: EV_WARNING_DIALOG
1865 manus 50607 do
1866 larryl 62171 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
1867     process_manager.confirm_external_command_termination (agent terminate_external_command_and_destroy, agent do_nothing, window)
1868 manus 50607 else
1869 larryl 62171 if changed and then not confirmed then
1870     if Window_manager.development_windows_count > 1 then
1871     create dialog_w.make_with_text (Warning_messages.w_save_before_closing)
1872     dialog_w.set_buttons_and_actions (<<"Yes", "No", "Cancel">>, <<agent save_and_destroy, agent force_destroy, agent do_nothing>>)
1873     dialog_w.set_default_push_button (dialog_w.button("Yes"))
1874     dialog_w.set_default_cancel_button (dialog_w.button("Cancel"))
1875     dialog_w.show_modal_to_window (window)
1876     else
1877     -- We let the window manager handle the saving, along with other windows
1878     -- (not development windows)
1879     force_destroy
1880     end
1881     else
1882     Precursor {EB_TOOL_MANAGER}
1883     if context_refreshing_timer /= Void then
1884     context_refreshing_timer.destroy
1885     context_refreshing_timer := Void
1886     end
1887     end
1888 manus 50607 end
1889 manus 26913 end
1890    
1891 larryl 62171 set_command_controller (a_controller: like command_controller) is
1892     -- Set `command_controller'
1893 manus 50607 do
1894 larryl 62171 command_controller := a_controller
1895     ensure
1896     set: command_controller = a_controller
1897 manus 26913 end
1898    
1899 larryl 62171 set_formatting_marks_command_menu_item (a_item: like formatting_marks_command_menu_item) is
1900     -- Set `formatting_marks_command_menu_item'
1901     do
1902     formatting_marks_command_menu_item := a_item
1903     ensure
1904     set: formatting_marks_command_menu_item = a_item
1905     end
1906 manus 51111
1907 larryl 62171 formatting_marks_command_menu_item: EB_COMMAND_MENU_ITEM
1908     -- Menu item used to shw/hide formatting marks.
1909 neilc 49534
1910 larryl 62171 number_of_displayed_external_commands: INTEGER
1911     -- Number of external commands in the tools menu.
1912    
1913     set_number_of_displayed_external_commands (a_number: INTEGER) is
1914     -- Set `number_of_displayed_external_commands'
1915 manus 50607 do
1916 larryl 62171 number_of_displayed_external_commands := a_number
1917 manus 50607 ensure
1918 larryl 62171 set: number_of_displayed_external_commands = a_number
1919 neilc 49534 end
1920 manus 51111
1921 larryl 62171 set_show_dynamic_lib_tool (a_cmd: like show_dynamic_lib_tool) is
1922     -- Set `show_dynamic_lib_tool'
1923 manus 50607 do
1924 larryl 62171 show_dynamic_lib_tool := a_cmd
1925     ensure
1926     set: show_dynamic_lib_tool = a_cmd
1927 rogers 40708 end
1928 manus 51111
1929 larryl 62171 feature {EB_DEVELOPMENT_WINDOW_DIRECTOR, EB_DEVELOPMENT_WINDOW_BUILDER, EB_ADDRESS_MANAGER} --EB_DEVELOPMENT_WINDOW_DIRECTOR issues.
1930    
1931     set_unified_stone (a_bool: like unified_stone) is
1932     -- Set `unified_stone'
1933 manus 50607 do
1934 larryl 62171 unified_stone := a_bool
1935 manus 50607 ensure
1936 larryl 62171 set: unified_stone = a_bool
1937 rogers 44501 end
1938 manus 51111
1939 larryl 62171 set_history_manager (a_manager: like history_manager) is
1940     -- Set `history_manager'
1941 manus 50607 do
1942 larryl 62171 history_manager := a_manager
1943     ensure
1944     set: history_manager = a_manager
1945 manus 50607 end
1946 manus 26913
1947 larryl 62171 set_address_manager (a_manager: like address_manager) is
1948     -- Set `address_manager'
1949     do
1950     address_manager := a_manager
1951     ensure
1952     set: address_manager = a_manager
1953     end
1954 manus 51111
1955 larryl 62171 set_view_points (a_view_points: like view_points_combo) is
1956     -- Set `view_points_combo'
1957 manus 50607 do
1958 larryl 62171 view_points_combo := a_view_points
1959     ensure
1960     set: view_points_combo = a_view_points
1961 manus 26913 end
1962    
1963 larryl 62171 set_initialized_for_builder (a_bool: like initialized) is
1964     -- Set `initialized'
1965 manus 50607 do
1966 larryl 62171 initialized := a_bool
1967     ensure
1968     set: initialized = a_bool
1969 manus 26913 end
1970    
1971 larryl 62171 set_is_destroying (a_bool: like is_destroying) is
1972     -- Set `is_destroying'
1973 manus 50607 do
1974 larryl 62171 is_destroying := a_bool
1975     ensure
1976     set: is_destroying = a_bool
1977 manus 26913 end
1978    
1979 larryl 62171 set_internal_development_window_data (a_data: like internal_development_window_data) is
1980     -- Set `internal_development_window_data'
1981 manus 50607 do
1982 larryl 62171 internal_development_window_data := a_data
1983     ensure
1984     set: internal_development_window_data = a_data
1985 manus 26913 end
1986    
1987 larryl 62171 feature{EB_TOOL, EB_STONE_CHECKER, EB_DEVELOPMENT_WINDOW_BUILDER, EB_DEVELOPMENT_WINDOW_DIRECTOR, EB_DEVELOPMENT_WINDOW_PART}
1988    
1989     command_controller: EB_EDITOR_COMMAND_CONTROLLER
1990     -- Object that takes care of updating the sensitivity of all editor commands.
1991    
1992     feature{EB_TOOL, EB_STONE_CHECKER, EB_DEVELOPMENT_WINDOW_BUILDER, EB_DEVELOPMENT_WINDOW_MENU_BUILDER}
1993    
1994     execute_show_favorites is
1995     -- Show `favorites_tool' if it is closed, close
1996     -- it in the opposite case.
1997     do
1998     tools.favorites_tool.show
1999     end
2000    
2001     feature {EB_DEVELOPMENT_WINDOW_MAIN_BUILDER} -- Execution
2002    
2003 tedf 61580 save_and_switch_formatter (a_formatter: EB_FORMATTER) is
2004     -- Save the file before switching bewteen main formatters when the file is not saved.
2005     require
2006     a_formatter_not_void: a_formatter /= Void
2007     do
2008     if changed then
2009     save_and (agent a_formatter.execute)
2010     else
2011     a_formatter.execute
2012     end
2013     end
2014    
2015 larryl 62171 feature {EB_DEVELOPMENT_WINDOW_BUILDER} -- Access
2016 king 55319
2017     development_window_data: EB_DEVELOPMENT_WINDOW_DATA is
2018     -- Meta data describing `Current'.
2019     do
2020     if internal_development_window_data /= Void then
2021     Result := internal_development_window_data
2022     else
2023     Result := preferences.development_window_data
2024     end
2025     end
2026    
2027 manus 56535 internal_development_window_data: EB_DEVELOPMENT_WINDOW_SESSION_DATA;
2028 king 55319 -- Internal custom meta data for `Current'.
2029    
2030 larryl 62171 feature -- Parts
2031 jfiat 59332
2032 larryl 62171 commands: EB_DEVELOPMENT_WINDOW_COMMANDS
2033     -- All commands except commands from EB_FILEABLE, EB_SHARED_GRAPHICAL_COMMANDS, `show_dynamic_lib_tool'
2034    
2035     menus: EB_DEVELOPMENT_WINDOW_MENUS
2036     -- All menus.
2037    
2038     agents: EB_DEVELOPMENT_WINDOW_AGENTS
2039     -- All agents.
2040    
2041     tools: EB_DEVELOPMENT_WINDOW_TOOLS
2042     -- All tools.
2043    
2044     uis: EB_DEVELOPMENT_WINDOW_UIS
2045     -- All widgets, such as save file dialogs.
2046    
2047     feature {EB_DEVELOPMENT_WINDOW_PART}
2048    
2049     set_text_edited (a_bool: like text_edited) is
2050     -- Set `text_edited'
2051 jfiat 59332 do
2052 larryl 62171 text_edited := a_bool
2053     ensure
2054     set: text_edited = a_bool
2055 jfiat 59332 end
2056    
2057 larryl 62171 set_context_refreshing_timer (a_timer: like context_refreshing_timer) is
2058     -- Set `context_refreshing_timer'
2059     do
2060     context_refreshing_timer := a_timer
2061     ensure
2062     set: context_refreshing_timer = a_timer
2063     end
2064    
2065     invariant
2066     not_void: commands /= Void
2067     not_void: menus /= Void
2068     not_void: agents /= Void
2069     not_void: tools /= Void
2070     not_void: uis /= Void
2071    
2072 manus 56535 indexing
2073     copyright: "Copyright (c) 1984-2006, Eiffel Software"
2074 manus 58027 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
2075 manus 56535 licensing_options: "http://www.eiffel.com/licensing"
2076     copying: "[
2077     This file is part of Eiffel Software's Eiffel Development Environment.
2078 manus 58027
2079 manus 56535 Eiffel Software's Eiffel Development Environment is free
2080     software; you can redistribute it and/or modify it under
2081     the terms of the GNU General Public License as published
2082     by the Free Software Foundation, version 2 of the License
2083     (available at the URL listed under "license" above).
2084 manus 58027
2085 manus 56535 Eiffel Software's Eiffel Development Environment is
2086     distributed in the hope that it will be useful, but
2087     WITHOUT ANY WARRANTY; without even the implied warranty
2088     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2089     See the GNU General Public License for more details.
2090 manus 58027
2091 manus 56535 You should have received a copy of the GNU General Public
2092     License along with Eiffel Software's Eiffel Development
2093     Environment; if not, write to the Free Software Foundation,
2094     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2095     ]"
2096     source: "[
2097     Eiffel Software
2098     356 Storke Road, Goleta, CA 93117 USA
2099     Telephone 805-685-1006, Fax 805-685-6869
2100     Website http://www.eiffel.com
2101     Customer support http://support.eiffel.com
2102     ]"
2103    
2104 manus 26913 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