source: sasview/sansguiframe/docs/sphinx/html/api/plugin_base.html @ 67cd7c0

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 67cd7c0 was bce8148, checked in by Gervaise Alina <gervyh@…>, 13 years ago

sphinx build

  • Property mode set to 100644
File size: 18.6 KB
Line 
1
2
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6
7<html xmlns="http://www.w3.org/1999/xhtml">
8  <head>
9    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10   
11    <title>plugin_base &mdash; guiframe 0.1.0 documentation</title>
12   
13    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
14    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
15   
16    <script type="text/javascript">
17      var DOCUMENTATION_OPTIONS = {
18        URL_ROOT:    '../',
19        VERSION:     '0.1.0',
20        COLLAPSE_INDEX: false,
21        FILE_SUFFIX: '.html',
22        HAS_SOURCE:  true
23      };
24    </script>
25    <script type="text/javascript" src="../_static/jquery.js"></script>
26    <script type="text/javascript" src="../_static/underscore.js"></script>
27    <script type="text/javascript" src="../_static/doctools.js"></script>
28    <link rel="top" title="guiframe 0.1.0 documentation" href="../index.html" />
29    <link rel="up" title="Reference" href="index.html" />
30    <link rel="next" title="startup_configuration" href="startup_configuration.html" />
31    <link rel="prev" title="pdfview" href="pdfview.html" /> 
32  </head>
33  <body>
34    <div class="related">
35      <h3>Navigation</h3>
36      <ul>
37        <li class="right" style="margin-right: 10px">
38          <a href="../genindex.html" title="General Index"
39             accesskey="I">index</a></li>
40        <li class="right" >
41          <a href="../py-modindex.html" title="Python Module Index"
42             >modules</a> |</li>
43        <li class="right" >
44          <a href="startup_configuration.html" title="startup_configuration"
45             accesskey="N">next</a> |</li>
46        <li class="right" >
47          <a href="pdfview.html" title="pdfview"
48             accesskey="P">previous</a> |</li>
49        <li><a href="../index.html">guiframe 0.1.0 documentation</a> &raquo;</li>
50          <li><a href="index.html" accesskey="U">Reference</a> &raquo;</li> 
51      </ul>
52    </div> 
53
54    <div class="document">
55      <div class="documentwrapper">
56        <div class="bodywrapper">
57          <div class="body">
58           
59  <div class="section" id="plugin-base">
60<h1>plugin_base<a class="headerlink" href="#plugin-base" title="Permalink to this headline">¶</a></h1>
61<div class="section" id="sans-guiframe-plugin-base">
62<h2><a class="reference internal" href="#module-sans.guiframe.plugin_base" title="sans.guiframe.plugin_base"><tt class="xref py py-mod docutils literal"><span class="pre">sans.guiframe.plugin_base</span></tt></a><a class="headerlink" href="#sans-guiframe-plugin-base" title="Permalink to this headline">¶</a></h2>
63<span class="target" id="module-sans.guiframe.plugin_base"></span><dl class="class">
64<dt id="sans.guiframe.plugin_base.PluginBase">
65<em class="property">class </em><tt class="descclassname">sans.guiframe.plugin_base.</tt><tt class="descname">PluginBase</tt><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase" title="Permalink to this definition">¶</a></dt>
66<dd><p>This class defines the interface for a Plugin class
67that can be used by the gui_manager.</p>
68<p>Plug-ins should be placed in a sub-directory called &#8220;perspectives&#8221;.
69For example, a plug-in called Foo should be place in &#8220;perspectives/Foo&#8221;.
70That directory contains at least two files:</p>
71<blockquote>
72<div><p>perspectives/Foo/__init__.py contains two lines:</p>
73<blockquote>
74<div>PLUGIN_ID = &#8220;Foo plug-in 1.0&#8221;
75from Foo import *</div></blockquote>
76<p>perspectives/Foo/Foo.py contains the definition of the Plugin
77class for the Foo plug-in. The interface of that Plugin class
78should follow the interface of the class you are looking at.</p>
79</div></blockquote>
80<p>See dummyapp.py for a plugin example.</p>
81<dl class="method">
82<dt id="sans.guiframe.plugin_base.PluginBase.__init__">
83<tt class="descname">__init__</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.__init__" title="Permalink to this definition">¶</a></dt>
84<dd><p>Abstract class for gui_manager Plugins.</p>
85</dd></dl>
86
87<dl class="attribute">
88<dt id="sans.guiframe.plugin_base.PluginBase.__module__">
89<tt class="descname">__module__</tt><em class="property"> = 'sans.guiframe.plugin_base'</em><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.__module__" title="Permalink to this definition">¶</a></dt>
90<dd></dd></dl>
91
92<dl class="method">
93<dt id="sans.guiframe.plugin_base.PluginBase.add_color">
94<tt class="descname">add_color</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.add_color" title="Permalink to this definition">¶</a></dt>
95<dd><p>Adds color to a plugin</p>
96</dd></dl>
97
98<dl class="method">
99<dt id="sans.guiframe.plugin_base.PluginBase.can_load_data">
100<tt class="descname">can_load_data</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.can_load_data" title="Permalink to this definition">¶</a></dt>
101<dd><p>if return True, then call handler to laod data</p>
102</dd></dl>
103
104<dl class="method">
105<dt id="sans.guiframe.plugin_base.PluginBase.clear_panel">
106<tt class="descname">clear_panel</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.clear_panel" title="Permalink to this definition">¶</a></dt>
107<dd><p>clear all related panels</p>
108</dd></dl>
109
110<dl class="method">
111<dt id="sans.guiframe.plugin_base.PluginBase.delete_data">
112<tt class="descname">delete_data</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.delete_data" title="Permalink to this definition">¶</a></dt>
113<dd><p>Delete all references of data which id are in data_list.</p>
114</dd></dl>
115
116<dl class="method">
117<dt id="sans.guiframe.plugin_base.PluginBase.get_batch_capable">
118<tt class="descname">get_batch_capable</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.get_batch_capable" title="Permalink to this definition">¶</a></dt>
119<dd><p>Check if the plugin has a batch capability</p>
120</dd></dl>
121
122<dl class="method">
123<dt id="sans.guiframe.plugin_base.PluginBase.get_context_menu">
124<tt class="descname">get_context_menu</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.get_context_menu" title="Permalink to this definition">¶</a></dt>
125<dd><p>This method is optional.</p>
126<p>When the context menu of a plot is rendered, the
127get_context_menu method will be called to give you a
128chance to add a menu item to the context menu.</p>
129<p>A ref to a plotpanel object is passed so that you can
130investigate the plot content and decide whether you
131need to add items to the context menu.</p>
132<p>This method returns a list of menu items.
133Each item is itself a list defining the text to
134appear in the menu, a tool-tip help text, and a
135call-back method.</p>
136<table class="docutils field-list" frame="void" rules="none">
137<col class="field-name" />
138<col class="field-body" />
139<tbody valign="top">
140<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>graph</strong> &#8211; the Graph object to which we attach the context menu</td>
141</tr>
142<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a list of menu items with call-back function</td>
143</tr>
144</tbody>
145</table>
146</dd></dl>
147
148<dl class="method">
149<dt id="sans.guiframe.plugin_base.PluginBase.get_extensions">
150<tt class="descname">get_extensions</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.get_extensions" title="Permalink to this definition">¶</a></dt>
151<dd><p>return state reader and its extensions</p>
152</dd></dl>
153
154<dl class="method">
155<dt id="sans.guiframe.plugin_base.PluginBase.get_panels">
156<tt class="descname">get_panels</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.get_panels" title="Permalink to this definition">¶</a></dt>
157<dd><p>Create and return the list of wx.Panels for your plug-in.
158Define the plug-in perspective.</p>
159<p>Panels should inherit from DefaultPanel defined below,
160or should present the same interface. They must define
161&#8220;window_caption&#8221; and &#8220;window_name&#8221;.</p>
162<table class="docutils field-list" frame="void" rules="none">
163<col class="field-name" />
164<col class="field-body" />
165<tbody valign="top">
166<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>parent</strong> &#8211; parent window</td>
167</tr>
168<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of panels</td>
169</tr>
170</tbody>
171</table>
172</dd></dl>
173
174<dl class="method">
175<dt id="sans.guiframe.plugin_base.PluginBase.get_perspective">
176<tt class="descname">get_perspective</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.get_perspective" title="Permalink to this definition">¶</a></dt>
177<dd><p>Get the list of panel names for this perspective</p>
178</dd></dl>
179
180<dl class="method">
181<dt id="sans.guiframe.plugin_base.PluginBase.get_tools">
182<tt class="descname">get_tools</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.get_tools" title="Permalink to this definition">¶</a></dt>
183<dd><p>Returns a set of menu entries for tools</p>
184</dd></dl>
185
186<dl class="method">
187<dt id="sans.guiframe.plugin_base.PluginBase.is_always_active">
188<tt class="descname">is_always_active</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.is_always_active" title="Permalink to this definition">¶</a></dt>
189<dd><p>return True is this plugin is always active and it is local to guiframe
190even if the user is switching between perspectives</p>
191</dd></dl>
192
193<dl class="method">
194<dt id="sans.guiframe.plugin_base.PluginBase.is_in_use">
195<tt class="descname">is_in_use</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.is_in_use" title="Permalink to this definition">¶</a></dt>
196<dd><dl class="docutils">
197<dt>get a  data id a list of data name if data data is</dt>
198<dd>currently used by the plugin and the name of the plugin</dd>
199</dl>
200<p>data_name = &#8216;None&#8217;
201in_use = False
202example [(data_name, self.sub_menu)]</p>
203</dd></dl>
204
205<dl class="method">
206<dt id="sans.guiframe.plugin_base.PluginBase.load_data">
207<tt class="descname">load_data</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.load_data" title="Permalink to this definition">¶</a></dt>
208<dd><p>Load  data</p>
209</dd></dl>
210
211<dl class="method">
212<dt id="sans.guiframe.plugin_base.PluginBase.load_folder">
213<tt class="descname">load_folder</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.load_folder" title="Permalink to this definition">¶</a></dt>
214<dd><p>Load entire folder</p>
215</dd></dl>
216
217<dl class="method">
218<dt id="sans.guiframe.plugin_base.PluginBase.on_batch_selection">
219<tt class="descname">on_batch_selection</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.on_batch_selection" title="Permalink to this definition">¶</a></dt>
220<dd><p>need to be overwritten by the derivated class</p>
221</dd></dl>
222
223<dl class="method">
224<dt id="sans.guiframe.plugin_base.PluginBase.on_perspective">
225<tt class="descname">on_perspective</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.on_perspective" title="Permalink to this definition">¶</a></dt>
226<dd><p>Call back function for the perspective menu item.
227We notify the parent window that the perspective
228has changed.</p>
229<table class="docutils field-list" frame="void" rules="none">
230<col class="field-name" />
231<col class="field-body" />
232<tbody valign="top">
233<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>event</strong> &#8211; menu event</td>
234</tr>
235</tbody>
236</table>
237</dd></dl>
238
239<dl class="method">
240<dt id="sans.guiframe.plugin_base.PluginBase.on_set_state_helper">
241<tt class="descname">on_set_state_helper</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.on_set_state_helper" title="Permalink to this definition">¶</a></dt>
242<dd><p>update state</p>
243</dd></dl>
244
245<dl class="method">
246<dt id="sans.guiframe.plugin_base.PluginBase.populate_file_menu">
247<tt class="descname">populate_file_menu</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.populate_file_menu" title="Permalink to this definition">¶</a></dt>
248<dd><p>Append menu item under file menu item of the frame</p>
249</dd></dl>
250
251<dl class="method">
252<dt id="sans.guiframe.plugin_base.PluginBase.populate_menu">
253<tt class="descname">populate_menu</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.populate_menu" title="Permalink to this definition">¶</a></dt>
254<dd><p>Create and return the list of application menu
255items for the plug-in.</p>
256<table class="docutils field-list" frame="void" rules="none">
257<col class="field-name" />
258<col class="field-body" />
259<tbody valign="top">
260<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>parent</strong> &#8211; parent window</td>
261</tr>
262<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">plug-in menu</td>
263</tr>
264</tbody>
265</table>
266</dd></dl>
267
268<dl class="method">
269<dt id="sans.guiframe.plugin_base.PluginBase.post_init">
270<tt class="descname">post_init</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.post_init" title="Permalink to this definition">¶</a></dt>
271<dd><p>Post initialization call back to close the loose ends</p>
272</dd></dl>
273
274<dl class="method">
275<dt id="sans.guiframe.plugin_base.PluginBase.set_batch_selection">
276<tt class="descname">set_batch_selection</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.set_batch_selection" title="Permalink to this definition">¶</a></dt>
277<dd><p>the plugin to its batch state if flag is True</p>
278</dd></dl>
279
280<dl class="method">
281<dt id="sans.guiframe.plugin_base.PluginBase.set_data">
282<tt class="descname">set_data</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.set_data" title="Permalink to this definition">¶</a></dt>
283<dd><p>receive a list of data and use it in the current perspective</p>
284</dd></dl>
285
286<dl class="method">
287<dt id="sans.guiframe.plugin_base.PluginBase.set_default_perspective">
288<tt class="descname">set_default_perspective</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.set_default_perspective" title="Permalink to this definition">¶</a></dt>
289<dd><p>Call back method that True to notify the parent that the current plug-in
290can be set as default  perspective.
291when returning False, the plug-in is not candidate for an automatic
292default perspective setting</p>
293</dd></dl>
294
295<dl class="method">
296<dt id="sans.guiframe.plugin_base.PluginBase.set_is_active">
297<tt class="descname">set_is_active</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.set_is_active" title="Permalink to this definition">¶</a></dt>
298<dd></dd></dl>
299
300<dl class="method">
301<dt id="sans.guiframe.plugin_base.PluginBase.set_state">
302<tt class="descname">set_state</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.set_state" title="Permalink to this definition">¶</a></dt>
303<dd><p>update state</p>
304</dd></dl>
305
306<dl class="method">
307<dt id="sans.guiframe.plugin_base.PluginBase.set_theory">
308<tt class="descname">set_theory</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.set_theory" title="Permalink to this definition">¶</a></dt>
309<dd><table class="docutils field-list" frame="void" rules="none">
310<col class="field-name" />
311<col class="field-body" />
312<tbody valign="top">
313<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>theory_list</strong> &#8211; list of information</td>
314</tr>
315</tbody>
316</table>
317<p>related to available theory state</p>
318</dd></dl>
319
320<dl class="method">
321<dt id="sans.guiframe.plugin_base.PluginBase.use_data">
322<tt class="descname">use_data</tt><big>(</big><big>)</big><a class="headerlink" href="#sans.guiframe.plugin_base.PluginBase.use_data" title="Permalink to this definition">¶</a></dt>
323<dd><p>return True if these plugin use data</p>
324</dd></dl>
325
326</dd></dl>
327
328</div>
329</div>
330
331
332          </div>
333        </div>
334      </div>
335      <div class="sphinxsidebar">
336        <div class="sphinxsidebarwrapper">
337  <h3><a href="../index.html">Table Of Contents</a></h3>
338  <ul>
339<li><a class="reference internal" href="#">plugin_base</a><ul>
340<li><a class="reference internal" href="#sans-guiframe-plugin-base"><tt class="docutils literal"><span class="pre">sans.guiframe.plugin_base</span></tt></a></li>
341</ul>
342</li>
343</ul>
344
345  <h4>Previous topic</h4>
346  <p class="topless"><a href="pdfview.html"
347                        title="previous chapter">pdfview</a></p>
348  <h4>Next topic</h4>
349  <p class="topless"><a href="startup_configuration.html"
350                        title="next chapter">startup_configuration</a></p>
351  <h3>This Page</h3>
352  <ul class="this-page-menu">
353    <li><a href="../_sources/api/plugin_base.txt"
354           rel="nofollow">Show Source</a></li>
355  </ul>
356<div id="searchbox" style="display: none">
357  <h3>Quick search</h3>
358    <form class="search" action="../search.html" method="get">
359      <input type="text" name="q" />
360      <input type="submit" value="Go" />
361      <input type="hidden" name="check_keywords" value="yes" />
362      <input type="hidden" name="area" value="default" />
363    </form>
364    <p class="searchtip" style="font-size: 90%">
365    Enter search terms or a module, class or function name.
366    </p>
367</div>
368<script type="text/javascript">$('#searchbox').show(0);</script>
369        </div>
370      </div>
371      <div class="clearer"></div>
372    </div>
373    <div class="related">
374      <h3>Navigation</h3>
375      <ul>
376        <li class="right" style="margin-right: 10px">
377          <a href="../genindex.html" title="General Index"
378             >index</a></li>
379        <li class="right" >
380          <a href="../py-modindex.html" title="Python Module Index"
381             >modules</a> |</li>
382        <li class="right" >
383          <a href="startup_configuration.html" title="startup_configuration"
384             >next</a> |</li>
385        <li class="right" >
386          <a href="pdfview.html" title="pdfview"
387             >previous</a> |</li>
388        <li><a href="../index.html">guiframe 0.1.0 documentation</a> &raquo;</li>
389          <li><a href="index.html" >Reference</a> &raquo;</li> 
390      </ul>
391    </div>
392    <div class="footer">
393        &copy; Copyright 2010, sans group.
394      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.
395    </div>
396  </body>
397</html>
Note: See TracBrowser for help on using the repository browser.