/[eiffelstudio]/trunk/Src/Eiffel/interface/new_graphical/preference_tool/parameters/eb_misc_shortcut_data.e
ViewVC logotype

Contents of /trunk/Src/Eiffel/interface/new_graphical/preference_tool/parameters/eb_misc_shortcut_data.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 73104 - (show annotations)
Fri Apr 18 19:22:11 2008 UTC (11 years, 9 months ago) by paulb
File size: 12681 byte(s)
Added shortcut for the contract tool.
1 indexing
2 description: "Shortcuts preferences other than editor shortcuts and external commands shortcuts."
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_MISC_SHORTCUT_DATA
10
11 inherit
12 EB_SHORTCUTS_DATA
13
14 EV_KEY_CONSTANTS
15 export
16 {NONE} all
17 end
18
19 SHARED_BENCH_NAMES
20 export
21 {NONE} all
22 end
23
24 create
25 make
26
27 feature {EB_PREFERENCES} -- Initialization
28
29 make (a_preferences: PREFERENCES) is
30 -- Create
31 require
32 preferences_not_void: a_preferences /= Void
33 do
34 preferences := a_preferences
35 initialize_preferences
36 ensure
37 preferences_not_void: preferences /= Void
38 end
39
40 feature -- Access
41
42 shortcuts: HASH_TABLE [SHORTCUT_PREFERENCE, STRING] is
43 -- Shortcuts
44 once
45 create Result.make (default_shortcut_actions.count)
46 end
47
48 feature -- Fixed shortcuts
49
50 focus_editor_shortcut: EB_FIXED_SHORTCUT is
51 -- Fixed shortcut for focusing current editor.
52 once
53 create Result.make (names.fs_focus_on_editor, create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_escape), False, False, False)
54 end
55
56 close_window_shortcut: EB_FIXED_SHORTCUT is
57 -- Fixed shortcut for closing window.
58 once
59 create Result.make (names.fs_close_window, create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_f4), True, False, False)
60 end
61
62 undo_shortcut: EB_FIXED_SHORTCUT is
63 -- Fixed shortcut for all undo command.
64 once
65 create Result.make (names.fs_undo_command, create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_z), False, True, False)
66 end
67
68 redo_shortcut: EB_FIXED_SHORTCUT is
69 -- Fixed shortcut for all redo command.
70 once
71 create Result.make (names.fs_redo_command, create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_y), False, True, False)
72 end
73
74 debug_menu_shortcut: EB_FIXED_SHORTCUT is
75 -- Shortcut for debug menu
76 once
77 create Result.make (names.fs_debug_menu, create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_d), True, True, False)
78 end
79
80 feature {NONE} -- Initializing fixed shortcuts
81
82 initialize_fixed_shortcuts is
83 -- Initialize fixed shortcuts in relative shortcuts.
84 -- Fixed shortcuts can not be overridden by normal shortcuts.
85 do
86 focus_editor_shortcut.set_group (main_window_group)
87 undo_shortcut.set_group (main_window_group)
88 redo_shortcut.set_group (main_window_group)
89 close_window_shortcut.set_group (main_window_group)
90 debug_menu_shortcut.set_group (main_window_group)
91 end
92
93 feature {NONE} -- Preference Strings
94
95 initialize_preferences is
96 -- Initialize preference values.
97 local
98 l_manager: EB_PREFERENCE_MANAGER
99 do
100 initialize_fixed_shortcuts
101
102 -- General
103 create l_manager.make (preferences, "shortcuts.general")
104 default_shortcut_actions := general_shortcuts
105 initialize_shortcuts_prefs (l_manager)
106
107 -- File
108 create l_manager.make (preferences, "shortcuts.file")
109 default_shortcut_actions := file_shortcuts
110 initialize_shortcuts_prefs (l_manager)
111
112 -- View -> Tools
113 create l_manager.make (preferences, "shortcuts.view.tools")
114 default_shortcut_actions := show_tool_shortcuts
115 initialize_shortcuts_prefs (l_manager)
116
117 -- View
118 create l_manager.make (preferences, "shortcuts.view")
119 default_shortcut_actions := views_shortcuts
120 initialize_shortcuts_prefs (l_manager)
121
122 -- Project
123 create l_manager.make (preferences, "shortcuts.project")
124 default_shortcut_actions := project_shortcuts
125 initialize_shortcuts_prefs (l_manager)
126
127 -- debug
128 create l_manager.make (preferences, "shortcuts.debug")
129 default_shortcut_actions := debug_shortcuts
130 initialize_shortcuts_prefs (l_manager)
131 end
132
133 preferences: PREFERENCES
134 -- Preferences
135
136 default_shortcut_actions: ARRAYED_LIST [TUPLE [actions: HASH_TABLE [TUPLE [BOOLEAN, BOOLEAN, BOOLEAN, STRING], STRING]; group: MANAGED_SHORTCUT_GROUP]]
137 -- Array of shortcut defaults (Alt/Ctrl/Shift/KeyString) & shortcut group
138
139 feature {NONE} -- Modifiable shortcuts
140
141 general_shortcuts: like default_shortcut_actions is
142 -- General shortcuts. (Alt/Ctrl/Shift/KeyString)
143 local
144 l_hash: HASH_TABLE [TUPLE [BOOLEAN, BOOLEAN, BOOLEAN, STRING], STRING]
145 do
146 create Result.make (1)
147 create l_hash.make (2)
148 l_hash.put ([False, False, False, key_strings.item (Key_f6).twin.as_string_8], "focus_on_class_address")
149 l_hash.put ([False, True, False, key_strings.item (Key_f4).twin.as_string_8], "close_focusing_docking_tool_or_editor")
150 Result.extend ([l_hash, main_window_group])
151 end
152
153 file_shortcuts: like default_shortcut_actions is
154 -- File shortcuts. (Alt/Ctrl/Shift/KeyString)
155 local
156 l_hash: HASH_TABLE [TUPLE [BOOLEAN, BOOLEAN, BOOLEAN, STRING], STRING]
157 do
158 create Result.make (1)
159 create l_hash.make (4)
160 l_hash.put ([False, True, False, key_strings.item (key_t).twin.as_string_8], "new_tab")
161 l_hash.put ([False, True, False, key_strings.item (Key_n).twin.as_string_8], "new_window")
162 l_hash.put ([False, True, False, key_strings.item (Key_s).twin.as_string_8], "save")
163 l_hash.put ([False, True, True, key_strings.item (Key_s).twin.as_string_8], "save_all")
164 Result.extend ([l_hash, main_window_group])
165 end
166
167 show_tool_shortcuts: like default_shortcut_actions is
168 -- Show tool shortcuts. (Alt/Ctrl/Shift/KeyString)
169 local
170 l_hash: HASH_TABLE [TUPLE [BOOLEAN, BOOLEAN, BOOLEAN, STRING], STRING]
171 do
172 create Result.make (1)
173 create l_hash.make (22)
174 l_hash.put ([True, True, False, key_strings.item (Key_f).twin.as_string_8], "show_search_tool")
175 l_hash.put ([True, True, False, key_strings.item (Key_r).twin.as_string_8], "show_search_report_tool")
176 l_hash.put ([True, True, False, key_strings.item (Key_o).twin.as_string_8], "show_output_tool")
177 l_hash.put ([True, True, False, key_strings.item (Key_0).twin.as_string_8], "show_c_output_tool")
178 l_hash.put ([True, True, False, key_strings.item (Key_x).twin.as_string_8], "show_external_output_tool")
179 l_hash.put ([True, True, False, key_strings.item (Key_e).twin.as_string_8], "show_errors_and_warnings_tool")
180 l_hash.put ([True, True, False, key_strings.item (Key_l).twin.as_string_8], "show_logger_tool")
181 l_hash.put ([False, False, False, key_strings.item (Key_f4).twin.as_string_8], "show_properties_tool")
182 l_hash.put ([True, True, False, key_strings.item (Key_t).twin.as_string_8], "show_features_tool")
183 l_hash.put ([True, True, False, key_strings.item (Key_u).twin.as_string_8], "show_clusters_tool")
184 l_hash.put ([True, True, False, key_strings.item (Key_m).twin.as_string_8], "show_metric_tool")
185 l_hash.put ([True, True, False, key_strings.item (Key_y).twin.as_string_8], "show_dependency_tool")
186 l_hash.put ([True, True, False, key_strings.item (Key_i).twin.as_string_8], "show_diagram_tool")
187 l_hash.put ([True, True, False, key_strings.item (Key_c).twin.as_string_8], "show_class_tool")
188 l_hash.put ([True, True, False, key_strings.item (Key_v).twin.as_string_8], "show_feature_relation_tool")
189 l_hash.put ([True, True, False, key_strings.item (Key_g).twin.as_string_8], "show_contract_tool")
190 l_hash.put ([True, True, False, key_strings.item (Key_a).twin.as_string_8], "show_favorites_tool")
191 l_hash.put ([True, True, False, key_strings.item (Key_n).twin.as_string_8], "show_windows_tool")
192 l_hash.put ([True, True, False, key_strings.item (Key_b).twin.as_string_8], "show_breakpoints_tool")
193 Result.extend ([l_hash, main_window_group])
194 end
195
196 views_shortcuts: like default_shortcut_actions is
197 -- Basic/Clickable/Flat/Contract/interface etc. view shortcuts. (Alt/Ctrl/Shift/KeyString)
198 local
199 l_hash: HASH_TABLE [TUPLE [BOOLEAN, BOOLEAN, BOOLEAN, STRING], STRING]
200 do
201 create Result.make (1)
202 create l_hash.make (8)
203 l_hash.put ([True, False, False, key_strings.item (key_down).twin.as_string_8], "send_to_context")
204 l_hash.put ([False, True, True, key_strings.item (Key_t).twin.as_string_8], "basic_text_view")
205 l_hash.put ([False, True, True, key_strings.item (Key_c).twin.as_string_8], "clickable_text_view")
206 l_hash.put ([False, True, True, key_strings.item (Key_f).twin.as_string_8], "flat_view")
207 l_hash.put ([False, True, True, key_strings.item (Key_o).twin.as_string_8], "contract_view")
208 l_hash.put ([False, True, True, key_strings.item (Key_i).twin.as_string_8], "interface_view")
209 l_hash.put ([True, False, False, key_strings.item (key_left).twin.as_string_8], "go_back")
210 l_hash.put ([True, False, False, key_strings.item (key_right).twin.as_string_8], "go_forth")
211 Result.extend ([l_hash, main_window_group])
212 end
213
214 project_shortcuts: like default_shortcut_actions is
215 -- Project shortcuts. (Alt/Ctrl/Shift/KeyString)
216 local
217 l_hash: HASH_TABLE [TUPLE [BOOLEAN, BOOLEAN, BOOLEAN, STRING], STRING]
218 do
219 create Result.make (1)
220 create l_hash.make (6)
221 l_hash.put ([False, False, False, key_strings.item (key_f7).twin.as_string_8], "compile")
222 l_hash.put ([True, False, False, key_strings.item (key_f8).twin.as_string_8], "search_new_class_and_compile")
223 l_hash.put ([False, False, True, key_strings.item (key_f8).twin.as_string_8], "check_overrides_and_compile")
224 l_hash.put ([False, True, False, key_strings.item (key_f7).twin.as_string_8], "freeze")
225 l_hash.put ([False, True, True, key_strings.item (key_f7).twin.as_string_8], "finalize")
226 l_hash.put ([False, True, False, key_strings.item (key_pause).twin.as_string_8], "cancel")
227 l_hash.put ([False, True, False, key_strings.item (key_f8).twin.as_string_8], "go_to_next_error")
228 l_hash.put ([False, True, True, key_strings.item (key_f8).twin.as_string_8], "go_to_previous_error")
229 l_hash.put ([True, True, False, key_strings.item (key_f8).twin.as_string_8], "go_to_next_warning")
230 l_hash.put ([True, True, True, key_strings.item (key_f8).twin.as_string_8], "go_to_previous_warning")
231 Result.extend ([l_hash, main_window_group])
232 end
233
234 debug_shortcuts: like default_shortcut_actions is
235 -- Debug shortcuts. (Alt/Ctrl/Shift/KeyString)
236 local
237 l_hash: HASH_TABLE [TUPLE [BOOLEAN, BOOLEAN, BOOLEAN, STRING], STRING]
238 do
239 create Result.make (1)
240 create l_hash.make (12)
241 l_hash.put ([False, False, False, key_strings.item (key_f10).twin.as_string_8], "step_by_step")
242 l_hash.put ([False, False, False, key_strings.item (key_f11).twin.as_string_8], "step_into")
243 l_hash.put ([False, False, True, key_strings.item (key_f11).twin.as_string_8], "step_out_of_routine")
244 l_hash.put ([False, False, False, key_strings.item (key_f5).twin.as_string_8], "run")
245 l_hash.put ([False, True, False, key_strings.item (key_f5).twin.as_string_8], "run_ignore_breakpoints")
246 l_hash.put ([False, True, True, key_strings.item (key_f5).twin.as_string_8], "pause_application")
247 l_hash.put ([False, False, True, key_strings.item (key_f5).twin.as_string_8], "stop_application")
248
249 l_hash.put ([True, True, False, key_strings.item (Key_s).twin.as_string_8], "show_call_stack_tool")
250 l_hash.put ([True, True, False, key_strings.item (Key_p).twin.as_string_8], "show_threads_tool")
251 l_hash.put ([True, True, False, key_strings.item (Key_j).twin.as_string_8], "show_objects_tool")
252 l_hash.put ([True, True, False, key_strings.item (Key_l).twin.as_string_8], "show_object_viewer_tool")
253 l_hash.put ([True, True, False, key_strings.item (Key_h).twin.as_string_8], "show_watch_tool")
254 Result.extend ([l_hash, main_window_group])
255 end
256
257 invariant
258 preferences_not_void: preferences /= Void
259
260 indexing
261 copyright: "Copyright (c) 1984-2006, Eiffel Software"
262 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
263 licensing_options: "http://www.eiffel.com/licensing"
264 copying: "[
265 This file is part of Eiffel Software's Eiffel Development Environment.
266
267 Eiffel Software's Eiffel Development Environment is free
268 software; you can redistribute it and/or modify it under
269 the terms of the GNU General Public License as published
270 by the Free Software Foundation, version 2 of the License
271 (available at the URL listed under "license" above).
272
273 Eiffel Software's Eiffel Development Environment is
274 distributed in the hope that it will be useful, but
275 WITHOUT ANY WARRANTY; without even the implied warranty
276 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
277 See the GNU General Public License for more details.
278
279 You should have received a copy of the GNU General Public
280 License along with Eiffel Software's Eiffel Development
281 Environment; if not, write to the Free Software Foundation,
282 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
283 ]"
284 source: "[
285 Eiffel Software
286 356 Storke Road, Goleta, CA 93117 USA
287 Telephone 805-685-1006, Fax 805-685-6869
288 Website http://www.eiffel.com
289 Customer support http://support.eiffel.com
290 ]"
291
292 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23