(RemoteEditor editor)
| 29 | public int lastCh; |
| 30 | |
| 31 | public EditorUtils(RemoteEditor editor) { |
| 32 | this.editor = editor; |
| 33 | editor.getServer() |
| 34 | .addHandlerLast((s, ws, a, p) -> { |
| 35 | |
| 36 | if (!a.startsWith(prefix)) return p; |
| 37 | |
| 38 | Consumer<JSONObject> c = messageTable.remove(a); |
| 39 | if (c == null) Log.log("editorUtils.error", ()->"no handler for message :" + a +" "+p); |
| 40 | else { |
| 41 | c.accept((JSONObject) p); |
| 42 | } |
| 43 | return p; |
| 44 | }); |
| 45 | } |
| 46 | |
| 47 | public JSONObject sendAndRespond(String message) { |
| 48 |
nothing calls this directly
no test coverage detected