- public IEventCommand eventCommand(SWTDocument document, JSONObject object, W widget, String command) {
- return null;
+ public IEventCommand eventCommand(SWTDocument document, JSONObject object, W widget, ICommand command, CommandContext context) {
+ return null;
+ }
+
+ public static CommandContext sendEvent(SWTDocument document, WidgetData wd, String event, Object target, CommandContextMutable context) {
+ Collection<ICommand> commands = JSONObjectUtils.getCommands(wd.object);
+
+ if(context == null) context = new CommandContextImpl();
+ context.putValue("event", event);
+
+ List<Pair<WidgetData, ICommand>> data = SWTViews.getTriggeredCommands(document, commands, "eventOut");
+
+ return document.handleCommands(data, context, wd.widget);