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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23