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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_metric_delete_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: 3450 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description: "Command to delete previously recorded measures."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 author: "Tanit Talbi"
6 date: "$Date$"
7 revision: "$Revision$"
8
9 class
10 EB_METRIC_DELETE_CMD
11
12 inherit
13 EB_METRIC_COMMAND
14
15 create
16 make
17
18 feature -- Initialization
19
20 execute is
21 -- Remove_selected_lines if any.
22 do
23 on_delete_click
24 end
25
26 pixmap: EV_PIXMAP is
27 -- Pixmaps representing the command.
28 do
29 Result := Pixmaps.Icon_delete_measure
30 end
31
32 pixel_buffer: EV_PIXEL_BUFFER is
33 -- Pixel buffer representing the command.
34 do
35 -- Currently there is no pixel buffer for this command.
36 end
37
38 tooltip: STRING is
39 -- Tooltip for the toolbar button.
40 do
41 Result := "Delete current selected row(s)"
42 end
43
44 description: STRING is
45 -- Description for this command.
46 do
47 Result := "Delete metrics"
48 end
49
50 name: STRING is "delete"
51 -- Name of the command. Used to store the command in the
52 -- preferences.
53
54 feature -- Actions
55
56 on_delete_click is
57 -- Delete selected row(s) from `multi_column_list'.
58 require
59 existing_tool: tool /= Void
60 local
61 selected_items: DYNAMIC_LIST [EV_MULTI_COLUMN_LIST_ROW]
62 index_deleted_row: INTEGER
63 do
64 selected_items := tool.multi_column_list.selected_items.twin
65 from
66 selected_items.start
67 until
68 selected_items.after
69 loop
70 index_deleted_row := tool.multi_column_list.index_of (selected_items.item, 1)
71 tool.file_manager.delete_row (index_deleted_row)
72 tool.multi_column_list.prune (selected_items.item)
73 selected_items.forth
74 end
75
76 if tool.file_manager.metric_file /= Void then
77 -- Make sure that a metric file is available.
78 if not tool.file_manager.metric_file.exists then
79 -- Should not be called, if file does not exist, `tool.multi_column_list' is emptied.
80 tool.file_manager.destroy_file_name
81 tool.set_file_loaded (False)
82 tool.file_handler.load_files
83 end
84 check tool.file_manager.metric_file.exists end
85 tool.file_manager.store
86 tool.file_manager.measure_notify_all_but (tool)
87 end
88 end
89
90 indexing
91 copyright: "Copyright (c) 1984-2006, Eiffel Software"
92 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
93 licensing_options: "http://www.eiffel.com/licensing"
94 copying: "[
95 This file is part of Eiffel Software's Eiffel Development Environment.
96
97 Eiffel Software's Eiffel Development Environment is free
98 software; you can redistribute it and/or modify it under
99 the terms of the GNU General Public License as published
100 by the Free Software Foundation, version 2 of the License
101 (available at the URL listed under "license" above).
102
103 Eiffel Software's Eiffel Development Environment is
104 distributed in the hope that it will be useful, but
105 WITHOUT ANY WARRANTY; without even the implied warranty
106 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
107 See the GNU General Public License for more details.
108
109 You should have received a copy of the GNU General Public
110 License along with Eiffel Software's Eiffel Development
111 Environment; if not, write to the Free Software Foundation,
112 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
113 ]"
114 source: "[
115 Eiffel Software
116 356 Storke Road, Goleta, CA 93117 USA
117 Telephone 805-685-1006, Fax 805-685-6869
118 Website http://www.eiffel.com
119 Customer support http://support.eiffel.com
120 ]"
121
122 end -- class EB_METRIC_DELETE_CMD

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23