PageRenderTime 148ms CodeModel.GetById 132ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/api/org/gjt/sp/jedit/EditServer.html

#
HTML | 347 lines | 296 code | 39 blank | 12 comment | 0 complexity | 682fa873b6786bae5e03c4d8981b465b MD5 | raw file
  1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2<!--NewPage-->
  3<HTML>
  4<HEAD>
  5<!-- Generated by javadoc (build 1.5.0_14) on Tue Jul 22 07:13:45 GMT-08:00 2008 -->
  6<TITLE>
  7EditServer (jEdit API)
  8</TITLE>
  9
 10<META NAME="keywords" CONTENT="org.gjt.sp.jedit.EditServer class">
 11
 12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
 13
 14
 15<NOSCRIPT>
 16</NOSCRIPT>
 17
 18</HEAD>
 19
 20<BODY BGCOLOR="white" >
 21
 22
 23<!-- ========= START OF TOP NAVBAR ======= -->
 24<A NAME="navbar_top"><!-- --></A>
 25<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
 26<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
 27<TR>
 28<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
 29<A NAME="navbar_top_firstrow"><!-- --></A>
 30<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
 31  <TR ALIGN="center" VALIGN="top">
 32  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
 33  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
 34  <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
 35  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/EditServer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
 36  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
 37  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
 38  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
 39  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
 40  </TR>
 41</TABLE>
 42</TD>
 43<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
 44</EM>
 45</TD>
 46</TR>
 47
 48<TR>
 49<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 50&nbsp;<A HREF="../../../../org/gjt/sp/jedit/EditPlugin.Deferred.html" title="class in org.gjt.sp.jedit"><B>PREV CLASS</B></A>&nbsp;
 51&nbsp;<A HREF="../../../../org/gjt/sp/jedit/GUIUtilities.html" title="class in org.gjt.sp.jedit"><B>NEXT CLASS</B></A></FONT></TD>
 52<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 53  <A HREF="../../../../index.html?org/gjt/sp/jedit/EditServer.html" target="_top"><B>FRAMES</B></A>  &nbsp;
 54&nbsp;<A HREF="EditServer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
 55&nbsp;
 56<NOSCRIPT>
 57  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
 58</NOSCRIPT>
 59
 60
 61</FONT></TD>
 62</TR>
 63<TR>
 64<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 65  SUMMARY:&nbsp;<A HREF="#nested_classes_inherited_from_class_java.lang.Thread">NESTED</A>&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_java.lang.Thread">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
 66<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 67DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
 68</TR>
 69</TABLE>
 70<A NAME="skip-navbar_top"></A>
 71<!-- ========= END OF TOP NAVBAR ========= -->
 72
 73<HR>
 74<!-- ======== START OF CLASS DATA ======== -->
 75<H2>
 76<FONT SIZE="-1">
 77org.gjt.sp.jedit</FONT>
 78<BR>
 79Class EditServer</H2>
 80<PRE>
 81java.lang.Object
 82  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by ">java.lang.Thread
 83      <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.gjt.sp.jedit.EditServer</B>
 84</PRE>
 85<DL>
 86<DT><B>All Implemented Interfaces:</B> <DD>java.lang.Runnable</DD>
 87</DL>
 88<HR>
 89<DL>
 90<DT><PRE>public class <B>EditServer</B><DT>extends java.lang.Thread</DL>
 91</PRE>
 92
 93<P>
 94Inter-process communication.<p>
 95
 96 The edit server protocol is very simple. <code>$HOME/.jedit/server</code>
 97 is an ASCII file containing two lines, the first being the port number,
 98 the second being the authorization key.<p>
 99
100 You connect to that port on the local machine, sending the authorization
101 key as four bytes in network byte order, followed by the length of the
102 BeanShell script as two bytes in network byte order, followed by the
103 script in UTF8 encoding. After the socked is closed, the BeanShell script
104 will be executed by jEdit.<p>
105
106 The snippet is executed in the AWT thread. None of the usual BeanShell
107 variables (view, buffer, textArea, editPane) are set so the script has to
108 figure things out by itself.<p>
109
110 In most cases, the script will call the static
111 <A HREF="../../../../org/gjt/sp/jedit/EditServer.html#handleClient(boolean, java.lang.String, java.lang.String[])"><CODE>handleClient(boolean,String,String[])</CODE></A> method, but of course more
112 complicated stuff can be done too.
113<P>
114
115<P>
116<HR>
117
118<P>
119<!-- ======== NESTED CLASS SUMMARY ======== -->
120
121<A NAME="nested_class_summary"><!-- --></A>
122<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
123<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
124<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
125<B>Nested Class Summary</B></FONT></TH>
126</TR>
127</TABLE>
128&nbsp;<A NAME="nested_classes_inherited_from_class_java.lang.Thread"><!-- --></A>
129<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
130<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
131<TH ALIGN="left"><B>Nested classes/interfaces inherited from class java.lang.Thread</B></TH>
132</TR>
133<TR BGCOLOR="white" CLASS="TableRowColor">
134<TD><CODE>java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler</CODE></TD>
135</TR>
136</TABLE>
137&nbsp;
138<!-- =========== FIELD SUMMARY =========== -->
139
140<A NAME="field_summary"><!-- --></A>
141<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
142<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
143<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
144<B>Field Summary</B></FONT></TH>
145</TR>
146</TABLE>
147&nbsp;<A NAME="fields_inherited_from_class_java.lang.Thread"><!-- --></A>
148<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
149<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
150<TH ALIGN="left"><B>Fields inherited from class java.lang.Thread</B></TH>
151</TR>
152<TR BGCOLOR="white" CLASS="TableRowColor">
153<TD><CODE>MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY</CODE></TD>
154</TR>
155</TABLE>
156&nbsp;
157<!-- ========== METHOD SUMMARY =========== -->
158
159<A NAME="method_summary"><!-- --></A>
160<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
161<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
162<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
163<B>Method Summary</B></FONT></TH>
164</TR>
165<TR BGCOLOR="white" CLASS="TableRowColor">
166<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
167<CODE>&nbsp;int</CODE></FONT></TD>
168<TD><CODE><B><A HREF="../../../../org/gjt/sp/jedit/EditServer.html#getPort()">getPort</A></B>()</CODE>
169
170<BR>
171&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
172</TR>
173<TR BGCOLOR="white" CLASS="TableRowColor">
174<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
175<CODE>static&nbsp;<A HREF="../../../../org/gjt/sp/jedit/Buffer.html" title="class in org.gjt.sp.jedit">Buffer</A></CODE></FONT></TD>
176<TD><CODE><B><A HREF="../../../../org/gjt/sp/jedit/EditServer.html#handleClient(boolean, boolean, boolean, java.lang.String, java.lang.String[])">handleClient</A></B>(boolean&nbsp;restore,
177             boolean&nbsp;newView,
178             boolean&nbsp;newPlainView,
179             java.lang.String&nbsp;parent,
180             java.lang.String[]&nbsp;args)</CODE>
181
182<BR>
183&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
184</TR>
185<TR BGCOLOR="white" CLASS="TableRowColor">
186<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
187<CODE>static&nbsp;void</CODE></FONT></TD>
188<TD><CODE><B><A HREF="../../../../org/gjt/sp/jedit/EditServer.html#handleClient(boolean, java.lang.String, java.lang.String[])">handleClient</A></B>(boolean&nbsp;restore,
189             java.lang.String&nbsp;parent,
190             java.lang.String[]&nbsp;args)</CODE>
191
192<BR>
193&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
194</TR>
195<TR BGCOLOR="white" CLASS="TableRowColor">
196<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
197<CODE>&nbsp;void</CODE></FONT></TD>
198<TD><CODE><B><A HREF="../../../../org/gjt/sp/jedit/EditServer.html#run()">run</A></B>()</CODE>
199
200<BR>
201&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
202</TR>
203</TABLE>
204&nbsp;<A NAME="methods_inherited_from_class_java.lang.Thread"><!-- --></A>
205<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
206<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
207<TH ALIGN="left"><B>Methods inherited from class java.lang.Thread</B></TH>
208</TR>
209<TR BGCOLOR="white" CLASS="TableRowColor">
210<TD><CODE>activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield</CODE></TD>
211</TR>
212</TABLE>
213&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
214<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
215<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
216<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
217</TR>
218<TR BGCOLOR="white" CLASS="TableRowColor">
219<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
220</TR>
221</TABLE>
222&nbsp;
223<P>
224
225<!-- ============ METHOD DETAIL ========== -->
226
227<A NAME="method_detail"><!-- --></A>
228<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
229<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
230<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
231<B>Method Detail</B></FONT></TH>
232</TR>
233</TABLE>
234
235<A NAME="run()"><!-- --></A><H3>
236run</H3>
237<PRE>
238public void <B>run</B>()</PRE>
239<DL>
240<DD><DL>
241<DT><B>Specified by:</B><DD><CODE>run</CODE> in interface <CODE>java.lang.Runnable</CODE><DT><B>Overrides:</B><DD><CODE>run</CODE> in class <CODE>java.lang.Thread</CODE></DL>
242</DD>
243<DD><DL>
244</DL>
245</DD>
246</DL>
247<HR>
248
249<A NAME="handleClient(boolean, java.lang.String, java.lang.String[])"><!-- --></A><H3>
250handleClient</H3>
251<PRE>
252public static void <B>handleClient</B>(boolean&nbsp;restore,
253                                java.lang.String&nbsp;parent,
254                                java.lang.String[]&nbsp;args)</PRE>
255<DL>
256<DD><DL>
257<DT><B>Parameters:</B><DD><CODE>restore</CODE> - Ignored unless no views are open<DD><CODE>parent</CODE> - The client's parent directory<DD><CODE>args</CODE> - A list of files. Null entries are ignored, for convinience<DT><B>Since:</B></DT>
258  <DD>jEdit 3.2pre7</DD>
259</DL>
260</DD>
261</DL>
262<HR>
263
264<A NAME="handleClient(boolean, boolean, boolean, java.lang.String, java.lang.String[])"><!-- --></A><H3>
265handleClient</H3>
266<PRE>
267public static <A HREF="../../../../org/gjt/sp/jedit/Buffer.html" title="class in org.gjt.sp.jedit">Buffer</A> <B>handleClient</B>(boolean&nbsp;restore,
268                                  boolean&nbsp;newView,
269                                  boolean&nbsp;newPlainView,
270                                  java.lang.String&nbsp;parent,
271                                  java.lang.String[]&nbsp;args)</PRE>
272<DL>
273<DD><DL>
274<DT><B>Parameters:</B><DD><CODE>restore</CODE> - Ignored unless no views are open<DD><CODE>newView</CODE> - Open a new view?<DD><CODE>newPlainView</CODE> - Open a new plain view?<DD><CODE>parent</CODE> - The client's parent directory<DD><CODE>args</CODE> - A list of files. Null entries are ignored, for convinience<DT><B>Since:</B></DT>
275  <DD>jEdit 4.2pre1</DD>
276</DL>
277</DD>
278</DL>
279<HR>
280
281<A NAME="getPort()"><!-- --></A><H3>
282getPort</H3>
283<PRE>
284public int <B>getPort</B>()</PRE>
285<DL>
286<DD><DL>
287</DL>
288</DD>
289</DL>
290<!-- ========= END OF CLASS DATA ========= -->
291<HR>
292
293
294<!-- ======= START OF BOTTOM NAVBAR ====== -->
295<A NAME="navbar_bottom"><!-- --></A>
296<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
297<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
298<TR>
299<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
300<A NAME="navbar_bottom_firstrow"><!-- --></A>
301<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
302  <TR ALIGN="center" VALIGN="top">
303  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
304  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
305  <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
306  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/EditServer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
307  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
308  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
309  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
310  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
311  </TR>
312</TABLE>
313</TD>
314<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
315</EM>
316</TD>
317</TR>
318
319<TR>
320<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
321&nbsp;<A HREF="../../../../org/gjt/sp/jedit/EditPlugin.Deferred.html" title="class in org.gjt.sp.jedit"><B>PREV CLASS</B></A>&nbsp;
322&nbsp;<A HREF="../../../../org/gjt/sp/jedit/GUIUtilities.html" title="class in org.gjt.sp.jedit"><B>NEXT CLASS</B></A></FONT></TD>
323<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
324  <A HREF="../../../../index.html?org/gjt/sp/jedit/EditServer.html" target="_top"><B>FRAMES</B></A>  &nbsp;
325&nbsp;<A HREF="EditServer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
326&nbsp;
327<NOSCRIPT>
328  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
329</NOSCRIPT>
330
331
332</FONT></TD>
333</TR>
334<TR>
335<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
336  SUMMARY:&nbsp;<A HREF="#nested_classes_inherited_from_class_java.lang.Thread">NESTED</A>&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_java.lang.Thread">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
337<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
338DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
339</TR>
340</TABLE>
341<A NAME="skip-navbar_bottom"></A>
342<!-- ======== END OF BOTTOM NAVBAR ======= -->
343
344<HR>
345
346</BODY>
347</HTML>