-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create an internal Event type for use in non-browsers
- Loading branch information
Showing
33 changed files
with
192 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
web/client-api/src/main/java/io/deephaven/web/client/api/EventFn.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
web/client-api/src/main/java/io/deephaven/web/client/api/event/Event.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.web.client.api.event; | ||
|
||
import com.vertispan.tsdefs.annotations.TsInterface; | ||
import com.vertispan.tsdefs.annotations.TsName; | ||
import jsinterop.annotations.JsNullable; | ||
import jsinterop.annotations.JsProperty; | ||
|
||
/** | ||
* Similar to the browser {@code CustomEvent} type, this class holds only the type of the event, and optionally some | ||
* details about the event. | ||
* | ||
* @param <T> the type of the event detail | ||
*/ | ||
@TsInterface | ||
@TsName(namespace = "dh") | ||
public class Event<T> { | ||
private final String type; | ||
private final T detail; | ||
|
||
public Event(String type, T detail) { | ||
this.type = type; | ||
this.detail = detail; | ||
} | ||
|
||
@JsProperty | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
@JsProperty | ||
@JsNullable | ||
public T getDetail() { | ||
return detail; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
web/client-api/src/main/java/io/deephaven/web/client/api/event/EventFn.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.web.client.api.event; | ||
|
||
import jsinterop.annotations.JsFunction; | ||
|
||
/** | ||
* Event handler function. In JS/TS, this will only show up as a function type when used, but these docs will never be | ||
* visible. | ||
*/ | ||
@JsFunction | ||
public interface EventFn<T> { | ||
void onEvent(Event<T> e); | ||
} |
Oops, something went wrong.