|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.gjt.sp.jedit.EditServer
public class EditServer
Inter-process communication.
The edit server protocol is very simple. $HOME/.jedit/server
is an ASCII file containing two lines, the first being the port number,
the second being the authorization key.
You connect to that port on the local machine, sending the authorization key as four bytes in network byte order, followed by the length of the BeanShell script as two bytes in network byte order, followed by the script in UTF8 encoding. After the socked is closed, the BeanShell script will be executed by jEdit.
The snippet is executed in the AWT thread. None of the usual BeanShell variables (view, buffer, textArea, editPane) are set so the script has to figure things out by itself.
In most cases, the script will call the static
handleClient(boolean,String,String[])
method, but of course more
complicated stuff can be done too.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
---|---|
int |
getPort()
|
static Buffer |
handleClient(boolean restore,
boolean newView,
boolean newPlainView,
java.lang.String parent,
java.lang.String[] args)
|
static void |
handleClient(boolean restore,
java.lang.String parent,
java.lang.String[] args)
|
void |
run()
|
Methods inherited from class java.lang.Thread |
---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public static void handleClient(boolean restore, java.lang.String parent, java.lang.String[] args)
restore
- Ignored unless no views are openparent
- The client's parent directoryargs
- A list of files. Null entries are ignored, for conviniencepublic static Buffer handleClient(boolean restore, boolean newView, boolean newPlainView, java.lang.String parent, java.lang.String[] args)
restore
- Ignored unless no views are opennewView
- Open a new view?newPlainView
- Open a new plain view?parent
- The client's parent directoryargs
- A list of files. Null entries are ignored, for conviniencepublic int getPort()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |