/[eiffelstudio]/branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_system_cmd.e
ViewVC logotype

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_system_cmd.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62043 - (show annotations)
Sun Jul 30 06:19:46 2006 UTC (13 years, 4 months ago) by manus
File size: 7897 byte(s)
EiffelStudio docking branch. It only contains modified classes needed to get the docking version of EiffelStudio.
1 indexing
2 description: "Command to open system configuration tool window."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date: "$Date$"
6 revision: "$Revision$"
7
8 class
9 EB_SYSTEM_CMD
10
11 inherit
12 EB_TOOLBARABLE_AND_MENUABLE_COMMAND
13 redefine
14 new_toolbar_item,
15 tooltext
16 end
17
18 EB_SHARED_INTERFACE_TOOLS
19 export {NONE} all end
20
21 EB_GRAPHICAL_ERROR_MANAGER
22 export {NONE} all end
23
24 SHARED_WORKBENCH
25 export {NONE} all end
26
27 EB_CONSTANTS
28 export {NONE} all end
29
30 EB_SHARED_PREFERENCES
31 export {NONE} all end
32
33 EV_SHARED_APPLICATION
34 export {NONE} all end
35
36 SHARED_CONFIG_WINDOWS
37
38 create
39 make
40
41 feature {NONE} -- Initialization
42
43 make is
44 -- Initialize default_values.
45 do
46 end
47
48 feature -- Access
49
50 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOOL_BAR_BUTTON is
51 do
52 Result := Precursor {EB_TOOLBARABLE_AND_MENUABLE_COMMAND} (display_text)
53 Result.pointer_button_press_actions.put_front (agent button_right_click_action)
54 Result.drop_actions.extend (agent on_drop)
55 Result.drop_actions.set_veto_pebble_function (agent dropable)
56 end
57
58 feature -- Basic operations
59
60 execute is
61 -- Open the Project configuration window.
62 local
63 rescued: BOOLEAN
64 wd: EV_WARNING_DIALOG
65 l_debugs: SEARCH_TABLE [STRING]
66 l_sorted_debugs: DS_ARRAYED_LIST [STRING]
67 l_fact: CONF_COMP_FACTORY
68 l_load: CONF_LOAD
69 l_config: STRING
70 do
71 if not rescued then
72 if ev_application.ctrl_pressed then
73 gc_window.show
74 else
75 l_config := lace.conf_system.file_name
76 config_windows.search (l_config)
77 if config_windows.found and then config_windows.found_item.is_show_requested then
78 configuration_window := config_windows.found_item
79 configuration_window.bring_to_front
80 else
81 create l_fact
82 create l_load.make (l_fact)
83 l_load.retrieve_configuration (l_config)
84 if l_load.is_error then
85 create wd.make_with_text (l_load.last_error.out)
86 wd.show_modal_to_window (window_manager.
87 last_focused_development_window.window)
88 else
89 -- sort debugs
90 if workbench.system_defined then
91 l_debugs := system.debug_clauses
92 end
93 if l_debugs /= Void then
94 create l_sorted_debugs.make (l_debugs.count)
95 from
96 l_debugs.start
97 until
98 l_debugs.after
99 loop
100 l_sorted_debugs.put_last (l_debugs.item_for_iteration)
101 l_debugs.forth
102 end
103 l_sorted_debugs.sort (create {DS_QUICK_SORTER [STRING]}.make (create {KL_COMPARABLE_COMPARATOR [STRING]}.make))
104 else
105 create l_sorted_debugs.make_default
106 end
107
108 -- only create a new configuration window if the data changed
109 if configuration_window /= Void and then not configuration_window.is_canceled and configuration_window.conf_system.file_date = l_load.last_system.file_date then
110 configuration_window.set_debugs (l_sorted_debugs)
111 else
112 l_load.last_system.targets.start
113 l_load.last_system.set_application_target (l_load.last_system.targets.item_for_iteration)
114 create configuration_window.make (l_load.last_system, l_fact, l_sorted_debugs)
115 end
116
117 configuration_window.show
118 end
119 end
120 end
121 end
122 rescue
123 display_error_message (window_manager.last_focused_development_window.window)
124 if catch_exception then
125 rescued := True
126 retry
127 end
128 end
129
130 feature {NONE} -- Actions
131
132 on_drop (a_stone: CLUSTER_STONE) is
133 -- If we have a group stone for an editable library, edit this library.
134 require
135 a_stone_not_void: a_stone /= Void
136 local
137 l_lib: CONF_LIBRARY
138 wd: EV_WARNING_DIALOG
139 l_sorted_debugs: DS_ARRAYED_LIST [STRING]
140 l_fact: CONF_COMP_FACTORY
141 l_load: CONF_LOAD
142 l_config: STRING
143 do
144 if a_stone.group.is_library then
145 l_lib ?= a_stone.group
146 check
147 library: l_lib /= Void
148 end
149 if not l_lib.is_readonly then
150 l_config := l_lib.library_target.system.file_name
151 config_windows.search (l_config)
152 if config_windows.found and then config_windows.found_item.is_show_requested then
153 configuration_window := config_windows.found_item
154 configuration_window.bring_to_front
155 else
156 create l_fact
157 create l_load.make (l_fact)
158 l_load.retrieve_configuration (l_config)
159 if l_load.is_error then
160 create wd.make_with_text (l_load.last_error.out)
161 wd.show_modal_to_window (window_manager.
162 last_focused_development_window.window)
163 else
164 create l_sorted_debugs.make_default
165 l_load.last_system.targets.start
166 l_load.last_system.set_application_target (l_load.last_system.targets.item_for_iteration)
167 create configuration_window.make (l_load.last_system, l_fact, l_sorted_debugs)
168 configuration_window.show
169 end
170 end
171 end
172 end
173 end
174
175 dropable (a_stone: CLUSTER_STONE): BOOLEAN is
176 -- Can `st' be dropped on `Current'?
177 require
178 a_stone_not_void: a_stone /= Void
179 do
180 Result := a_stone.group.is_library and then not a_stone.group.is_readonly
181 end
182
183
184 feature {NONE} -- Implementation
185
186 configuration_window: CONFIGURATION_WINDOW
187 -- Configuration window, as a class attribute in order for it to not get collecte by the gc.
188
189 gc_window: EB_GC_STATISTIC_WINDOW is
190 once
191 create Result.make
192 ensure
193 gc_window_not_void: Result /= Void
194 end
195
196 name: STRING is "System_tool"
197 -- Name of command. Used to store command in preferences
198
199 pixmap: EV_PIXMAP is
200 -- Pixmap representing command.
201 do
202 Result := pixmaps.icon_pixmaps.tool_config_icon
203 end
204
205 description: STRING is
206 -- Description for command
207 do
208 Result := Interface_names.e_Project_settings
209 end
210
211 tooltip: STRING is
212 -- Tooltip for toolbar button
213 do
214 Result := Interface_names.e_Project_settings
215 end
216
217 tooltext: STRING is
218 -- Tooltip for toolbar button
219 do
220 Result := Interface_names.b_Project_settings
221 end
222
223 menu_name: STRING is
224 do
225 Result := Interface_names.m_System_new
226 end
227
228 button_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
229 -- Show the ace file in editor.
230 local
231 cmd_exec: COMMAND_EXECUTOR
232 cmd_string: STRING
233 do
234 if a_button = 3 and is_sensitive then
235 cmd_string := preferences.misc_data.external_editor_command.twin
236 if not cmd_string.is_empty then
237 cmd_string.replace_substring_all ("$target", eiffel_ace.lace.file_name)
238 cmd_string.replace_substring_all ("$line", "0")
239 create cmd_exec
240 cmd_exec.execute (cmd_string)
241 end
242 end
243 end
244
245 indexing
246 copyright: "Copyright (c) 1984-2006, Eiffel Software"
247 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
248 licensing_options: "http://www.eiffel.com/licensing"
249 copying: "[
250 This file is part of Eiffel Software's Eiffel Development Environment.
251
252 Eiffel Software's Eiffel Development Environment is free
253 software; you can redistribute it and/or modify it under
254 the terms of the GNU General Public License as published
255 by the Free Software Foundation, version 2 of the License
256 (available at the URL listed under "license" above).
257
258 Eiffel Software's Eiffel Development Environment is
259 distributed in the hope that it will be useful, but
260 WITHOUT ANY WARRANTY; without even the implied warranty
261 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
262 See the GNU General Public License for more details.
263
264 You should have received a copy of the GNU General Public
265 License along with Eiffel Software's Eiffel Development
266 Environment; if not, write to the Free Software Foundation,
267 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
268 ]"
269 source: "[
270 Eiffel Software
271 356 Storke Road, Goleta, CA 93117 USA
272 Telephone 805-685-1006, Fax 805-685-6869
273 Website http://www.eiffel.com
274 Customer support http://support.eiffel.com
275 ]"
276
277 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23