diff --git a/dist/java/src/mp/code/BufferController.java b/dist/java/src/mp/code/BufferController.java index 99570fa..fe1becd 100644 --- a/dist/java/src/mp/code/BufferController.java +++ b/dist/java/src/mp/code/BufferController.java @@ -70,6 +70,7 @@ public final class BufferController { /** * Tries to send a {@link TextChange} update. + * @param change the update to send * @throws ControllerException if the controller was stopped */ public void send(TextChange change) throws ControllerException { @@ -81,6 +82,8 @@ public final class BufferController { /** * Registers a callback to be invoked whenever a {@link BufferUpdate} occurs. * This will not work unless a Java thread has been dedicated to the event loop. + * @param cb a {@link Consumer} that receives the controller when the change occurs; + * you should probably spawn a new thread in here, to avoid deadlocking * @see Extensions#drive(boolean) */ public void callback(Consumer cb) { diff --git a/dist/java/src/mp/code/CursorController.java b/dist/java/src/mp/code/CursorController.java index 6c2cae1..2a0f5ee 100644 --- a/dist/java/src/mp/code/CursorController.java +++ b/dist/java/src/mp/code/CursorController.java @@ -43,14 +43,15 @@ public final class CursorController { return recv(this.ptr); } - private static native void send(long self, Selection cursor) throws ControllerException; + private static native void send(long self, Selection selection) throws ControllerException; /** * Tries to send a {@link Selection} update. + * @param selection the update to send * @throws ControllerException if the controller was stopped */ - public void send(Selection cursor) throws ControllerException { - send(this.ptr, cursor); + public void send(Selection selection) throws ControllerException { + send(this.ptr, selection); } private static native void callback(long self, Consumer cb); @@ -58,6 +59,8 @@ public final class CursorController { /** * Registers a callback to be invoked whenever a {@link Cursor} update occurs. * This will not work unless a Java thread has been dedicated to the event loop. + * @param cb a {@link Consumer} that receives the controller when the change occurs; + * you should probably spawn a new thread in here, to avoid deadlocking * @see Extensions#drive(boolean) */ public void callback(Consumer cb) { diff --git a/dist/java/src/mp/code/Extensions.java b/dist/java/src/mp/code/Extensions.java index ff4a1b7..327e0f4 100644 --- a/dist/java/src/mp/code/Extensions.java +++ b/dist/java/src/mp/code/Extensions.java @@ -33,7 +33,7 @@ public final class Extensions { *

* You may alternatively call this with true, in a separate and dedicated Java thread; * it will remain active in the background and act as event loop. Assign it like this: - *

new Thread(() -> Extensions.drive(true)).start();

+ *

new Thread(() -> Extensions.drive(true)).start();

* @param block true if it should use the current thread */ public static native void drive(boolean block); diff --git a/dist/java/src/mp/code/Workspace.java b/dist/java/src/mp/code/Workspace.java index 10ae3b1..da9cce7 100644 --- a/dist/java/src/mp/code/Workspace.java +++ b/dist/java/src/mp/code/Workspace.java @@ -196,6 +196,8 @@ public final class Workspace { /** * Registers a callback to be invoked whenever a new {@link Event} is ready to be received. * This will not work unless a Java thread has been dedicated to the event loop. + * @param cb a {@link Consumer} that receives the controller when the change occurs; + * you should probably spawn a new thread in here, to avoid deadlocking * @see Extensions#drive(boolean) */ public void callback(Consumer cb) { diff --git a/dist/java/src/mp/code/data/TextChange.java b/dist/java/src/mp/code/data/TextChange.java index 3c0a0f9..5d13ea9 100644 --- a/dist/java/src/mp/code/data/TextChange.java +++ b/dist/java/src/mp/code/data/TextChange.java @@ -3,9 +3,6 @@ package mp.code.data; import lombok.EqualsAndHashCode; import lombok.RequiredArgsConstructor; import lombok.ToString; -import mp.code.Extensions; - -import java.util.OptionalLong; /** * A data class holding information about a text change.