* new log string
*/
void subJobErrorLogChanged(TaskI<T> source, JobI job, String log);
+
+ @SuppressWarnings("rawtypes")
+ static final TaskEventListener NULL_LISTENER = new TaskEventListener()
+ {
+ @Override
+ public void taskStarted(TaskI source, List subJobs)
+ {
+ }
+
+ @Override
+ public void taskStatusChanged(TaskI source, JobStatus status)
+ {
+ }
+
+ @Override
+ public void taskCompleted(TaskI source, Object result)
+ {
+ }
+
+ @Override
+ public void taskException(TaskI source, Exception e)
+ {
+ }
+
+ @Override
+ public void taskRestarted(TaskI source)
+ {
+ }
+
+ @Override
+ public void subJobStatusChanged(TaskI source, JobI job,
+ JobStatus status)
+ {
+ }
+
+ @Override
+ public void subJobLogChanged(TaskI source, JobI job, String log)
+ {
+ }
+
+ @Override
+ public void subJobErrorLogChanged(TaskI source, JobI job, String log)
+ {
+ }
+ };
+
+ @SuppressWarnings("unchecked")
+ static <T> TaskEventListener<T> nullListener()
+ {
+ return (TaskEventListener<T>) NULL_LISTENER;
+ }
}
import javax.swing.ToolTipManager;
import javax.swing.border.EmptyBorder;
+import jalview.bin.Console;
import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.gui.JvSwingUtils;
import jalview.ws2.actions.alignment.AlignmentAction;
import jalview.ws2.actions.annotation.AnnotationAction;
import jalview.ws2.actions.api.ActionI;
+import jalview.ws2.actions.api.TaskEventListener;
import jalview.ws2.actions.api.TaskI;
import jalview.ws2.api.Credentials;
import jalview.ws2.api.WebService;
var handler = new AnnotationServiceGuiHandler(_action, frame);
return _action.perform(viewport, args, credentials, handler);
}
- throw new IllegalArgumentException(
- String.format("Illegal action type %s", action.getClass().getName()));
+ Console.warn(String.format(
+ "No known handler for action type %s. All output will be discarded.",
+ action.getClass().getName()));
+ return action.perform(viewport, args, credentials,
+ TaskEventListener.nullListener());
}
private static CompletionStage<List<ArgumentI>> openEditParamsDialog(