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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62171 - (show annotations)
Tue Aug 1 01:27:17 2006 UTC (13 years, 6 months ago) by larryl
File size: 4641 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description: "Command to create a new tab editor."
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_NEW_TAB_EDITOR_COMMAND
10
11 inherit
12 EB_TOOLBARABLE_AND_MENUABLE_COMMAND
13 redefine
14 tooltext,
15 new_toolbar_item,
16 new_sd_toolbar_item,
17 new_mini_toolbar_item
18 end
19
20 EB_SHARED_WINDOW_MANAGER
21
22 EB_CONSTANTS
23
24 create
25 make
26
27 feature -- Initialization
28
29 make (dev_window: EB_DEVELOPMENT_WINDOW) is
30 -- Creation method.
31 require
32 dev_window_attached: dev_window /= Void
33 do
34 development_window := dev_window
35 create accelerator.make_with_key_combination (
36 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.Key_t),
37 True, False, False)
38 accelerator.actions.extend (agent execute)
39 accelerator.actions.extend (agent (development_window.address_manager).on_new_tab_command)
40 ensure
41 development_window_attached: development_window = dev_window
42 end
43
44 feature -- Execution
45
46 execute is
47 -- Create new tab.
48 do
49 editors_manager.create_editor
50 end
51
52 feature -- Items
53
54 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOOL_BAR_BUTTON is
55 -- Create a new toolbar button for this command.
56 do
57 Result := Precursor (display_text)
58 Result.drop_actions.extend (agent execute_with_stone)
59 end
60
61 new_sd_toolbar_item (display_text: BOOLEAN): EB_SD_COMMAND_TOOL_BAR_BUTTON is
62 -- New toolbar item for dockable toolbar.
63 do
64 Result := Precursor {EB_TOOLBARABLE_AND_MENUABLE_COMMAND}(display_text)
65 Result.drop_actions.extend (agent execute_with_stone)
66 end
67
68 new_mini_toolbar_item: EB_COMMAND_TOOL_BAR_BUTTON is
69 -- New mini toolbar item.
70 do
71 Result := Precursor {EB_TOOLBARABLE_AND_MENUABLE_COMMAND}
72 Result.drop_actions.extend (agent execute_with_stone)
73 end
74
75 feature {NONE} -- Implementation
76
77 execute_with_stone (a_stone: STONE) is
78 -- Execute with `a_stone'.
79 local
80 l_editor : EB_SMART_EDITOR
81 do
82 l_editor := editors_manager.editor_with_stone (a_stone)
83 if l_editor = Void then
84 execute
85 editors_manager.select_editor (editors_manager.last_created_editor)
86 else
87 editors_manager.select_editor (l_editor)
88 end
89 development_window.set_stone (a_stone)
90 end
91
92 menu_name: STRING is
93 -- Name as it appears in the menu (with & symbol).
94 do
95 Result := interface_names.m_new_tab
96 end
97
98 pixmap: EV_PIXMAP is
99 -- Pixmap representing the command.
100 do
101 Result := pixmaps.icon_pixmaps.new_document_icon
102 end
103
104 pixel_buffer: EV_PIXEL_BUFFER is
105 -- Pixel buffer representing the command.
106 do
107 Result := pixmaps.icon_pixmaps.new_document_icon_buffer
108 end
109
110 tooltip: STRING is
111 -- Tooltip for the toolbar button.
112 do
113 Result := interface_names.f_new_tab
114 end
115
116 tooltext: STRING is
117 -- Text for the toolbar button.
118 do
119 Result := interface_names.b_new_tab
120 end
121
122 description: STRING is
123 -- Description for this command.
124 do
125 Result := interface_names.f_new_tab
126 end
127
128 name: STRING is
129 -- Name of the command. Used to store the command in the
130 -- preferences.
131 do
132 Result := "New_tab"
133 end
134
135 feature {NONE} -- Implementation
136
137 editors_manager: EB_EDITORS_MANAGER is
138 -- Editors manager.
139 do
140 Result := development_window.editors_manager
141 end
142
143 development_window: EB_DEVELOPMENT_WINDOW;
144 -- Development window.
145
146 indexing
147 copyright: "Copyright (c) 1984-2006, Eiffel Software"
148 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
149 licensing_options: "http://www.eiffel.com/licensing"
150 copying: "[
151 This file is part of Eiffel Software's Eiffel Development Environment.
152
153 Eiffel Software's Eiffel Development Environment is free
154 software; you can redistribute it and/or modify it under
155 the terms of the GNU General Public License as published
156 by the Free Software Foundation, version 2 of the License
157 (available at the URL listed under "license" above).
158
159 Eiffel Software's Eiffel Development Environment is
160 distributed in the hope that it will be useful, but
161 WITHOUT ANY WARRANTY; without even the implied warranty
162 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
163 See the GNU General Public License for more details.
164
165 You should have received a copy of the GNU General Public
166 License along with Eiffel Software's Eiffel Development
167 Environment; if not, write to the Free Software Foundation,
168 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
169 ]"
170 source: "[
171 Eiffel Software
172 356 Storke Road, Goleta, CA 93117 USA
173 Telephone 805-685-1006, Fax 805-685-6869
174 Website http://www.eiffel.com
175 Customer support http://support.eiffel.com
176 ]"
177
178
179 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23