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

Annotation of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_pretty_print_cmd.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62171 - (hide annotations)
Tue Aug 1 01:27:17 2006 UTC (13 years, 5 months ago) by larryl
File size: 5205 byte(s)
First commit docking tabbed Eiffel Studio.
1 manus 26913 indexing
2     description: "Command that allows the user to have a nicer display for his object value %
3     %especially strings."
4 manus 56535 legal: "See notice at end of class."
5     status: "See notice at end of class."
6 manus 26913 author: "Xavier Rousselot"
7     date: "$Date$"
8     revision: "$Revision$"
9    
10     class
11     EB_PRETTY_PRINT_CMD
12    
13     inherit
14     EB_TOOLBARABLE_AND_MENUABLE_COMMAND
15     redefine
16     mini_pixmap,
17     new_mini_toolbar_item
18     end
19 jfiat 56447
20 manus 26913 EB_CONSTANTS
21    
22 jfiat 56447 EB_SHARED_DEBUG_TOOLS
23 jfiat 48524
24 manus 26913 create
25     make
26    
27     feature {NONE} -- Initialization
28    
29 jfiat 48524 make is
30 manus 26913 -- Initialize `Current' and associate it with `a_tool'.
31     do
32     create opened_dialogs.make (5)
33     end
34    
35     feature -- Access
36    
37 king 56753 mini_pixmap: EV_PIXMAP is
38     -- 8*8 pixmap representing `Current'.
39 manus 26913 do
40 paulb 59955 Result := pixmaps.mini_pixmaps.debugger_expand_info_icon
41 manus 26913 end
42    
43     tooltip: STRING is
44     -- Tooltip for Current.
45     do
46     Result := Interface_names.e_Pretty_print
47     end
48    
49     description: STRING is
50     -- Tooltip for Current.
51     do
52     Result := Interface_names.e_Pretty_print
53     end
54    
55     name: STRING is
56     -- Tooltip for Current.
57     do
58     Result := "Pretty_print"
59     end
60    
61 king 56753 pixmap: EV_PIXMAP is
62 manus 26913 -- No big pixmap is necessary.
63     do
64 jfiat 56447
65 manus 26913 end
66 larryl 62171
67     pixel_buffer: EV_PIXEL_BUFFER is
68     -- Pixel buffer representing the command.
69     do
70     -- Currently there is no pixel buffer for this command.
71     end
72 manus 26913
73     menu_name: STRING is
74     -- Menu name for `Current'.
75     do
76     Result := Interface_names.m_Pretty_print
77     end
78    
79     new_mini_toolbar_item: EB_COMMAND_TOOL_BAR_BUTTON is
80     -- Create a new mini toolbar button for this command.
81     do
82     Result := Precursor
83 julieng 37681 Result.drop_actions.extend (agent on_stone_dropped)
84     Result.drop_actions.set_veto_pebble_function (agent accepts_stone)
85 manus 26913 end
86    
87     feature -- Status report
88    
89     associated_window: EV_WINDOW is
90     -- Window to which the child dialogs will be modeless to.
91     do
92 jfiat 56447 Result := Eb_debugger_manager.debugging_window.window
93 manus 26913 end
94    
95 manus 32944 feature {EB_PRETTY_PRINT_DIALOG} -- Status report
96 manus 26913
97 manus 32944 accepts_stone (st: OBJECT_STONE): BOOLEAN is
98     -- Can the user drop `st'?
99 jfiat 51524 local
100     dv: DUMP_VALUE
101 manus 32944 do
102 jfiat 52056 if st /= Void then
103     create dv.make_object (st.object_address, st.dynamic_class)
104     Result := dv.has_formatted_output
105     end
106 manus 32944 end
107 manus 26913
108     feature -- Basic operations
109    
110 jfiat 52056 set_stone (st: OBJECT_STONE) is
111     do
112     if accepts_stone (st) then
113     on_stone_dropped (st)
114     end
115     end
116    
117 manus 26913 execute is
118     -- Launch `Current' as a command.
119     -- Pop up a new empty dialog.
120     do
121     pop_up_new_dialog
122     end
123    
124     refresh is
125     -- Update the state of all dialogs.
126     do
127     from
128     opened_dialogs.start
129     until
130     opened_dialogs.after
131     loop
132     opened_dialogs.item.refresh
133     opened_dialogs.forth
134     end
135     end
136    
137     end_debug is
138     -- A debug session ended. We free the resources.
139     do
140     from
141     until
142 manus 32276 opened_dialogs.is_empty
143 manus 26913 loop
144 manus 32276 opened_dialogs.start
145 manus 26913 opened_dialogs.item.destroy
146     end
147     end
148    
149     feature {EB_PRETTY_PRINT_DIALOG} -- Dialog
150    
151     remove_dialog (d: EB_PRETTY_PRINT_DIALOG) is
152     -- Remove `d' from the list of displayed dialogs.
153     require
154     is_now_destroyed: d.is_destroyed
155     do
156     opened_dialogs.start
157     opened_dialogs.prune_all (d)
158     ensure
159     is_no_longer_known: not opened_dialogs.has (d)
160     end
161    
162     feature {NONE} -- Implementation
163    
164     on_stone_dropped (st: OBJECT_STONE) is
165     -- An object was dropped on the button, display it.
166     do
167     pop_up_new_dialog
168     last_opened_dialog.set_stone (st)
169     end
170    
171     opened_dialogs: ARRAYED_LIST [EB_PRETTY_PRINT_DIALOG]
172     -- All pretty print dialogs that are appear on the screen (linked to `Current').
173    
174     pop_up_new_dialog is
175     -- Create and display a new pretty print dialog.
176     local
177     nd: EB_PRETTY_PRINT_DIALOG
178     do
179     create nd.make (Current)
180     opened_dialogs.extend (nd)
181     last_opened_dialog := nd
182     nd.raise
183     ensure
184     added_a_dialog: opened_dialogs.count = (old opened_dialogs.count) + 1
185     end
186    
187 manus 56535 last_opened_dialog: EB_PRETTY_PRINT_DIALOG;
188 manus 26913 -- The last dialog that `Current' opened.
189    
190 manus 56535 indexing
191     copyright: "Copyright (c) 1984-2006, Eiffel Software"
192 manus 58027 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
193 manus 56535 licensing_options: "http://www.eiffel.com/licensing"
194     copying: "[
195     This file is part of Eiffel Software's Eiffel Development Environment.
196    
197     Eiffel Software's Eiffel Development Environment is free
198     software; you can redistribute it and/or modify it under
199     the terms of the GNU General Public License as published
200     by the Free Software Foundation, version 2 of the License
201     (available at the URL listed under "license" above).
202    
203     Eiffel Software's Eiffel Development Environment is
204     distributed in the hope that it will be useful, but
205     WITHOUT ANY WARRANTY; without even the implied warranty
206     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
207     See the GNU General Public License for more details.
208    
209     You should have received a copy of the GNU General Public
210     License along with Eiffel Software's Eiffel Development
211     Environment; if not, write to the Free Software Foundation,
212     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
213     ]"
214     source: "[
215     Eiffel Software
216     356 Storke Road, Goleta, CA 93117 USA
217     Telephone 805-685-1006, Fax 805-685-6869
218     Website http://www.eiffel.com
219     Customer support http://support.eiffel.com
220     ]"
221    
222 manus 26913 end -- class EB_PRETTY_PRINT_CMD

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23