mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-21 23:04:49 +01:00
docs: added missing javadocs
This commit is contained in:
parent
b452cb822f
commit
2e583028a6
5 changed files with 12 additions and 7 deletions
3
dist/java/src/mp/code/BufferController.java
vendored
3
dist/java/src/mp/code/BufferController.java
vendored
|
@ -70,6 +70,7 @@ public final class BufferController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to send a {@link TextChange} update.
|
* Tries to send a {@link TextChange} update.
|
||||||
|
* @param change the update to send
|
||||||
* @throws ControllerException if the controller was stopped
|
* @throws ControllerException if the controller was stopped
|
||||||
*/
|
*/
|
||||||
public void send(TextChange change) throws ControllerException {
|
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.
|
* 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.
|
* 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)
|
* @see Extensions#drive(boolean)
|
||||||
*/
|
*/
|
||||||
public void callback(Consumer<BufferController> cb) {
|
public void callback(Consumer<BufferController> cb) {
|
||||||
|
|
9
dist/java/src/mp/code/CursorController.java
vendored
9
dist/java/src/mp/code/CursorController.java
vendored
|
@ -43,14 +43,15 @@ public final class CursorController {
|
||||||
return recv(this.ptr);
|
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.
|
* Tries to send a {@link Selection} update.
|
||||||
|
* @param selection the update to send
|
||||||
* @throws ControllerException if the controller was stopped
|
* @throws ControllerException if the controller was stopped
|
||||||
*/
|
*/
|
||||||
public void send(Selection cursor) throws ControllerException {
|
public void send(Selection selection) throws ControllerException {
|
||||||
send(this.ptr, cursor);
|
send(this.ptr, selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static native void callback(long self, Consumer<CursorController> cb);
|
private static native void callback(long self, Consumer<CursorController> cb);
|
||||||
|
@ -58,6 +59,8 @@ public final class CursorController {
|
||||||
/**
|
/**
|
||||||
* Registers a callback to be invoked whenever a {@link Cursor} update occurs.
|
* 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.
|
* 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)
|
* @see Extensions#drive(boolean)
|
||||||
*/
|
*/
|
||||||
public void callback(Consumer<CursorController> cb) {
|
public void callback(Consumer<CursorController> cb) {
|
||||||
|
|
2
dist/java/src/mp/code/Extensions.java
vendored
2
dist/java/src/mp/code/Extensions.java
vendored
|
@ -33,7 +33,7 @@ public final class Extensions {
|
||||||
* <p>
|
* <p>
|
||||||
* You may alternatively call this with true, in a separate and dedicated Java thread;
|
* 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:
|
* it will remain active in the background and act as event loop. Assign it like this:
|
||||||
* <p><code>new Thread(() -> Extensions.drive(true)).start();</code></p>
|
* <p><code>new Thread(() -> Extensions.drive(true)).start();</code></p>
|
||||||
* @param block true if it should use the current thread
|
* @param block true if it should use the current thread
|
||||||
*/
|
*/
|
||||||
public static native void drive(boolean block);
|
public static native void drive(boolean block);
|
||||||
|
|
2
dist/java/src/mp/code/Workspace.java
vendored
2
dist/java/src/mp/code/Workspace.java
vendored
|
@ -196,6 +196,8 @@ public final class Workspace {
|
||||||
/**
|
/**
|
||||||
* Registers a callback to be invoked whenever a new {@link Event} is ready to be received.
|
* 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.
|
* 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)
|
* @see Extensions#drive(boolean)
|
||||||
*/
|
*/
|
||||||
public void callback(Consumer<Workspace> cb) {
|
public void callback(Consumer<Workspace> cb) {
|
||||||
|
|
3
dist/java/src/mp/code/data/TextChange.java
vendored
3
dist/java/src/mp/code/data/TextChange.java
vendored
|
@ -3,9 +3,6 @@ package mp.code.data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import mp.code.Extensions;
|
|
||||||
|
|
||||||
import java.util.OptionalLong;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A data class holding information about a text change.
|
* A data class holding information about a text change.
|
||||||
|
|
Loading…
Reference in a new issue