PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/42docs/users-guide/launcher-interface.html

#
HTML | 66 lines | 66 code | 0 blank | 0 comment | 0 complexity | 0b5bf6696c94c8b3095849d75135dadf MD5 | raw file
 1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>The jEditLauncher Interface</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="jEdit 4.2 User's Guide"><link rel="up" href="launcher-guide.html" title="Appendix G. jEditLauncher for Windows"><link rel="previous" href="launcher-uninstall.html" title="Uninstalling jEdit and jEditLauncher"><link rel="next" href="launcher-examples.html" title="Scripting Examples"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The jEditLauncher Interface</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="launcher-uninstall.html">Prev</a> </td><th width="60%" align="center">Appendix G. jEditLauncher for Windows</th><td width="20%" align="right"> <a accesskey="n" href="launcher-examples.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="launcher-interface"></a>The jEditLauncher Interface</h2></div></div><div></div></div><p>
 2    The core of the jEditLauncher package is a COM component that can
 3    communicate with the EditServer, or open jEdit if it is not running or
 4    is otherwise refusing a connection. The component supports both Windows
 5    and UNC file specifications, including wild cards. It will resolve
 6    shortcut links to identify and transmit the name of the underlying file.
 7  </p><p>
 8    Because it is implemented with a &#8220;<span class="quote">dual interface</span>&#8221;, the
 9    functions of jEditLauncher are available to scripting languages in the
10    Windows environment such as VBScript, JScript, Perl (using the
11    Win32::OLE package) and Python (using the win32com.client package).
12  </p><p>
13    The scriptable interface consists of two read-only properties and
14    six functions:
15  </p><p>
16    <span class="emphasis"><em>Properties</em></span>
17  </p><div class="itemizedlist"><ul type="disc"><li><p>
18        <tt class="varname">ServerPort</tt> - a read-only property that returns the
19        port number found in jEdit's server file; the value is not tested for
20        authenticity. It returns zero if the server information file cannot
21        be located.
22      </p></li><li><p>
23        <tt class="varname">ServerKey</tt> - a read-only property that returns the numeric
24        authorization key found in jEdit's server file; the value is not tested
25        for authenticity. It returns zero if the server information file cannot
26        be located.
27        </p></li></ul></div><p>
28      <span class="emphasis"><em>Functions</em></span>
29    </p><div class="itemizedlist"><ul type="disc"><li><p>
30        <tt class="function">OpenFile</tt> - a method that takes a single file name
31        (with or without wild card characters) as a parameter.
32      </p></li><li><p>
33        <tt class="function">OpenFiles</tt> - this method takes an array of file names
34        (with or without wild card characters) as a parameter. The form of the
35        array is that which is used for arrays in the scripting environment. In
36        JScript, for example the data type of the <tt class="classname">VARIANT</tt> holding
37        the array is <tt class="classname">VT_DISPATCH</tt>; in VBScript, it is <tt class="classname">VT_ARRAY
38        | VT_VARIANT</tt>, with array members having data type
39        <tt class="classname">VT_BSTR</tt>.
40      </p></li><li><p>
41        <tt class="function">Launch</tt> - this method with no parameters attempts to
42        open jEdit without loading additional files.
43      </p></li><li><p>
44      <tt class="function">RunScript</tt> - this method takes a file name or full file
45      path as a parameter and runs the referenced file as a BeanShell script in jEdit.
46      The predefined variables <tt class="varname">view</tt>, <tt class="varname">editPane</tt>,
47      <tt class="varname">textArea</tt> and <tt class="varname">buffer</tt> are available to the
48      script. If more than one view is open, the variable are
49      initialized with reference to the earliest opened view. If no path is
50      given for the file it will use the working directory of the calling process.
51    </p></li><li><p>
52      <tt class="function">EvalScript</tt> - this method takes a string as a
53      parameter containing one or more BeanShell statements and runs the script
54      in jEdit's BeanShell interpreter.  The
55      predefined variables are available on the same basis as in
56      <tt class="function">RunScript</tt>.
57    </p></li><li><p>
58      <tt class="function">RunDiff</tt> - this method takes two strings
59      representing file names as parameters.  If the
60      <span class="application">JDiff</span> plugin is installed, this method
61      will activate the JDiff plugin and display the two files in the
62      plugin's graphical &#8220;<span class="quote">dual diff</span>&#8221; format.  The first
63      parameter is treated as the base for display purposes.  If the
64      <span class="application">JDiff</span> plugin is not installed, a
65      error message box will be displayed in jEdit.
66    </p></li></ul></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="launcher-uninstall.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="launcher-guide.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="launcher-examples.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Uninstalling jEdit and jEditLauncher </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Scripting Examples</td></tr></table></div></body></html>