use of org.eclipse.scout.rt.ui.html.json.JsonEvent in project scout.rt by eclipse.
the class JsonBrowserFieldTest method testExternalWindowState.
@Test
public void testExternalWindowState() throws JSONException {
boolean windowState = true;
Map<String, String> map = new HashMap<>();
map.put("windowState", Boolean.toString(windowState));
m_browserField.handleUiEvent(new JsonEvent("xyz", "externalWindowStateChange", new JSONObject(map)));
Assert.assertNotNull(m_lastExternalWindowState);
Assert.assertEquals(true, m_lastExternalWindowState);
}
use of org.eclipse.scout.rt.ui.html.json.JsonEvent in project scout.rt by eclipse.
the class JsonTableTest method createJsonColumnMovedEvent.
public static JsonEvent createJsonColumnMovedEvent(String columnId, int index) throws JSONException {
// never used
String tableId = "x";
JSONObject data = new JSONObject();
data.put(JsonTable.PROP_COLUMN_ID, columnId);
data.put("index", index);
return new JsonEvent(tableId, JsonTable.EVENT_COLUMN_MOVED, data);
}
use of org.eclipse.scout.rt.ui.html.json.JsonEvent in project scout.rt by eclipse.
the class JsonFormTableControlTest method createJsonSelectedEvent.
public static JsonEvent createJsonSelectedEvent(String adapterId, boolean selected) throws JSONException {
JSONObject data = new JSONObject();
data.put("selected", selected);
return new JsonEvent(adapterId, "property", data);
}
use of org.eclipse.scout.rt.ui.html.json.JsonEvent in project scout.rt by eclipse.
the class JsonTestUtility method extractEventsFromResponse.
/**
* @param eventType
* Optional. If set only events with the given type will be returned.
* @param adapterId
* Optional. If set only events for the given id will be returned.
*/
public static List<JsonEvent> extractEventsFromResponse(JsonResponse response, String eventType, String adapterId) throws JSONException {
response.fireProcessBufferedEvents();
List<JsonEvent> list = new ArrayList<>();
for (JsonEvent event : response.getEventList()) {
if ((eventType == null || event.getType().equals(eventType)) && (adapterId == null || event.getTarget().equals(adapterId))) {
list.add(event);
}
}
return list;
}
use of org.eclipse.scout.rt.ui.html.json.JsonEvent in project scout.rt by eclipse.
the class JsonTreeTest method createJsonExpansionEvent.
public static JsonEvent createJsonExpansionEvent(String nodeId, boolean expanded) throws JSONException {
JSONObject data = new JSONObject();
data.put(JsonTree.PROP_NODE_ID, nodeId);
data.put("expanded", expanded);
data.put("expandedLazy", false);
return new JsonEvent("", JsonTree.EVENT_NODE_EXPANDED, data);
}
Aggregations