source: sasview/sansguiframe/docs/sphinx/html/api/plugin_base.html @ 1c86a37

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 1c86a37 was 96cbb53, checked in by Jessica Tumarkin <jtumarki@…>, 13 years ago

HTML folder generated by Sphinx

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