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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62057 - (show annotations)
Sun Jul 30 06:22:31 2006 UTC (13 years, 4 months ago) by manus
File size: 4228 byte(s)
EiffelStudio docking branch. It only contains modified classes needed to get the docking version of EiffelStudio.
1 indexing
2 description: "Command for feature pull up refactoring."
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_RF_PULL_COMMAND
10
11 inherit
12 EB_TOOLBARABLE_AND_MENUABLE_COMMAND
13 redefine
14 new_toolbar_item,
15 tooltext,
16 is_tooltext_important
17 end
18
19 EB_SHARED_DEBUG_TOOLS
20
21 SHARED_EIFFEL_PROJECT
22
23 EB_SHARED_MANAGERS
24
25 EB_CONSTANTS
26
27 EB_SHARED_PREFERENCES
28
29 create
30 make
31
32 feature {NONE} -- Initialization
33
34 make (a_manager: ERF_MANAGER) is
35 -- Create associated to `a_manager'.
36 require
37 a_manager_not_void: a_manager /= Void
38 do
39 manager := a_manager
40 end
41
42 feature -- Status
43
44 is_tooltext_important: BOOLEAN is
45 -- Is the tooltext important shown when view is 'Selective Text'
46 do
47 Result := True
48 end
49
50 feature -- Access
51
52 description: STRING is
53 -- What is printed in the customize dialog.
54 do
55 Result := interface_names.f_refactoring_pull
56 end
57
58 tooltip: STRING is
59 -- Pop-up help on buttons.
60 do
61 Result := description
62 end
63
64 tooltext: STRING is
65 -- Text for toolbar button
66 do
67 Result := interface_names.b_refactoring_pull
68 end
69
70 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOOL_BAR_BUTTON is
71 -- Create a new toolbar button for `Current'.
72 do
73 Result := Precursor {EB_TOOLBARABLE_AND_MENUABLE_COMMAND} (display_text)
74 Result.drop_actions.extend (agent drop_feature (?))
75 end
76
77 menu_name: STRING is
78 -- Menu entry corresponding to `Current'.
79 do
80 Result := tooltext
81 end
82
83 pixmap: EV_PIXMAP is
84 -- Icon for `Current'.
85 do
86 Result := pixmaps.icon_pixmaps.refactor_feature_up_icon
87 end
88
89 Name: STRING is "RF_pull"
90 -- Name of `Current' to identify it.
91
92 feature -- Events
93
94 drop_feature (fs: FEATURE_STONE) is
95 -- Process feature stone.
96 local
97 feature_i: FEATURE_I
98 rf: ERF_FEATURE_PULL
99 wd: EV_WARNING_DIALOG
100 do
101 feature_i := fs.class_i.compiled_class.feature_of_feature_id (fs.e_feature.feature_id)
102 if feature_i /= Void and then fs.e_feature.associated_class.class_id = feature_i.written_in then
103 rf := manager.feature_pull_refactoring
104 rf.set_feature (feature_i)
105 manager.execute_refactoring (rf)
106 else
107 create wd.make_with_text (warning_messages.w_feature_not_written_in_class)
108 wd.show_modal_to_window (window_manager.last_focused_development_window.window)
109 end
110 end
111
112 feature -- Execution
113
114 execute is
115 -- Execute.
116 local
117 fs: FEATURE_STONE
118 wd: EV_WARNING_DIALOG
119 window: EB_DEVELOPMENT_WINDOW
120 do
121 window := window_manager.last_focused_development_window
122 fs ?= window.stone
123 if fs /= Void then
124 drop_feature (fs)
125 else
126 create wd.make_with_text (warning_messages.w_Select_feature_to_pull)
127 wd.show_modal_to_window (window.window)
128 end
129 end
130
131 feature {NONE} -- Implementation
132
133 manager: ERF_MANAGER
134 -- Refactoring manager
135
136 invariant
137 manager_not_void: manager /= Void
138
139 indexing
140 copyright: "Copyright (c) 1984-2006, Eiffel Software"
141 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
142 licensing_options: "http://www.eiffel.com/licensing"
143 copying: "[
144 This file is part of Eiffel Software's Eiffel Development Environment.
145
146 Eiffel Software's Eiffel Development Environment is free
147 software; you can redistribute it and/or modify it under
148 the terms of the GNU General Public License as published
149 by the Free Software Foundation, version 2 of the License
150 (available at the URL listed under "license" above).
151
152 Eiffel Software's Eiffel Development Environment is
153 distributed in the hope that it will be useful, but
154 WITHOUT ANY WARRANTY; without even the implied warranty
155 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
156 See the GNU General Public License for more details.
157
158 You should have received a copy of the GNU General Public
159 License along with Eiffel Software's Eiffel Development
160 Environment; if not, write to the Free Software Foundation,
161 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
162 ]"
163 source: "[
164 Eiffel Software
165 356 Storke Road, Goleta, CA 93117 USA
166 Telephone 805-685-1006, Fax 805-685-6869
167 Website http://www.eiffel.com
168 Customer support http://support.eiffel.com
169 ]"
170
171 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23