--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/eric7/Documentation/Source/eric7.Templates.TemplateViewer.html Thu Jul 07 11:23:56 2022 +0200 @@ -0,0 +1,1204 @@ +<!DOCTYPE html> +<html><head> +<title>eric7.Templates.TemplateViewer</title> +<meta charset="UTF-8"> +<link rel="stylesheet" href="styles.css"> +</head> +<body> +<a NAME="top" ID="top"></a> +<h1>eric7.Templates.TemplateViewer</h1> + +<p> +Module implementing a template viewer and associated classes. +</p> +<h3>Global Attributes</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> + +<table> + +<tr> +<td><a href="#TemplateEntry">TemplateEntry</a></td> +<td>Class immplementing a template entry.</td> +</tr> +<tr> +<td><a href="#TemplateGroup">TemplateGroup</a></td> +<td>Class implementing a template group.</td> +</tr> +<tr> +<td><a href="#TemplateViewer">TemplateViewer</a></td> +<td>Class implementing the template viewer.</td> +</tr> +</table> +<h3>Functions</h3> + +<table> +<tr><td>None</td></tr> +</table> +<hr /> +<hr /> +<a NAME="TemplateEntry" ID="TemplateEntry"></a> +<h2>TemplateEntry</h2> + +<p> + Class immplementing a template entry. +</p> +<h3>Derived from</h3> +QTreeWidgetItem +<h3>Class Attributes</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> + +<tr> +<td><a href="#TemplateEntry.__init__">TemplateEntry</a></td> +<td>Constructor</td> +</tr> +<tr> +<td><a href="#TemplateEntry.__displayText">__displayText</a></td> +<td>Private method to generate the display text.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.__expandFormattedVariable">__expandFormattedVariable</a></td> +<td>Private method to expand a template variable with special formatting.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.__extractVariables">__extractVariables</a></td> +<td>Private method to retrieve the list of variables.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.getDescription">getDescription</a></td> +<td>Public method to get the description of the entry.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.getExpandedText">getExpandedText</a></td> +<td>Public method to get the template text with all variables expanded.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.getGroupName">getGroupName</a></td> +<td>Public method to get the name of the group this entry belongs to.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.getName">getName</a></td> +<td>Public method to get the name of the entry.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.getTemplateText">getTemplateText</a></td> +<td>Public method to get the template text.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.getVariables">getVariables</a></td> +<td>Public method to get the list of variables.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.setDescription">setDescription</a></td> +<td>Public method to update the description of the entry.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.setName">setName</a></td> +<td>Public method to update the name of the entry.</td> +</tr> +<tr> +<td><a href="#TemplateEntry.setTemplateText">setTemplateText</a></td> +<td>Public method to update the template text.</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="TemplateEntry.__init__" ID="TemplateEntry.__init__"></a> +<h4>TemplateEntry (Constructor)</h4> +<b>TemplateEntry</b>(<i>parent, name, description, templateText</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>parent</i></dt> +<dd> +parent widget of the template entry (QWidget) +</dd> +<dt><i>name</i></dt> +<dd> +name of the entry (string) +</dd> +<dt><i>description</i></dt> +<dd> +descriptive text for the template (string) +</dd> +<dt><i>templateText</i></dt> +<dd> +text of the template entry (string) +</dd> +</dl> +<a NAME="TemplateEntry.__displayText" ID="TemplateEntry.__displayText"></a> +<h4>TemplateEntry.__displayText</h4> +<b>__displayText</b>(<i></i>) + +<p> + Private method to generate the display text. +</p> +<dl> +<dt>Return:</dt> +<dd> +display text (string) +</dd> +</dl> +<a NAME="TemplateEntry.__expandFormattedVariable" ID="TemplateEntry.__expandFormattedVariable"></a> +<h4>TemplateEntry.__expandFormattedVariable</h4> +<b>__expandFormattedVariable</b>(<i>var, val, txt</i>) + +<p> + Private method to expand a template variable with special formatting. +</p> +<dl> + +<dt><i>var</i></dt> +<dd> +template variable name (string) +</dd> +<dt><i>val</i></dt> +<dd> +value of the template variable (string) +</dd> +<dt><i>txt</i></dt> +<dd> +template text (string) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +expanded and formatted variable (string) +</dd> +</dl> +<a NAME="TemplateEntry.__extractVariables" ID="TemplateEntry.__extractVariables"></a> +<h4>TemplateEntry.__extractVariables</h4> +<b>__extractVariables</b>(<i></i>) + +<p> + Private method to retrieve the list of variables. +</p> +<a NAME="TemplateEntry.getDescription" ID="TemplateEntry.getDescription"></a> +<h4>TemplateEntry.getDescription</h4> +<b>getDescription</b>(<i></i>) + +<p> + Public method to get the description of the entry. +</p> +<dl> +<dt>Return:</dt> +<dd> +description of the entry (string) +</dd> +</dl> +<a NAME="TemplateEntry.getExpandedText" ID="TemplateEntry.getExpandedText"></a> +<h4>TemplateEntry.getExpandedText</h4> +<b>getExpandedText</b>(<i>varDict, indent</i>) + +<p> + Public method to get the template text with all variables expanded. +</p> +<dl> + +<dt><i>varDict</i></dt> +<dd> +dictionary containing the texts of each variable + with the variable name as key. +</dd> +<dt><i>indent</i></dt> +<dd> +indentation of the line receiving he expanded + template text (string) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +a tuple of the expanded template text (string), the + number of lines (integer) and the length of the last line (integer) +</dd> +</dl> +<a NAME="TemplateEntry.getGroupName" ID="TemplateEntry.getGroupName"></a> +<h4>TemplateEntry.getGroupName</h4> +<b>getGroupName</b>(<i></i>) + +<p> + Public method to get the name of the group this entry belongs to. +</p> +<dl> +<dt>Return:</dt> +<dd> +name of the group containing this entry (string) +</dd> +</dl> +<a NAME="TemplateEntry.getName" ID="TemplateEntry.getName"></a> +<h4>TemplateEntry.getName</h4> +<b>getName</b>(<i></i>) + +<p> + Public method to get the name of the entry. +</p> +<dl> +<dt>Return:</dt> +<dd> +name of the entry (string) +</dd> +</dl> +<a NAME="TemplateEntry.getTemplateText" ID="TemplateEntry.getTemplateText"></a> +<h4>TemplateEntry.getTemplateText</h4> +<b>getTemplateText</b>(<i></i>) + +<p> + Public method to get the template text. +</p> +<dl> +<dt>Return:</dt> +<dd> +the template text (string) +</dd> +</dl> +<a NAME="TemplateEntry.getVariables" ID="TemplateEntry.getVariables"></a> +<h4>TemplateEntry.getVariables</h4> +<b>getVariables</b>(<i></i>) + +<p> + Public method to get the list of variables. +</p> +<dl> +<dt>Return:</dt> +<dd> +list of variables (list of strings) +</dd> +</dl> +<a NAME="TemplateEntry.setDescription" ID="TemplateEntry.setDescription"></a> +<h4>TemplateEntry.setDescription</h4> +<b>setDescription</b>(<i>description</i>) + +<p> + Public method to update the description of the entry. +</p> +<dl> + +<dt><i>description</i></dt> +<dd> +description of the entry (string) +</dd> +</dl> +<a NAME="TemplateEntry.setName" ID="TemplateEntry.setName"></a> +<h4>TemplateEntry.setName</h4> +<b>setName</b>(<i>name</i>) + +<p> + Public method to update the name of the entry. +</p> +<dl> + +<dt><i>name</i></dt> +<dd> +name of the entry (string) +</dd> +</dl> +<a NAME="TemplateEntry.setTemplateText" ID="TemplateEntry.setTemplateText"></a> +<h4>TemplateEntry.setTemplateText</h4> +<b>setTemplateText</b>(<i>templateText</i>) + +<p> + Public method to update the template text. +</p> +<dl> + +<dt><i>templateText</i></dt> +<dd> +text of the template entry (string) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="TemplateGroup" ID="TemplateGroup"></a> +<h2>TemplateGroup</h2> + +<p> + Class implementing a template group. +</p> +<h3>Derived from</h3> +QTreeWidgetItem +<h3>Class Attributes</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> + +<tr> +<td><a href="#TemplateGroup.__init__">TemplateGroup</a></td> +<td>Constructor</td> +</tr> +<tr> +<td><a href="#TemplateGroup.addEntry">addEntry</a></td> +<td>Public method to add a template entry to this group.</td> +</tr> +<tr> +<td><a href="#TemplateGroup.getAllEntries">getAllEntries</a></td> +<td>Public method to retrieve all entries.</td> +</tr> +<tr> +<td><a href="#TemplateGroup.getEntry">getEntry</a></td> +<td>Public method to get an entry.</td> +</tr> +<tr> +<td><a href="#TemplateGroup.getEntryNames">getEntryNames</a></td> +<td>Public method to get the names of all entries, who's name starts with the given string.</td> +</tr> +<tr> +<td><a href="#TemplateGroup.getLanguage">getLanguage</a></td> +<td>Public method to get the name of the group.</td> +</tr> +<tr> +<td><a href="#TemplateGroup.getName">getName</a></td> +<td>Public method to get the name of the group.</td> +</tr> +<tr> +<td><a href="#TemplateGroup.hasEntry">hasEntry</a></td> +<td>Public method to check, if the group has an entry with the given name.</td> +</tr> +<tr> +<td><a href="#TemplateGroup.removeAllEntries">removeAllEntries</a></td> +<td>Public method to remove all template entries of this group.</td> +</tr> +<tr> +<td><a href="#TemplateGroup.removeEntry">removeEntry</a></td> +<td>Public method to remove a template entry from this group.</td> +</tr> +<tr> +<td><a href="#TemplateGroup.setLanguage">setLanguage</a></td> +<td>Public method to update the name of the group.</td> +</tr> +<tr> +<td><a href="#TemplateGroup.setName">setName</a></td> +<td>Public method to update the name of the group.</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="TemplateGroup.__init__" ID="TemplateGroup.__init__"></a> +<h4>TemplateGroup (Constructor)</h4> +<b>TemplateGroup</b>(<i>parent, name, language="All"</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>parent</i></dt> +<dd> +parent widget of the template group (QWidget) +</dd> +<dt><i>name</i></dt> +<dd> +name of the group (string) +</dd> +<dt><i>language</i></dt> +<dd> +programming language for the group (string) +</dd> +</dl> +<a NAME="TemplateGroup.addEntry" ID="TemplateGroup.addEntry"></a> +<h4>TemplateGroup.addEntry</h4> +<b>addEntry</b>(<i>name, description, template, quiet=False</i>) + +<p> + Public method to add a template entry to this group. +</p> +<dl> + +<dt><i>name</i></dt> +<dd> +name of the entry (string) +</dd> +<dt><i>description</i></dt> +<dd> +description of the entry to add (string) +</dd> +<dt><i>template</i></dt> +<dd> +template text of the entry (string) +</dd> +<dt><i>quiet</i></dt> +<dd> +flag indicating quiet operation (boolean) +</dd> +</dl> +<a NAME="TemplateGroup.getAllEntries" ID="TemplateGroup.getAllEntries"></a> +<h4>TemplateGroup.getAllEntries</h4> +<b>getAllEntries</b>(<i></i>) + +<p> + Public method to retrieve all entries. +</p> +<dl> +<dt>Return:</dt> +<dd> +list of all entries (list of TemplateEntry) +</dd> +</dl> +<a NAME="TemplateGroup.getEntry" ID="TemplateGroup.getEntry"></a> +<h4>TemplateGroup.getEntry</h4> +<b>getEntry</b>(<i>name</i>) + +<p> + Public method to get an entry. +</p> +<dl> + +<dt><i>name</i></dt> +<dd> +name of the entry to retrieve (string) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +reference to the entry (TemplateEntry) +</dd> +</dl> +<a NAME="TemplateGroup.getEntryNames" ID="TemplateGroup.getEntryNames"></a> +<h4>TemplateGroup.getEntryNames</h4> +<b>getEntryNames</b>(<i>beginning</i>) + +<p> + Public method to get the names of all entries, who's name starts with + the given string. +</p> +<dl> + +<dt><i>beginning</i></dt> +<dd> +string denoting the beginning of the template name + (string) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +list of entry names found (list of strings) +</dd> +</dl> +<a NAME="TemplateGroup.getLanguage" ID="TemplateGroup.getLanguage"></a> +<h4>TemplateGroup.getLanguage</h4> +<b>getLanguage</b>(<i></i>) + +<p> + Public method to get the name of the group. +</p> +<dl> +<dt>Return:</dt> +<dd> +language of the group (string) +</dd> +</dl> +<a NAME="TemplateGroup.getName" ID="TemplateGroup.getName"></a> +<h4>TemplateGroup.getName</h4> +<b>getName</b>(<i></i>) + +<p> + Public method to get the name of the group. +</p> +<dl> +<dt>Return:</dt> +<dd> +name of the group (string) +</dd> +</dl> +<a NAME="TemplateGroup.hasEntry" ID="TemplateGroup.hasEntry"></a> +<h4>TemplateGroup.hasEntry</h4> +<b>hasEntry</b>(<i>name</i>) + +<p> + Public method to check, if the group has an entry with the given name. +</p> +<dl> + +<dt><i>name</i></dt> +<dd> +name of the entry to check for (string) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating existence (boolean) +</dd> +</dl> +<a NAME="TemplateGroup.removeAllEntries" ID="TemplateGroup.removeAllEntries"></a> +<h4>TemplateGroup.removeAllEntries</h4> +<b>removeAllEntries</b>(<i></i>) + +<p> + Public method to remove all template entries of this group. +</p> +<a NAME="TemplateGroup.removeEntry" ID="TemplateGroup.removeEntry"></a> +<h4>TemplateGroup.removeEntry</h4> +<b>removeEntry</b>(<i>name</i>) + +<p> + Public method to remove a template entry from this group. +</p> +<dl> + +<dt><i>name</i></dt> +<dd> +name of the entry to be removed (string) +</dd> +</dl> +<a NAME="TemplateGroup.setLanguage" ID="TemplateGroup.setLanguage"></a> +<h4>TemplateGroup.setLanguage</h4> +<b>setLanguage</b>(<i>language</i>) + +<p> + Public method to update the name of the group. +</p> +<dl> + +<dt><i>language</i></dt> +<dd> +programming language for the group (string) +</dd> +</dl> +<a NAME="TemplateGroup.setName" ID="TemplateGroup.setName"></a> +<h4>TemplateGroup.setName</h4> +<b>setName</b>(<i>name</i>) + +<p> + Public method to update the name of the group. +</p> +<dl> + +<dt><i>name</i></dt> +<dd> +name of the group (string) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="TemplateViewer" ID="TemplateViewer"></a> +<h2>TemplateViewer</h2> + +<p> + Class implementing the template viewer. +</p> +<h3>Derived from</h3> +QTreeWidget +<h3>Class Attributes</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> + +<table> + +<tr> +<td><a href="#TemplateViewer.__init__">TemplateViewer</a></td> +<td>Constructor</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__addEntry">__addEntry</a></td> +<td>Private slot to handle the Add Entry context menu action.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__addGroup">__addGroup</a></td> +<td>Private slot to handle the Add Group context menu action.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__configure">__configure</a></td> +<td>Private method to open the configuration dialog.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__edit">__edit</a></td> +<td>Private slot to handle the Edit context menu action.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__export">__export</a></td> +<td>Private slot to handle the Export context menu action.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__getPredefinedVars">__getPredefinedVars</a></td> +<td>Private method to return predefined variables.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__import">__import</a></td> +<td>Private slot to handle the Import context menu action.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__reload">__reload</a></td> +<td>Private slot to reload the templates.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__remove">__remove</a></td> +<td>Private slot to handle the Remove context menu action.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__resort">__resort</a></td> +<td>Private method to resort the tree.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__showContextMenu">__showContextMenu</a></td> +<td>Private slot to show the context menu of the list.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__showHelp">__showHelp</a></td> +<td>Private method to show some help.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.__templateItemActivated">__templateItemActivated</a></td> +<td>Private slot to handle the activation of an item.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.addEntry">addEntry</a></td> +<td>Public method to add a template entry.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.addGroup">addGroup</a></td> +<td>Public method to add a group.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.applyNamedTemplate">applyNamedTemplate</a></td> +<td>Public method to apply a template given a template name.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.applyTemplate">applyTemplate</a></td> +<td>Public method to apply the template.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.changeEntry">changeEntry</a></td> +<td>Public method to change a template entry.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.changeGroup">changeGroup</a></td> +<td>Public method to rename a group.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.getAllGroups">getAllGroups</a></td> +<td>Public method to get all groups.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.getGroupNames">getGroupNames</a></td> +<td>Public method to get all group names.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.getTemplateNames">getTemplateNames</a></td> +<td>Public method to get the names of templates starting with the given string.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.hasGroup">hasGroup</a></td> +<td>Public method to check, if a group with the given name exists.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.hasTemplate">hasTemplate</a></td> +<td>Public method to check, if an entry of the given name exists.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.readTemplates">readTemplates</a></td> +<td>Public method to read in the templates file (.e4c).</td> +</tr> +<tr> +<td><a href="#TemplateViewer.removeEntry">removeEntry</a></td> +<td>Public method to remove a template entry.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.removeGroup">removeGroup</a></td> +<td>Public method to remove a group.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.save">save</a></td> +<td>Public slot to save the templates.</td> +</tr> +<tr> +<td><a href="#TemplateViewer.writeTemplates">writeTemplates</a></td> +<td>Public method to write the templates data to a JSON file (.ecj).</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="TemplateViewer.__init__" ID="TemplateViewer.__init__"></a> +<h4>TemplateViewer (Constructor)</h4> +<b>TemplateViewer</b>(<i>parent, viewmanager</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>parent</i></dt> +<dd> +the parent (QWidget) +</dd> +<dt><i>viewmanager</i></dt> +<dd> +reference to the viewmanager object +</dd> +</dl> +<a NAME="TemplateViewer.__addEntry" ID="TemplateViewer.__addEntry"></a> +<h4>TemplateViewer.__addEntry</h4> +<b>__addEntry</b>(<i></i>) + +<p> + Private slot to handle the Add Entry context menu action. +</p> +<a NAME="TemplateViewer.__addGroup" ID="TemplateViewer.__addGroup"></a> +<h4>TemplateViewer.__addGroup</h4> +<b>__addGroup</b>(<i></i>) + +<p> + Private slot to handle the Add Group context menu action. +</p> +<a NAME="TemplateViewer.__configure" ID="TemplateViewer.__configure"></a> +<h4>TemplateViewer.__configure</h4> +<b>__configure</b>(<i></i>) + +<p> + Private method to open the configuration dialog. +</p> +<a NAME="TemplateViewer.__edit" ID="TemplateViewer.__edit"></a> +<h4>TemplateViewer.__edit</h4> +<b>__edit</b>(<i></i>) + +<p> + Private slot to handle the Edit context menu action. +</p> +<a NAME="TemplateViewer.__export" ID="TemplateViewer.__export"></a> +<h4>TemplateViewer.__export</h4> +<b>__export</b>(<i></i>) + +<p> + Private slot to handle the Export context menu action. +</p> +<a NAME="TemplateViewer.__getPredefinedVars" ID="TemplateViewer.__getPredefinedVars"></a> +<h4>TemplateViewer.__getPredefinedVars</h4> +<b>__getPredefinedVars</b>(<i></i>) + +<p> + Private method to return predefined variables. +</p> +<dl> +<dt>Return:</dt> +<dd> +dictionary of predefined variables and their values +</dd> +</dl> +<a NAME="TemplateViewer.__import" ID="TemplateViewer.__import"></a> +<h4>TemplateViewer.__import</h4> +<b>__import</b>(<i></i>) + +<p> + Private slot to handle the Import context menu action. +</p> +<a NAME="TemplateViewer.__reload" ID="TemplateViewer.__reload"></a> +<h4>TemplateViewer.__reload</h4> +<b>__reload</b>(<i></i>) + +<p> + Private slot to reload the templates. +</p> +<a NAME="TemplateViewer.__remove" ID="TemplateViewer.__remove"></a> +<h4>TemplateViewer.__remove</h4> +<b>__remove</b>(<i></i>) + +<p> + Private slot to handle the Remove context menu action. +</p> +<a NAME="TemplateViewer.__resort" ID="TemplateViewer.__resort"></a> +<h4>TemplateViewer.__resort</h4> +<b>__resort</b>(<i></i>) + +<p> + Private method to resort the tree. +</p> +<a NAME="TemplateViewer.__showContextMenu" ID="TemplateViewer.__showContextMenu"></a> +<h4>TemplateViewer.__showContextMenu</h4> +<b>__showContextMenu</b>(<i>coord</i>) + +<p> + Private slot to show the context menu of the list. +</p> +<dl> + +<dt><i>coord</i></dt> +<dd> +the position of the mouse pointer (QPoint) +</dd> +</dl> +<a NAME="TemplateViewer.__showHelp" ID="TemplateViewer.__showHelp"></a> +<h4>TemplateViewer.__showHelp</h4> +<b>__showHelp</b>(<i></i>) + +<p> + Private method to show some help. +</p> +<a NAME="TemplateViewer.__templateItemActivated" ID="TemplateViewer.__templateItemActivated"></a> +<h4>TemplateViewer.__templateItemActivated</h4> +<b>__templateItemActivated</b>(<i>itm=None, col=0</i>) + +<p> + Private slot to handle the activation of an item. +</p> +<dl> + +<dt><i>itm</i></dt> +<dd> +reference to the activated item (QTreeWidgetItem) +</dd> +<dt><i>col</i></dt> +<dd> +column the item was activated in (integer) +</dd> +</dl> +<a NAME="TemplateViewer.addEntry" ID="TemplateViewer.addEntry"></a> +<h4>TemplateViewer.addEntry</h4> +<b>addEntry</b>(<i>groupName, name, description, template, quiet=False</i>) + +<p> + Public method to add a template entry. +</p> +<dl> + +<dt><i>groupName</i></dt> +<dd> +name of the group to add to (string) +</dd> +<dt><i>name</i></dt> +<dd> +name of the entry to add (string) +</dd> +<dt><i>description</i></dt> +<dd> +description of the entry to add (string) +</dd> +<dt><i>template</i></dt> +<dd> +template text of the entry (string) +</dd> +<dt><i>quiet</i></dt> +<dd> +flag indicating quiet operation (boolean) +</dd> +</dl> +<a NAME="TemplateViewer.addGroup" ID="TemplateViewer.addGroup"></a> +<h4>TemplateViewer.addGroup</h4> +<b>addGroup</b>(<i>name, language="All"</i>) + +<p> + Public method to add a group. +</p> +<dl> + +<dt><i>name</i></dt> +<dd> +name of the group to be added (string) +</dd> +<dt><i>language</i></dt> +<dd> +programming language for the group (string) +</dd> +</dl> +<a NAME="TemplateViewer.applyNamedTemplate" ID="TemplateViewer.applyNamedTemplate"></a> +<h4>TemplateViewer.applyNamedTemplate</h4> +<b>applyNamedTemplate</b>(<i>templateName, groupName=None</i>) + +<p> + Public method to apply a template given a template name. +</p> +<dl> + +<dt><i>templateName</i></dt> +<dd> +name of the template item to apply (string) +</dd> +<dt><i>groupName</i></dt> +<dd> +name of the group to get the entry from (string). + None or empty means to apply the first template found with the + given name. +</dd> +</dl> +<a NAME="TemplateViewer.applyTemplate" ID="TemplateViewer.applyTemplate"></a> +<h4>TemplateViewer.applyTemplate</h4> +<b>applyTemplate</b>(<i>itm</i>) + +<p> + Public method to apply the template. +</p> +<dl> + +<dt><i>itm</i></dt> +<dd> +reference to the template item to apply (TemplateEntry) +</dd> +</dl> +<a NAME="TemplateViewer.changeEntry" ID="TemplateViewer.changeEntry"></a> +<h4>TemplateViewer.changeEntry</h4> +<b>changeEntry</b>(<i>itm, name, groupName, description, template</i>) + +<p> + Public method to change a template entry. +</p> +<dl> + +<dt><i>itm</i></dt> +<dd> +template entry to be changed (TemplateEntry) +</dd> +<dt><i>name</i></dt> +<dd> +new name for the entry (string) +</dd> +<dt><i>groupName</i></dt> +<dd> +name of the group the entry should belong to + (string) +</dd> +<dt><i>description</i></dt> +<dd> +description of the entry (string) +</dd> +<dt><i>template</i></dt> +<dd> +template text of the entry (string) +</dd> +</dl> +<a NAME="TemplateViewer.changeGroup" ID="TemplateViewer.changeGroup"></a> +<h4>TemplateViewer.changeGroup</h4> +<b>changeGroup</b>(<i>oldname, newname, language="All"</i>) + +<p> + Public method to rename a group. +</p> +<dl> + +<dt><i>oldname</i></dt> +<dd> +old name of the group (string) +</dd> +<dt><i>newname</i></dt> +<dd> +new name of the group (string) +</dd> +<dt><i>language</i></dt> +<dd> +programming language for the group (string) +</dd> +</dl> +<a NAME="TemplateViewer.getAllGroups" ID="TemplateViewer.getAllGroups"></a> +<h4>TemplateViewer.getAllGroups</h4> +<b>getAllGroups</b>(<i></i>) + +<p> + Public method to get all groups. +</p> +<dl> +<dt>Return:</dt> +<dd> +list of all groups (list of TemplateGroup) +</dd> +</dl> +<a NAME="TemplateViewer.getGroupNames" ID="TemplateViewer.getGroupNames"></a> +<h4>TemplateViewer.getGroupNames</h4> +<b>getGroupNames</b>(<i></i>) + +<p> + Public method to get all group names. +</p> +<dl> +<dt>Return:</dt> +<dd> +list of all group names (list of strings) +</dd> +</dl> +<a NAME="TemplateViewer.getTemplateNames" ID="TemplateViewer.getTemplateNames"></a> +<h4>TemplateViewer.getTemplateNames</h4> +<b>getTemplateNames</b>(<i>start, groupName=None</i>) + +<p> + Public method to get the names of templates starting with the + given string. +</p> +<dl> + +<dt><i>start</i></dt> +<dd> +start string of the name (string) +</dd> +<dt><i>groupName</i></dt> +<dd> +name of the group to get the entry from (string). + None or empty means to look in all groups. +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +sorted list of matching template names (list of strings) +</dd> +</dl> +<a NAME="TemplateViewer.hasGroup" ID="TemplateViewer.hasGroup"></a> +<h4>TemplateViewer.hasGroup</h4> +<b>hasGroup</b>(<i>name</i>) + +<p> + Public method to check, if a group with the given name exists. +</p> +<dl> + +<dt><i>name</i></dt> +<dd> +name of the group to be checked for (string) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating an existing group (boolean) +</dd> +</dl> +<a NAME="TemplateViewer.hasTemplate" ID="TemplateViewer.hasTemplate"></a> +<h4>TemplateViewer.hasTemplate</h4> +<b>hasTemplate</b>(<i>entryName, groupName=None</i>) + +<p> + Public method to check, if an entry of the given name exists. +</p> +<dl> + +<dt><i>entryName</i></dt> +<dd> +name of the entry to check for (string) +</dd> +<dt><i>groupName</i></dt> +<dd> +name of the group to check for the entry (string). + None or empty means to check all groups. +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating the existence (boolean) +</dd> +</dl> +<a NAME="TemplateViewer.readTemplates" ID="TemplateViewer.readTemplates"></a> +<h4>TemplateViewer.readTemplates</h4> +<b>readTemplates</b>(<i>filename=None</i>) + +<p> + Public method to read in the templates file (.e4c). +</p> +<dl> + +<dt><i>filename</i> (str)</dt> +<dd> +name of a templates file to read +</dd> +</dl> +<a NAME="TemplateViewer.removeEntry" ID="TemplateViewer.removeEntry"></a> +<h4>TemplateViewer.removeEntry</h4> +<b>removeEntry</b>(<i>itm</i>) + +<p> + Public method to remove a template entry. +</p> +<dl> + +<dt><i>itm</i></dt> +<dd> +template entry to be removed (TemplateEntry) +</dd> +</dl> +<a NAME="TemplateViewer.removeGroup" ID="TemplateViewer.removeGroup"></a> +<h4>TemplateViewer.removeGroup</h4> +<b>removeGroup</b>(<i>itm</i>) + +<p> + Public method to remove a group. +</p> +<dl> + +<dt><i>itm</i></dt> +<dd> +template group to be removed (TemplateGroup) +</dd> +</dl> +<a NAME="TemplateViewer.save" ID="TemplateViewer.save"></a> +<h4>TemplateViewer.save</h4> +<b>save</b>(<i></i>) + +<p> + Public slot to save the templates. +</p> +<a NAME="TemplateViewer.writeTemplates" ID="TemplateViewer.writeTemplates"></a> +<h4>TemplateViewer.writeTemplates</h4> +<b>writeTemplates</b>(<i>filename=None</i>) + +<p> + Public method to write the templates data to a JSON file (.ecj). +</p> +<dl> + +<dt><i>filename</i> (str)</dt> +<dd> +name of a templates file to write +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating success +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +bool +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file