/[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 56535 - (hide annotations)
Tue Jan 17 01:37:10 2006 UTC (14 years ago) by manus
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_pretty_print_cmd.e
File size: 5063 byte(s)
Added text of the GPL license to all classes of the compiler.

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     mini_pixmap: ARRAY [EV_PIXMAP] is
38     -- 8*8 pixmaps representing `Current'.
39     do
40 paulb 52910 Result := pixmaps.small_pixmaps.icon_expand_string
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     pixmap: ARRAY [EV_PIXMAP] is
62     -- No big pixmap is necessary.
63     do
64 jfiat 56447
65 manus 26913 end
66    
67     menu_name: STRING is
68     -- Menu name for `Current'.
69     do
70     Result := Interface_names.m_Pretty_print
71     end
72    
73     new_mini_toolbar_item: EB_COMMAND_TOOL_BAR_BUTTON is
74     -- Create a new mini toolbar button for this command.
75     do
76     Result := Precursor
77 julieng 37681 Result.drop_actions.extend (agent on_stone_dropped)
78     Result.drop_actions.set_veto_pebble_function (agent accepts_stone)
79 manus 26913 end
80    
81     feature -- Status report
82    
83     associated_window: EV_WINDOW is
84     -- Window to which the child dialogs will be modeless to.
85     do
86 jfiat 56447 Result := Eb_debugger_manager.debugging_window.window
87 manus 26913 end
88    
89 manus 32944 feature {EB_PRETTY_PRINT_DIALOG} -- Status report
90 manus 26913
91 manus 32944 accepts_stone (st: OBJECT_STONE): BOOLEAN is
92     -- Can the user drop `st'?
93 jfiat 51524 local
94     dv: DUMP_VALUE
95 manus 32944 do
96 jfiat 52056 if st /= Void then
97     create dv.make_object (st.object_address, st.dynamic_class)
98     Result := dv.has_formatted_output
99     end
100 manus 32944 end
101 manus 26913
102     feature -- Basic operations
103    
104 jfiat 52056 set_stone (st: OBJECT_STONE) is
105     do
106     if accepts_stone (st) then
107     on_stone_dropped (st)
108     end
109     end
110    
111 manus 26913 execute is
112     -- Launch `Current' as a command.
113     -- Pop up a new empty dialog.
114     do
115     pop_up_new_dialog
116     end
117    
118     refresh is
119     -- Update the state of all dialogs.
120     do
121     from
122     opened_dialogs.start
123     until
124     opened_dialogs.after
125     loop
126     opened_dialogs.item.refresh
127     opened_dialogs.forth
128     end
129     end
130    
131     end_debug is
132     -- A debug session ended. We free the resources.
133     do
134     from
135     until
136 manus 32276 opened_dialogs.is_empty
137 manus 26913 loop
138 manus 32276 opened_dialogs.start
139 manus 26913 opened_dialogs.item.destroy
140     end
141     end
142    
143     feature {EB_PRETTY_PRINT_DIALOG} -- Dialog
144    
145     remove_dialog (d: EB_PRETTY_PRINT_DIALOG) is
146     -- Remove `d' from the list of displayed dialogs.
147     require
148     is_now_destroyed: d.is_destroyed
149     do
150     opened_dialogs.start
151     opened_dialogs.prune_all (d)
152     ensure
153     is_no_longer_known: not opened_dialogs.has (d)
154     end
155    
156     feature {NONE} -- Implementation
157    
158     on_stone_dropped (st: OBJECT_STONE) is
159     -- An object was dropped on the button, display it.
160     do
161     pop_up_new_dialog
162     last_opened_dialog.set_stone (st)
163     end
164    
165     opened_dialogs: ARRAYED_LIST [EB_PRETTY_PRINT_DIALOG]
166     -- All pretty print dialogs that are appear on the screen (linked to `Current').
167    
168     pop_up_new_dialog is
169     -- Create and display a new pretty print dialog.
170     local
171     nd: EB_PRETTY_PRINT_DIALOG
172     do
173     create nd.make (Current)
174     opened_dialogs.extend (nd)
175     last_opened_dialog := nd
176     nd.raise
177     ensure
178     added_a_dialog: opened_dialogs.count = (old opened_dialogs.count) + 1
179     end
180    
181 manus 56535 last_opened_dialog: EB_PRETTY_PRINT_DIALOG;
182 manus 26913 -- The last dialog that `Current' opened.
183    
184 manus 56535 indexing
185     copyright: "Copyright (c) 1984-2006, Eiffel Software"
186     license: "GPL version 2 see http://www.eiffel.com/licensing/gpl.txt)"
187     licensing_options: "http://www.eiffel.com/licensing"
188     copying: "[
189     This file is part of Eiffel Software's Eiffel Development Environment.
190    
191     Eiffel Software's Eiffel Development Environment is free
192     software; you can redistribute it and/or modify it under
193     the terms of the GNU General Public License as published
194     by the Free Software Foundation, version 2 of the License
195     (available at the URL listed under "license" above).
196    
197     Eiffel Software's Eiffel Development Environment is
198     distributed in the hope that it will be useful, but
199     WITHOUT ANY WARRANTY; without even the implied warranty
200     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
201     See the GNU General Public License for more details.
202    
203     You should have received a copy of the GNU General Public
204     License along with Eiffel Software's Eiffel Development
205     Environment; if not, write to the Free Software Foundation,
206     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
207     ]"
208     source: "[
209     Eiffel Software
210     356 Storke Road, Goleta, CA 93117 USA
211     Telephone 805-685-1006, Fax 805-685-6869
212     Website http://www.eiffel.com
213     Customer support http://support.eiffel.com
214     ]"
215    
216 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