Documentation/Source/eric6.UI.CodeDocumentationViewer.html

Tue, 24 Oct 2017 19:09:09 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 24 Oct 2017 19:09:09 +0200
changeset 5928
a3809f75ca07
parent 5926
69482290dbdd
child 5961
2a5232311a65
permissions
-rw-r--r--

Changed the logic of the two web browsers in order to put new downloads at the top of the list of downloads and add the download date and time to the shown info.

<!DOCTYPE html>
<html><head>
<title>eric6.UI.CodeDocumentationViewer</title>
<meta charset="UTF-8">
<style>
body {
    background: #EDECE6;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #85774A; }
h2 { color: white; background: #85774A; }
h3 { color: white; background: #9D936E; }
h4 { color: white; background: #9D936E; }
    
a { color: #BA6D36; }

</style>
</head>
<body><a NAME="top" ID="top"></a>
<h1>eric6.UI.CodeDocumentationViewer</h1>
<p>
Module implementing a widget to show some source code information provided by
plug-ins.
</p>
<h3>Global Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Classes</h3>
<table>
<tr>
<td><a href="#CodeDocumentationViewer">CodeDocumentationViewer</a></td>
<td>Class implementing a widget to show some source code information provided by plug-ins.</td>
</tr><tr>
<td><a href="#PlainTextDocumentationViewer">PlainTextDocumentationViewer</a></td>
<td>Class implementing the plain text documentation viewer.</td>
</tr><tr>
<td><a href="#WebViewDocumentationViewer">WebViewDocumentationViewer</a></td>
<td>Class implementing the rich text documentation viewer.</td>
</tr>
</table>
<h3>Functions</h3>
<table>
<tr><td>None</td></tr>
</table>
<hr /><hr />
<a NAME="CodeDocumentationViewer" ID="CodeDocumentationViewer"></a>
<h2>CodeDocumentationViewer</h2>
<p>
    Class implementing a widget to show some source code information provided
    by plug-ins.
</p><h3>Signals</h3>
<dl>
<dt>providerAdded()</dt>
<dd>
emitted to indicate the availability of a new
        provider
</dd><dt>providerRemoved()</dt>
<dd>
emitted to indicate the removal of a provider
</dd>
</dl>
<h3>Derived from</h3>
QWidget
<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="#CodeDocumentationViewer.__init__">CodeDocumentationViewer</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.__setHtml">__setHtml</a></td>
<td>Private slot to set the prepared HTML text.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.__setHtmlWarning">__setHtmlWarning</a></td>
<td>Private slot to set a display message.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.__setupUi">__setupUi</a></td>
<td>Private method to generate the UI layout.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.__showDisabledMessage">__showDisabledMessage</a></td>
<td>Private method to show a message giving the reason for being disabled.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.__showTextViewer">__showTextViewer</a></td>
<td>Private slot to show the selected viewer.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.documentationReady">documentationReady</a></td>
<td>Public method to provide the documentation info to the viewer.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.finalizeSetup">finalizeSetup</a></td>
<td>Public method to finalize the setup of the documentation viewer.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.getProviders">getProviders</a></td>
<td>Public method to get a list of providers and their visible strings.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.isSupportedLanguage">isSupportedLanguage</a></td>
<td>Public method to check, if the given language is supported by the selected provider.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.on_providerComboBox_currentIndexChanged">on_providerComboBox_currentIndexChanged</a></td>
<td>Private slot to handle the selection of a provider.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.preferencesChanged">preferencesChanged</a></td>
<td>Public slot to handle a change of preferences.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.registerProvider">registerProvider</a></td>
<td>Public method register a source docu provider.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.showInfo">showInfo</a></td>
<td>Public method to request code documentation data from a provider.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.shutdown">shutdown</a></td>
<td>Public method to perform shutdown actions.</td>
</tr><tr>
<td><a href="#CodeDocumentationViewer.unregisterProvider">unregisterProvider</a></td>
<td>Public method register a source docu provider.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="CodeDocumentationViewer.__init__" ID="CodeDocumentationViewer.__init__"></a>
<h4>CodeDocumentationViewer (Constructor)</h4>
<b>CodeDocumentationViewer</b>(<i>parent=None</i>)
<p>
        Constructor
</p><dl>
<dt><i>parent</i> (QWidget)</dt>
<dd>
reference to the parent widget
</dd>
</dl><a NAME="CodeDocumentationViewer.__setHtml" ID="CodeDocumentationViewer.__setHtml"></a>
<h4>CodeDocumentationViewer.__setHtml</h4>
<b>__setHtml</b>(<i>html</i>)
<p>
        Private slot to set the prepared HTML text.
</p><dl>
<dt><i>html</i> (str)</dt>
<dd>
prepared HTML text
</dd>
</dl><a NAME="CodeDocumentationViewer.__setHtmlWarning" ID="CodeDocumentationViewer.__setHtmlWarning"></a>
<h4>CodeDocumentationViewer.__setHtmlWarning</h4>
<b>__setHtmlWarning</b>(<i>warningText</i>)
<p>
        Private slot to set a display message.
</p><dl>
<dt><i>warningText</i> (str)</dt>
<dd>
text to be shown as a warning
</dd>
</dl><a NAME="CodeDocumentationViewer.__setupUi" ID="CodeDocumentationViewer.__setupUi"></a>
<h4>CodeDocumentationViewer.__setupUi</h4>
<b>__setupUi</b>(<i></i>)
<p>
        Private method to generate the UI layout.
</p><a NAME="CodeDocumentationViewer.__showDisabledMessage" ID="CodeDocumentationViewer.__showDisabledMessage"></a>
<h4>CodeDocumentationViewer.__showDisabledMessage</h4>
<b>__showDisabledMessage</b>(<i></i>)
<p>
        Private method to show a message giving the reason for being disabled.
</p><a NAME="CodeDocumentationViewer.__showTextViewer" ID="CodeDocumentationViewer.__showTextViewer"></a>
<h4>CodeDocumentationViewer.__showTextViewer</h4>
<b>__showTextViewer</b>(<i>richText</i>)
<p>
        Private slot to show the selected viewer.
</p><dl>
<dt><i>richText</i> (bool)</dt>
<dd>
flag indicating the rich text viewer
</dd>
</dl><a NAME="CodeDocumentationViewer.documentationReady" ID="CodeDocumentationViewer.documentationReady"></a>
<h4>CodeDocumentationViewer.documentationReady</h4>
<b>documentationReady</b>(<i>documentationInfo, isWarning=False, isDocWarning=False</i>)
<p>
        Public method to provide the documentation info to the viewer.
</p><p>
        If documentationInfo is a dictionary, it should contains these keys
        and data:
</p><p>
        name: the name of the inspected object
        argspec: its argspec
        note: A phrase describing the type of object (function or method) and
            the module it belongs to.
        docstring: its documentation string
</p><dl>
<dt><i>documentationInfo</i> (dict or str)</dt>
<dd>
dictionary containing the source docu data
</dd><dt><i>isWarning</i> (bool)</dt>
<dd>
flag indicating a warning page
</dd><dt><i>isDocWarning</i> (bool)</dt>
<dd>
flag indicating a documentation warning page
</dd>
</dl><a NAME="CodeDocumentationViewer.finalizeSetup" ID="CodeDocumentationViewer.finalizeSetup"></a>
<h4>CodeDocumentationViewer.finalizeSetup</h4>
<b>finalizeSetup</b>(<i></i>)
<p>
        Public method to finalize the setup of the documentation viewer.
</p><a NAME="CodeDocumentationViewer.getProviders" ID="CodeDocumentationViewer.getProviders"></a>
<h4>CodeDocumentationViewer.getProviders</h4>
<b>getProviders</b>(<i></i>)
<p>
        Public method to get a list of providers and their visible strings.
</p><dl>
<dt>Returns:</dt>
<dd>
list containing the providers and their visible strings
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
list of tuple of (str,str)
</dd>
</dl><a NAME="CodeDocumentationViewer.isSupportedLanguage" ID="CodeDocumentationViewer.isSupportedLanguage"></a>
<h4>CodeDocumentationViewer.isSupportedLanguage</h4>
<b>isSupportedLanguage</b>(<i>language</i>)
<p>
        Public method to check, if the given language is supported by the
        selected provider.
</p><dl>
<dt><i>language</i> (str)</dt>
<dd>
editor programming language to check
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
flag indicating the support status
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl><a NAME="CodeDocumentationViewer.on_providerComboBox_currentIndexChanged" ID="CodeDocumentationViewer.on_providerComboBox_currentIndexChanged"></a>
<h4>CodeDocumentationViewer.on_providerComboBox_currentIndexChanged</h4>
<b>on_providerComboBox_currentIndexChanged</b>(<i>index</i>)
<p>
        Private slot to handle the selection of a provider.
</p><dl>
<dt><i>index</i> (int)</dt>
<dd>
index of the selected provider
</dd>
</dl><a NAME="CodeDocumentationViewer.preferencesChanged" ID="CodeDocumentationViewer.preferencesChanged"></a>
<h4>CodeDocumentationViewer.preferencesChanged</h4>
<b>preferencesChanged</b>(<i></i>)
<p>
        Public slot to handle a change of preferences.
</p><a NAME="CodeDocumentationViewer.registerProvider" ID="CodeDocumentationViewer.registerProvider"></a>
<h4>CodeDocumentationViewer.registerProvider</h4>
<b>registerProvider</b>(<i>providerName, providerDisplay, provider, supported</i>)
<p>
        Public method register a source docu provider.
</p><dl>
<dt><i>providerName</i> (str)</dt>
<dd>
name of the provider (must be unique)
</dd><dt><i>providerDisplay</i> (str)</dt>
<dd>
visible name of the provider
</dd><dt><i>provider</i> (function(editor))</dt>
<dd>
function to be called to determine source docu
</dd><dt><i>supported</i> (function(language))</dt>
<dd>
function to be called to determine, if a language is
            supported
</dd>
</dl><dl>
<dt>Raises <b>KeyError</b>:</dt>
<dd>
raised if a provider with the given name was
            already registered
</dd>
</dl><a NAME="CodeDocumentationViewer.showInfo" ID="CodeDocumentationViewer.showInfo"></a>
<h4>CodeDocumentationViewer.showInfo</h4>
<b>showInfo</b>(<i>editor</i>)
<p>
        Public method to request code documentation data from a provider.
</p><dl>
<dt><i>editor</i> (Editor)</dt>
<dd>
reference to the editor to request code docu for
</dd>
</dl><a NAME="CodeDocumentationViewer.shutdown" ID="CodeDocumentationViewer.shutdown"></a>
<h4>CodeDocumentationViewer.shutdown</h4>
<b>shutdown</b>(<i></i>)
<p>
        Public method to perform shutdown actions.
</p><a NAME="CodeDocumentationViewer.unregisterProvider" ID="CodeDocumentationViewer.unregisterProvider"></a>
<h4>CodeDocumentationViewer.unregisterProvider</h4>
<b>unregisterProvider</b>(<i>providerName</i>)
<p>
        Public method register a source docu provider.
</p><dl>
<dt><i>providerName</i> (str)</dt>
<dd>
name of the provider (must be unique)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="PlainTextDocumentationViewer" ID="PlainTextDocumentationViewer"></a>
<h2>PlainTextDocumentationViewer</h2>
<p>
    Class implementing the plain text documentation viewer.
</p>
<h3>Derived from</h3>
QWidget
<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="#PlainTextDocumentationViewer.__init__">PlainTextDocumentationViewer</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#PlainTextDocumentationViewer.clear">clear</a></td>
<td>Public method to clear the contents.</td>
</tr><tr>
<td><a href="#PlainTextDocumentationViewer.preferencesChanged">preferencesChanged</a></td>
<td>Public slot to handle a change of preferences.</td>
</tr><tr>
<td><a href="#PlainTextDocumentationViewer.setText">setText</a></td>
<td>Public method to set the text to be shown.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="PlainTextDocumentationViewer.__init__" ID="PlainTextDocumentationViewer.__init__"></a>
<h4>PlainTextDocumentationViewer (Constructor)</h4>
<b>PlainTextDocumentationViewer</b>(<i>parent=None</i>)
<p>
        Constructor
</p><dl>
<dt><i>parent</i> (QWidget)</dt>
<dd>
reference to the parent widget
</dd>
</dl><a NAME="PlainTextDocumentationViewer.clear" ID="PlainTextDocumentationViewer.clear"></a>
<h4>PlainTextDocumentationViewer.clear</h4>
<b>clear</b>(<i></i>)
<p>
        Public method to clear the contents.
</p><a NAME="PlainTextDocumentationViewer.preferencesChanged" ID="PlainTextDocumentationViewer.preferencesChanged"></a>
<h4>PlainTextDocumentationViewer.preferencesChanged</h4>
<b>preferencesChanged</b>(<i></i>)
<p>
        Public slot to handle a change of preferences.
</p><a NAME="PlainTextDocumentationViewer.setText" ID="PlainTextDocumentationViewer.setText"></a>
<h4>PlainTextDocumentationViewer.setText</h4>
<b>setText</b>(<i>text</i>)
<p>
        Public method to set the text to be shown.
</p><dl>
<dt><i>text</i> (str)</dt>
<dd>
text to be shown
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="WebViewDocumentationViewer" ID="WebViewDocumentationViewer"></a>
<h2>WebViewDocumentationViewer</h2>
<p>
    Class implementing the rich text documentation viewer.
</p>
<h3>Derived from</h3>
QWidget
<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="#WebViewDocumentationViewer.__init__">WebViewDocumentationViewer</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#WebViewDocumentationViewer.__showLink">__showLink</a></td>
<td>Private slot to show the hovered link in a tooltip.</td>
</tr><tr>
<td><a href="#WebViewDocumentationViewer.clear">clear</a></td>
<td>Public method to clear the shown contents.</td>
</tr><tr>
<td><a href="#WebViewDocumentationViewer.setHtml">setHtml</a></td>
<td>Public method to set the HTML text of the widget.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="WebViewDocumentationViewer.__init__" ID="WebViewDocumentationViewer.__init__"></a>
<h4>WebViewDocumentationViewer (Constructor)</h4>
<b>WebViewDocumentationViewer</b>(<i>parent=None</i>)
<p>
        Constructor
</p><dl>
<dt><i>parent</i> (QWidget)</dt>
<dd>
reference to the parent widget
</dd>
</dl><a NAME="WebViewDocumentationViewer.__showLink" ID="WebViewDocumentationViewer.__showLink"></a>
<h4>WebViewDocumentationViewer.__showLink</h4>
<b>__showLink</b>(<i>urlStr</i>)
<p>
        Private slot to show the hovered link in a tooltip.
</p><dl>
<dt><i>urlStr</i> (str)</dt>
<dd>
hovered URL
</dd>
</dl><a NAME="WebViewDocumentationViewer.clear" ID="WebViewDocumentationViewer.clear"></a>
<h4>WebViewDocumentationViewer.clear</h4>
<b>clear</b>(<i></i>)
<p>
        Public method to clear the shown contents.
</p><a NAME="WebViewDocumentationViewer.setHtml" ID="WebViewDocumentationViewer.setHtml"></a>
<h4>WebViewDocumentationViewer.setHtml</h4>
<b>setHtml</b>(<i>html</i>)
<p>
        Public method to set the HTML text of the widget.
</p><dl>
<dt><i>html</i> (str)</dt>
<dd>
HTML text to be shown
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial