diff --git a/stroom-app-gwt/src/main/java/stroom/app/client/App.java b/stroom-app-gwt/src/main/java/stroom/app/client/App.java index 38103caa357..e25de6c0bbd 100644 --- a/stroom-app-gwt/src/main/java/stroom/app/client/App.java +++ b/stroom-app-gwt/src/main/java/stroom/app/client/App.java @@ -17,7 +17,7 @@ package stroom.app.client; import stroom.app.client.gin.AppGinjectorUser; -import stroom.dispatch.client.QuietTaskListener; +import stroom.dispatch.client.QuietTaskMonitorFactory; import stroom.preferences.client.UserPreferencesManager; import com.google.gwt.core.client.EntryPoint; @@ -86,7 +86,7 @@ public void onModuleLoad() { // Remember how places were used in case we want to use URLs and history // at some point. // ginjector.getPlaceManager().revealCurrentPlace(); - }, new QuietTaskListener()); + }, new QuietTaskMonitorFactory()); } } diff --git a/stroom-app-gwt/src/main/java/stroom/app/client/gin/AppModule.java b/stroom-app-gwt/src/main/java/stroom/app/client/gin/AppModule.java index cea19828d64..0ad53268d81 100644 --- a/stroom-app-gwt/src/main/java/stroom/app/client/gin/AppModule.java +++ b/stroom-app-gwt/src/main/java/stroom/app/client/gin/AppModule.java @@ -76,6 +76,7 @@ import stroom.iframe.client.presenter.IFramePresenter.IFrameView; import stroom.iframe.client.view.IFrameContentViewImpl; import stroom.iframe.client.view.IFrameViewImpl; +import stroom.main.client.presenter.GlobalKeyHandlerImpl; import stroom.main.client.presenter.MainPresenter; import stroom.main.client.presenter.MainPresenter.MainProxy; import stroom.main.client.presenter.MainPresenter.MainView; @@ -90,6 +91,7 @@ import stroom.widget.tooltip.client.presenter.TooltipPresenter; import stroom.widget.tooltip.client.presenter.TooltipPresenter.TooltipView; import stroom.widget.tooltip.client.view.TooltipViewImpl; +import stroom.widget.util.client.GlobalKeyHandler; import com.google.inject.Singleton; import com.google.web.bindery.event.shared.EventBus; @@ -111,6 +113,7 @@ protected void configure() { bind(TokenFormatter.class).to(ParameterTokenFormatter.class).in(Singleton.class); bind(RootPresenter.class).asEagerSingleton(); bind(PlaceManager.class).to(InactivePlaceManager.class).in(Singleton.class); + bind(GlobalKeyHandler.class).to(GlobalKeyHandlerImpl.class).in(Singleton.class); // bind(PlaceManager.class).to(AppPlaceManager.class).in(Singleton.class); // install(new DefaultModule(AppPlaceManager.class)); diff --git a/stroom-app/src/main/resources/ui/noauth/swagger/stroom.json b/stroom-app/src/main/resources/ui/noauth/swagger/stroom.json index b330f5f48c8..77e3ecab7ae 100644 --- a/stroom-app/src/main/resources/ui/noauth/swagger/stroom.json +++ b/stroom-app/src/main/resources/ui/noauth/swagger/stroom.json @@ -12145,6 +12145,10 @@ "type" : "integer", "format" : "int64" }, + "hashAlgorithm" : { + "type" : "string", + "enum" : [ "SHA3_256", "SHA2_256", "BCRYPT", "ARGON_2" ] + }, "name" : { "type" : "string" }, @@ -15097,6 +15101,10 @@ "type" : "integer", "format" : "int64" }, + "hashAlgorithm" : { + "type" : "string", + "enum" : [ "SHA3_256", "SHA2_256", "BCRYPT", "ARGON_2" ] + }, "id" : { "type" : "integer", "format" : "int32" @@ -20628,6 +20636,10 @@ "authErrorMessage" : { "type" : "string" }, + "defaultApiKeyHashAlgorithm" : { + "type" : "string", + "enum" : [ "SHA3_256", "SHA2_256", "BCRYPT", "ARGON_2" ] + }, "defaultMaxResults" : { "type" : "string" }, diff --git a/stroom-app/src/main/resources/ui/noauth/swagger/stroom.yaml b/stroom-app/src/main/resources/ui/noauth/swagger/stroom.yaml index e0974102614..fc8c93fe368 100644 --- a/stroom-app/src/main/resources/ui/noauth/swagger/stroom.yaml +++ b/stroom-app/src/main/resources/ui/noauth/swagger/stroom.yaml @@ -8472,6 +8472,13 @@ components: expireTimeMs: type: integer format: int64 + hashAlgorithm: + type: string + enum: + - SHA3_256 + - SHA2_256 + - BCRYPT + - ARGON_2 name: type: string owner: @@ -11438,6 +11445,13 @@ components: expireTimeMs: type: integer format: int64 + hashAlgorithm: + type: string + enum: + - SHA3_256 + - SHA2_256 + - BCRYPT + - ARGON_2 id: type: integer format: int32 @@ -16036,6 +16050,13 @@ components: $ref: '#/components/schemas/AnalyticUiDefaultConfig' authErrorMessage: type: string + defaultApiKeyHashAlgorithm: + type: string + enum: + - SHA3_256 + - SHA2_256 + - BCRYPT + - ARGON_2 defaultMaxResults: type: string helpSubPathDocumentation: diff --git a/stroom-core-client-widget/src/main/java/com/gwtplatform/mvp/client/MyPresenter.java b/stroom-core-client-widget/src/main/java/com/gwtplatform/mvp/client/MyPresenter.java index 7467be7485f..1d011217b7b 100644 --- a/stroom-core-client-widget/src/main/java/com/gwtplatform/mvp/client/MyPresenter.java +++ b/stroom-core-client-widget/src/main/java/com/gwtplatform/mvp/client/MyPresenter.java @@ -16,10 +16,10 @@ package com.gwtplatform.mvp.client; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.user.client.ui.RequiresResize; @@ -31,9 +31,9 @@ public abstract class MyPresenter> extends Presenter - implements Layer, TaskHandlerFactory, HasTaskHandlerFactory { + implements Layer, TaskMonitorFactory, HasTaskMonitorFactory { - private TaskHandlerFactory taskHandlerFactory = new DefaultTaskListener(this); + private TaskMonitorFactory taskMonitorFactory = new DefaultTaskMonitorFactory(this); private boolean firstReveal = true; public MyPresenter(final EventBus eventBus, final T_VIEW view, final T_PROXY proxy) { @@ -90,12 +90,12 @@ protected final void addRegisteredHandlerToSource(final } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } @Override - public TaskHandler createTaskHandler() { - return taskHandlerFactory.createTaskHandler(); + public TaskMonitor createTaskMonitor() { + return taskMonitorFactory.createTaskMonitor(); } } diff --git a/stroom-core-client-widget/src/main/java/com/gwtplatform/mvp/client/MyPresenterWidget.java b/stroom-core-client-widget/src/main/java/com/gwtplatform/mvp/client/MyPresenterWidget.java index 136ffbf935a..7c7e54fd52c 100644 --- a/stroom-core-client-widget/src/main/java/com/gwtplatform/mvp/client/MyPresenterWidget.java +++ b/stroom-core-client-widget/src/main/java/com/gwtplatform/mvp/client/MyPresenterWidget.java @@ -16,10 +16,10 @@ package com.gwtplatform.mvp.client; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.user.client.ui.RequiresResize; import com.google.web.bindery.event.shared.Event.Type; @@ -28,9 +28,9 @@ public class MyPresenterWidget extends PresenterWidget - implements Layer, TaskHandlerFactory, HasTaskHandlerFactory { + implements Layer, TaskMonitorFactory, HasTaskMonitorFactory { - private TaskHandlerFactory taskHandlerFactory = new DefaultTaskListener(this); + private TaskMonitorFactory taskMonitorFactory = new DefaultTaskMonitorFactory(this); public MyPresenterWidget(final EventBus eventBus, final V view) { super(eventBus, view); @@ -64,12 +64,12 @@ protected final HandlerRegistration addHandlerToSource(final Type type, f } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } @Override - public TaskHandler createTaskHandler() { - return taskHandlerFactory.createTaskHandler(); + public TaskMonitor createTaskMonitor() { + return taskMonitorFactory.createTaskMonitor(); } } diff --git a/stroom-core-client-widget/src/main/java/stroom/data/grid/client/DataGridSelectionEventManager.java b/stroom-core-client-widget/src/main/java/stroom/data/grid/client/DataGridSelectionEventManager.java index 3d492d1fd6f..5af74d7d7fb 100644 --- a/stroom-core-client-widget/src/main/java/stroom/data/grid/client/DataGridSelectionEventManager.java +++ b/stroom-core-client-widget/src/main/java/stroom/data/grid/client/DataGridSelectionEventManager.java @@ -3,7 +3,7 @@ import stroom.data.client.event.SelectAllEvent; import stroom.hyperlink.client.Hyperlink; import stroom.hyperlink.client.HyperlinkEvent; -import stroom.task.client.DefaultTaskListener; +import stroom.task.client.DefaultTaskMonitorFactory; import stroom.util.shared.GwtNullSafe; import stroom.widget.util.client.AbstractSelectionEventManager; import stroom.widget.util.client.DoubleSelectTester; @@ -93,7 +93,7 @@ protected void onMouseDown(final CellPreviewEvent event) { if (hyperlink != null) { consumed = true; // TODO : Don't use the default task listener here. - HyperlinkEvent.fire(dataGrid, hyperlink, new DefaultTaskListener(this)); + HyperlinkEvent.fire(dataGrid, hyperlink, new DefaultTaskMonitorFactory(this)); } } } diff --git a/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerView.java b/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerView.java index 7c9ce230537..7fb275eb493 100644 --- a/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerView.java +++ b/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerView.java @@ -18,14 +18,14 @@ import stroom.data.pager.client.RefreshButton; import stroom.svg.client.Preset; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.button.client.ButtonView; import stroom.widget.button.client.ToggleButtonView; import com.google.gwt.user.cellview.client.AbstractHasData; import com.gwtplatform.mvp.client.View; -public interface PagerView extends View, TaskHandlerFactory { +public interface PagerView extends View, TaskMonitorFactory { ButtonView addButton(Preset preset); diff --git a/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewImpl.java b/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewImpl.java index 972bcfb46df..5a6d7d335ff 100644 --- a/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewImpl.java +++ b/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewImpl.java @@ -20,7 +20,7 @@ import stroom.data.pager.client.RefreshButton; import stroom.svg.client.Preset; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.button.client.ButtonPanel; import stroom.widget.button.client.ButtonView; import stroom.widget.button.client.ToggleButtonView; @@ -95,8 +95,8 @@ public void setPagerVisible(final boolean visible) { } @Override - public TaskHandler createTaskHandler() { - return new TaskHandler() { + public TaskMonitor createTaskMonitor() { + return new TaskMonitor() { @Override public void onStart(final Task task) { taskCount++; diff --git a/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewWithHeading.java b/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewWithHeading.java index 890d2402117..ae763ebf2af 100644 --- a/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewWithHeading.java +++ b/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewWithHeading.java @@ -18,14 +18,15 @@ import stroom.data.pager.client.RefreshButton; import stroom.svg.client.Preset; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.button.client.ButtonView; import stroom.widget.button.client.ToggleButtonView; import com.google.gwt.user.cellview.client.AbstractHasData; import com.gwtplatform.mvp.client.View; -public interface PagerViewWithHeading extends View, TaskHandlerFactory { +public interface PagerViewWithHeading extends View, TaskMonitorFactory { + /** * Set a form group label for the pager view. If not set it won't take up any * space diff --git a/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewWithHeadingImpl.java b/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewWithHeadingImpl.java index 911c34ab1eb..77730b1250e 100644 --- a/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewWithHeadingImpl.java +++ b/stroom-core-client-widget/src/main/java/stroom/data/grid/client/PagerViewWithHeadingImpl.java @@ -20,7 +20,7 @@ import stroom.data.pager.client.RefreshButton; import stroom.svg.client.Preset; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.button.client.ButtonPanel; import stroom.widget.button.client.ButtonView; import stroom.widget.button.client.ToggleButtonView; @@ -109,8 +109,8 @@ public void setPagerVisible(final boolean visible) { } @Override - public TaskHandler createTaskHandler() { - return new TaskHandler() { + public TaskMonitor createTaskMonitor() { + return new TaskMonitor() { @Override public void onStart(final Task task) { taskCount++; diff --git a/stroom-core-client-widget/src/main/java/stroom/data/pager/client/RefreshButton.java b/stroom-core-client-widget/src/main/java/stroom/data/pager/client/RefreshButton.java index 1941b85141a..81ddc57056f 100644 --- a/stroom-core-client-widget/src/main/java/stroom/data/pager/client/RefreshButton.java +++ b/stroom-core-client-widget/src/main/java/stroom/data/pager/client/RefreshButton.java @@ -2,8 +2,8 @@ import stroom.svg.shared.SvgImage; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.button.client.SvgButton; import com.google.gwt.core.client.GWT; @@ -16,7 +16,7 @@ public class RefreshButton extends Composite - implements TaskHandlerFactory { + implements TaskMonitorFactory { private final SvgButton button; private int taskCount; @@ -81,20 +81,16 @@ public void setAllowPause(final boolean allowPause) { } else { button.removeStyleName("allowPause"); } - update(); } public void setPaused(final boolean paused) { this.paused = paused; if (paused) { - button.setTitle("Resume Update"); button.addStyleName("paused"); } else { - button.setTitle("Pause Update"); button.removeStyleName("paused"); } - update(); } @@ -107,8 +103,8 @@ public HandlerRegistration addClickHandler(ClickHandler handler) { } @Override - public TaskHandler createTaskHandler() { - return new TaskHandler() { + public TaskMonitor createTaskMonitor() { + return new TaskMonitor() { @Override public void onStart(final Task task) { taskCount++; @@ -143,6 +139,16 @@ public void updateRefreshState() { private void update() { if (allowPause) { setEnabled(paused || refreshing || taskCount > 0); + + if (paused) { + button.setTitle("Resume Update"); + } else if (refreshing || taskCount > 0) { + button.setTitle("Pause Update"); + } else { + button.setTitle("Not Updating"); + } + } else { + button.setTitle("Refresh"); } } } diff --git a/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/AbstractEditorPresenter.java b/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/AbstractEditorPresenter.java index 9c14b174741..d731fe1f52d 100644 --- a/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/AbstractEditorPresenter.java +++ b/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/AbstractEditorPresenter.java @@ -1,6 +1,7 @@ package stroom.editor.client.presenter; import stroom.util.shared.GwtNullSafe; +import stroom.widget.util.client.GlobalKeyHandler; import com.google.gwt.core.client.Scheduler; import com.google.gwt.event.logical.shared.HasValueChangeHandlers; @@ -25,7 +26,8 @@ public abstract class AbstractEditorPresenter AbstractEditorPresenter(final EventBus eventBus, final V view, final DelegatingAceCompleter delegatingAceCompleter, - final CurrentPreferences currentPreferences) { + final CurrentPreferences currentPreferences, + final GlobalKeyHandler globalKeyHandler) { super(eventBus, view); this.delegatingAceCompleter = delegatingAceCompleter; @@ -35,11 +37,8 @@ public abstract class AbstractEditorPresenter // registerHandler(view.addMouseDownHandler(event -> contextMenu.hide())); - registerHandler(view.addKeyDownHandler(event -> { - if (event.isAltKeyDown() || event.isControlKeyDown()) { - eventBus.fireEvent(event); - } - })); + registerHandler(view.addKeyDownHandler(globalKeyHandler::onKeyDown)); + registerHandler(view.addKeyUpHandler(globalKeyHandler::onKeyUp)); registerHandler(eventBus.addHandler( ChangeCurrentPreferencesEvent.getType(), this::handlePreferencesChange)); diff --git a/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/BaseEditorView.java b/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/BaseEditorView.java index ad9a1df2102..0b7a8d43c13 100644 --- a/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/BaseEditorView.java +++ b/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/BaseEditorView.java @@ -1,6 +1,7 @@ package stroom.editor.client.presenter; import com.google.gwt.event.dom.client.HasKeyDownHandlers; +import com.google.gwt.event.dom.client.HasKeyUpHandlers; import com.google.gwt.event.logical.shared.HasValueChangeHandlers; import com.google.gwt.user.client.ui.Focus; import com.google.gwt.user.client.ui.HasText; @@ -10,7 +11,7 @@ import edu.ycp.cs.dh.acegwt.client.ace.AceEditorTheme; public interface BaseEditorView - extends View, Focus, HasKeyDownHandlers, HasText, + extends View, Focus, HasKeyDownHandlers, HasKeyUpHandlers, HasText, HasValueChangeHandlers, RequiresResize { String getEditorId(); diff --git a/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/EditorPresenter.java b/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/EditorPresenter.java index d9bf30bd9f8..2cc5f51a926 100644 --- a/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/EditorPresenter.java +++ b/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/EditorPresenter.java @@ -23,6 +23,7 @@ import stroom.editor.client.view.IndicatorLines; import stroom.editor.client.view.Marker; import stroom.util.shared.TextRange; +import stroom.widget.util.client.GlobalKeyHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.inject.Inject; @@ -42,8 +43,9 @@ public EditorPresenter(final EventBus eventBus, final EditorView view, final EditorMenuPresenter contextMenu, final DelegatingAceCompleter delegatingAceCompleter, - final CurrentPreferences currentPreferences) { - super(eventBus, view, delegatingAceCompleter, currentPreferences); + final CurrentPreferences currentPreferences, + final GlobalKeyHandler globalKeyHandler) { + super(eventBus, view, delegatingAceCompleter, currentPreferences, globalKeyHandler); this.contextMenu = contextMenu; registerHandler(view.addContextMenuHandler(event -> diff --git a/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/SingleLineEditorPresenter.java b/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/SingleLineEditorPresenter.java index 7953c000414..018fc40c160 100644 --- a/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/SingleLineEditorPresenter.java +++ b/stroom-core-client-widget/src/main/java/stroom/editor/client/presenter/SingleLineEditorPresenter.java @@ -16,6 +16,8 @@ package stroom.editor.client.presenter; +import stroom.widget.util.client.GlobalKeyHandler; + import com.google.inject.Inject; import com.google.web.bindery.event.shared.EventBus; @@ -30,8 +32,9 @@ public class SingleLineEditorPresenter public SingleLineEditorPresenter(final EventBus eventBus, final SingleLineEditorView view, final DelegatingAceCompleter delegatingAceCompleter, - final CurrentPreferences currentPreferences) { - super(eventBus, view, delegatingAceCompleter, currentPreferences); + final CurrentPreferences currentPreferences, + final GlobalKeyHandler globalKeyHandler) { + super(eventBus, view, delegatingAceCompleter, currentPreferences, globalKeyHandler); } @Override diff --git a/stroom-core-client-widget/src/main/java/stroom/editor/client/view/AbstractEditorViewImpl.java b/stroom-core-client-widget/src/main/java/stroom/editor/client/view/AbstractEditorViewImpl.java index 7c1a2671ebe..7ec5efb939e 100644 --- a/stroom-core-client-widget/src/main/java/stroom/editor/client/view/AbstractEditorViewImpl.java +++ b/stroom-core-client-widget/src/main/java/stroom/editor/client/view/AbstractEditorViewImpl.java @@ -6,6 +6,8 @@ import com.google.gwt.event.dom.client.KeyDownEvent; import com.google.gwt.event.dom.client.KeyDownHandler; +import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.event.dom.client.MouseDownEvent; import com.google.gwt.event.dom.client.MouseDownHandler; import com.google.gwt.event.logical.shared.ValueChangeHandler; @@ -183,6 +185,10 @@ public HandlerRegistration addKeyDownHandler(final KeyDownHandler handler) { return getContentPanel().addDomHandler(handler, KeyDownEvent.getType()); } + public HandlerRegistration addKeyUpHandler(final KeyUpHandler handler) { + return getContentPanel().addDomHandler(handler, KeyUpEvent.getType()); + } + public HandlerRegistration addValueChangeHandler(final ValueChangeHandler handler) { return editor.addValueChangeHandler(handler); } diff --git a/stroom-core-client-widget/src/main/java/stroom/hyperlink/client/HyperlinkEvent.java b/stroom-core-client-widget/src/main/java/stroom/hyperlink/client/HyperlinkEvent.java index 7fa8cf5dbff..64bee6a742a 100644 --- a/stroom-core-client-widget/src/main/java/stroom/hyperlink/client/HyperlinkEvent.java +++ b/stroom-core-client-widget/src/main/java/stroom/hyperlink/client/HyperlinkEvent.java @@ -16,7 +16,7 @@ package stroom.hyperlink.client; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.GwtEvent; @@ -26,18 +26,18 @@ public class HyperlinkEvent extends GwtEvent { private static Type TYPE; private final Hyperlink hyperlink; - private final TaskHandlerFactory taskHandlerFactory; + private final TaskMonitorFactory taskMonitorFactory; private HyperlinkEvent(final Hyperlink hyperlink, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { this.hyperlink = hyperlink; - this.taskHandlerFactory = taskHandlerFactory; + this.taskMonitorFactory = taskMonitorFactory; } public static void fire(final HasHandlers handlers, final Hyperlink hyperlink, - final TaskHandlerFactory taskHandlerFactory) { - handlers.fireEvent(new HyperlinkEvent(hyperlink, taskHandlerFactory)); + final TaskMonitorFactory taskMonitorFactory) { + handlers.fireEvent(new HyperlinkEvent(hyperlink, taskMonitorFactory)); } public static Type getType() { @@ -61,8 +61,8 @@ public Hyperlink getHyperlink() { return hyperlink; } - public TaskHandlerFactory getTaskHandlerFactory() { - return taskHandlerFactory; + public TaskMonitorFactory getTaskMonitorFactory() { + return taskMonitorFactory; } public interface Handler extends EventHandler { diff --git a/stroom-core-client-widget/src/main/java/stroom/task/client/DefaultTaskListener.java b/stroom-core-client-widget/src/main/java/stroom/task/client/DefaultTaskMonitorFactory.java similarity index 72% rename from stroom-core-client-widget/src/main/java/stroom/task/client/DefaultTaskListener.java rename to stroom-core-client-widget/src/main/java/stroom/task/client/DefaultTaskMonitorFactory.java index eb096afdbb6..32bcdfca552 100644 --- a/stroom-core-client-widget/src/main/java/stroom/task/client/DefaultTaskListener.java +++ b/stroom-core-client-widget/src/main/java/stroom/task/client/DefaultTaskMonitorFactory.java @@ -2,17 +2,17 @@ import com.google.gwt.event.shared.HasHandlers; -public class DefaultTaskListener implements TaskHandlerFactory { +public class DefaultTaskMonitorFactory implements TaskMonitorFactory { private final HasHandlers hasHandlers; - public DefaultTaskListener(final HasHandlers hasHandlers) { + public DefaultTaskMonitorFactory(final HasHandlers hasHandlers) { this.hasHandlers = hasHandlers; } @Override - public TaskHandler createTaskHandler() { - return new TaskHandler() { + public TaskMonitor createTaskMonitor() { + return new TaskMonitor() { @Override public void onStart(final Task task) { // Add the task to the map. diff --git a/stroom-core-client-widget/src/main/java/stroom/task/client/HasTaskHandlerFactory.java b/stroom-core-client-widget/src/main/java/stroom/task/client/HasTaskHandlerFactory.java deleted file mode 100644 index 4f7bd67a6b9..00000000000 --- a/stroom-core-client-widget/src/main/java/stroom/task/client/HasTaskHandlerFactory.java +++ /dev/null @@ -1,6 +0,0 @@ -package stroom.task.client; - -public interface HasTaskHandlerFactory { - - void setTaskHandlerFactory(TaskHandlerFactory taskHandlerFactory); -} diff --git a/stroom-core-client-widget/src/main/java/stroom/task/client/HasTaskMonitorFactory.java b/stroom-core-client-widget/src/main/java/stroom/task/client/HasTaskMonitorFactory.java new file mode 100644 index 00000000000..e7f008f81e4 --- /dev/null +++ b/stroom-core-client-widget/src/main/java/stroom/task/client/HasTaskMonitorFactory.java @@ -0,0 +1,6 @@ +package stroom.task.client; + +public interface HasTaskMonitorFactory { + + void setTaskMonitorFactory(TaskMonitorFactory taskMonitorFactory); +} diff --git a/stroom-core-client-widget/src/main/java/stroom/task/client/TaskHandlerFactory.java b/stroom-core-client-widget/src/main/java/stroom/task/client/TaskHandlerFactory.java deleted file mode 100644 index 5b48142e523..00000000000 --- a/stroom-core-client-widget/src/main/java/stroom/task/client/TaskHandlerFactory.java +++ /dev/null @@ -1,6 +0,0 @@ -package stroom.task.client; - -public interface TaskHandlerFactory { - - TaskHandler createTaskHandler(); -} diff --git a/stroom-core-client-widget/src/main/java/stroom/task/client/TaskHandler.java b/stroom-core-client-widget/src/main/java/stroom/task/client/TaskMonitor.java similarity index 74% rename from stroom-core-client-widget/src/main/java/stroom/task/client/TaskHandler.java rename to stroom-core-client-widget/src/main/java/stroom/task/client/TaskMonitor.java index 93f85dc5d48..9d0fef95800 100644 --- a/stroom-core-client-widget/src/main/java/stroom/task/client/TaskHandler.java +++ b/stroom-core-client-widget/src/main/java/stroom/task/client/TaskMonitor.java @@ -1,6 +1,6 @@ package stroom.task.client; -public interface TaskHandler { +public interface TaskMonitor { void onStart(Task task); diff --git a/stroom-core-client-widget/src/main/java/stroom/task/client/TaskMonitorFactory.java b/stroom-core-client-widget/src/main/java/stroom/task/client/TaskMonitorFactory.java new file mode 100644 index 00000000000..440c8f71fc9 --- /dev/null +++ b/stroom-core-client-widget/src/main/java/stroom/task/client/TaskMonitorFactory.java @@ -0,0 +1,6 @@ +package stroom.task.client; + +public interface TaskMonitorFactory { + + TaskMonitor createTaskMonitor(); +} diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/button/client/Button.java b/stroom-core-client-widget/src/main/java/stroom/widget/button/client/Button.java index feca7b34683..07cdca18f6e 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/button/client/Button.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/button/client/Button.java @@ -2,8 +2,8 @@ import stroom.svg.shared.SvgImage; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Document; @@ -14,7 +14,7 @@ import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.ButtonBase; -public class Button extends ButtonBase implements ButtonView, TaskHandlerFactory { +public class Button extends ButtonBase implements ButtonView, TaskMonitorFactory { private final Element rippleContainer; private final Element buttonContent; @@ -176,8 +176,8 @@ public void focus() { } @Override - public TaskHandler createTaskHandler() { - return new TaskHandler() { + public TaskMonitor createTaskMonitor() { + return new TaskMonitor() { @Override public void onStart(final Task task) { taskCount++; diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/menu/client/presenter/MenuPresenter.java b/stroom-core-client-widget/src/main/java/stroom/widget/menu/client/presenter/MenuPresenter.java index 481a14c6ddf..14054b309fd 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/menu/client/presenter/MenuPresenter.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/menu/client/presenter/MenuPresenter.java @@ -18,7 +18,7 @@ import stroom.task.client.SimpleTask; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.menu.client.presenter.MenuPresenter.MenuView; import stroom.widget.popup.client.event.HidePopupEvent; import stroom.widget.popup.client.event.ShowPopupEvent; @@ -168,15 +168,15 @@ public boolean hasParent() { @Override public void execute(final MenuItem menuItem) { if (menuItem != null && menuItem.getCommand() != null) { - final TaskHandler taskHandler = createTaskHandler(); + final TaskMonitor taskMonitor = createTaskMonitor(); final Task task = new SimpleTask("Executing menu item " + menuItem.getText()); - taskHandler.onStart(task); + taskMonitor.onStart(task); Scheduler.get().scheduleDeferred(() -> { try { hideAll(false, false); menuItem.getCommand().execute(); } finally { - taskHandler.onEnd(task); + taskMonitor.onEnd(task); } }); } diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/presenter/PopupManager.java b/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/presenter/PopupManager.java index 4879bacd509..46946e5fb70 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/presenter/PopupManager.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/presenter/PopupManager.java @@ -16,7 +16,7 @@ package stroom.widget.popup.client.presenter; -import stroom.task.client.HasTaskHandlerFactory; +import stroom.task.client.HasTaskMonitorFactory; import stroom.widget.popup.client.event.DialogEvent; import stroom.widget.popup.client.event.DisablePopupEvent; import stroom.widget.popup.client.event.EnablePopupEvent; @@ -60,9 +60,9 @@ private void show(final ShowPopupEvent event) { hide(HidePopupEvent.builder(presenterWidget).autoClose(true).ok(false).build()); } else { - HasTaskHandlerFactory hasTaskListener = null; - if (presenterWidget instanceof HasTaskHandlerFactory) { - hasTaskListener = (HasTaskHandlerFactory) presenterWidget; + HasTaskMonitorFactory hasTaskListener = null; + if (presenterWidget instanceof HasTaskMonitorFactory) { + hasTaskListener = (HasTaskMonitorFactory) presenterWidget; } diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/Dialog.java b/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/Dialog.java index c904dae6289..3cc5a726bfd 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/Dialog.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/Dialog.java @@ -17,8 +17,8 @@ package stroom.widget.popup.client.view; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.spinner.client.SpinnerLarge; import stroom.widget.util.client.MouseUtil; @@ -44,7 +44,7 @@ import com.google.gwt.user.client.ui.Widget; import com.google.web.bindery.event.shared.HandlerRegistration; -public class Dialog extends AbstractPopupPanel implements TaskHandlerFactory { +public class Dialog extends AbstractPopupPanel implements TaskMonitorFactory { private static final Binder binder = GWT.create(Binder.class); private final int clientLeft; @@ -271,8 +271,8 @@ private boolean isCaptionEvent(final NativeEvent event) { } @Override - public TaskHandler createTaskHandler() { - return spinner.createTaskHandler(); + public TaskMonitor createTaskMonitor() { + return spinner.createTaskMonitor(); } public interface Binder extends UiBinder { diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/PopupSupportImpl.java b/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/PopupSupportImpl.java index ff7c02c04d3..d9534406071 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/PopupSupportImpl.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/PopupSupportImpl.java @@ -17,7 +17,7 @@ package stroom.widget.popup.client.view; import stroom.svg.shared.SvgImage; -import stroom.task.client.HasTaskHandlerFactory; +import stroom.task.client.HasTaskMonitorFactory; import stroom.util.shared.GwtNullSafe; import stroom.widget.popup.client.event.HidePopupEvent; import stroom.widget.popup.client.event.HidePopupRequestEvent; @@ -43,7 +43,7 @@ public class PopupSupportImpl implements PopupSupport { private Boolean modal; private View view; - private HasTaskHandlerFactory hasTaskListener; + private HasTaskMonitorFactory hasTaskListener; private HidePopupRequestEvent.Handler hideRequestHandler; private HidePopupEvent.Handler hideHandler; private List autoHidePartners; @@ -51,7 +51,7 @@ public class PopupSupportImpl implements PopupSupport { private DialogActionUiHandlers dialogActionHandler; public PopupSupportImpl(final View view, - final HasTaskHandlerFactory hasTaskListener, + final HasTaskMonitorFactory hasTaskListener, final SvgImage icon, final String caption, final Boolean modal, @@ -181,7 +181,7 @@ private Popup createPopup(final PopupType popupType, } case DIALOG: { final ResizableDialog resizableDialog = new ResizableDialog(dialogActionHandler, popupSize); - hasTaskListener.setTaskHandlerFactory(resizableDialog); + hasTaskListener.setTaskMonitorFactory(resizableDialog); resizableDialog.setContent(view.asWidget()); popup = resizableDialog; @@ -194,7 +194,7 @@ private Popup createPopup(final PopupType popupType, dialogActionHandler = closeContent; final ResizableDialog resizableDialog = new ResizableDialog(closeContent, popupSize); - hasTaskListener.setTaskHandlerFactory(resizableDialog); + hasTaskListener.setTaskMonitorFactory(resizableDialog); resizableDialog.setContent(closeContent); popup = resizableDialog; @@ -207,7 +207,7 @@ private Popup createPopup(final PopupType popupType, dialogButtons = okCancelContent; final ResizableDialog resizableDialog = new ResizableDialog(okCancelContent, popupSize); - hasTaskListener.setTaskHandlerFactory(resizableDialog); + hasTaskListener.setTaskMonitorFactory(resizableDialog); resizableDialog.setContent(okCancelContent); popup = resizableDialog; @@ -221,7 +221,7 @@ private Popup createPopup(final PopupType popupType, dialogButtons = acceptRejectContent; final ResizableDialog resizableDialog = new ResizableDialog(acceptRejectContent, popupSize); - hasTaskListener.setTaskHandlerFactory(resizableDialog); + hasTaskListener.setTaskMonitorFactory(resizableDialog); resizableDialog.setContent(acceptRejectContent); popup = resizableDialog; @@ -247,7 +247,7 @@ private Popup createPopup(final PopupType popupType, dialogButtons = closeContent; final Dialog dialog = new Dialog(closeContent); - hasTaskListener.setTaskHandlerFactory(dialog); + hasTaskListener.setTaskMonitorFactory(dialog); dialog.setContent(closeContent); popup = dialog; @@ -260,7 +260,7 @@ private Popup createPopup(final PopupType popupType, dialogButtons = okCancelContent; final Dialog dialog = new Dialog(okCancelContent); - hasTaskListener.setTaskHandlerFactory(dialog); + hasTaskListener.setTaskMonitorFactory(dialog); dialog.setContent(okCancelContent); popup = dialog; @@ -273,7 +273,7 @@ private Popup createPopup(final PopupType popupType, dialogButtons = acceptRejectContent; final Dialog dialog = new Dialog(acceptRejectContent); - hasTaskListener.setTaskHandlerFactory(dialog); + hasTaskListener.setTaskMonitorFactory(dialog); dialog.setContent(acceptRejectContent); popup = dialog; @@ -296,7 +296,7 @@ private void setView(final View view) { this.view = view; } - private void setHasTaskListener(final HasTaskHandlerFactory hasTaskListener) { + private void setHasTaskListener(final HasTaskMonitorFactory hasTaskListener) { this.hasTaskListener = hasTaskListener; } diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/ResizableDialog.java b/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/ResizableDialog.java index 14d3cad93c2..8e3b8bede62 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/ResizableDialog.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/popup/client/view/ResizableDialog.java @@ -17,8 +17,8 @@ package stroom.widget.popup.client.view; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.popup.client.presenter.PopupSize; import stroom.widget.popup.client.presenter.Size; import stroom.widget.spinner.client.SpinnerLarge; @@ -47,7 +47,7 @@ import com.google.gwt.user.client.ui.Widget; import com.google.web.bindery.event.shared.HandlerRegistration; -public class ResizableDialog extends AbstractPopupPanel implements TaskHandlerFactory { +public class ResizableDialog extends AbstractPopupPanel implements TaskMonitorFactory { private static final Binder binder = GWT.create(Binder.class); @@ -344,8 +344,8 @@ private void setResizeEnabled(final boolean enabled) { } @Override - public TaskHandler createTaskHandler() { - return spinner.createTaskHandler(); + public TaskMonitor createTaskMonitor() { + return spinner.createTaskMonitor(); } private enum DragType { diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/spinner/client/SpinnerLarge.java b/stroom-core-client-widget/src/main/java/stroom/widget/spinner/client/SpinnerLarge.java index bed92363723..d174f94494d 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/spinner/client/SpinnerLarge.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/spinner/client/SpinnerLarge.java @@ -17,8 +17,8 @@ package stroom.widget.spinner.client; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.Scheduler; @@ -27,7 +27,7 @@ import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; -public class SpinnerLarge extends Composite implements TaskHandlerFactory { +public class SpinnerLarge extends Composite implements TaskMonitorFactory { private static final Binder uiBinder = GWT.create(Binder.class); @@ -47,8 +47,8 @@ public void run() { } @Override - public TaskHandler createTaskHandler() { - return new TaskHandler() { + public TaskMonitor createTaskMonitor() { + return new TaskMonitor() { @Override public void onStart(final Task task) { taskCount++; diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/spinner/client/SpinnerSmall.java b/stroom-core-client-widget/src/main/java/stroom/widget/spinner/client/SpinnerSmall.java index 463ce5df706..d51fc914b92 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/spinner/client/SpinnerSmall.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/spinner/client/SpinnerSmall.java @@ -18,15 +18,15 @@ import stroom.svg.shared.SvgImage; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.Widget; -public class SpinnerSmall extends Widget implements TaskHandlerFactory { +public class SpinnerSmall extends Widget implements TaskMonitorFactory { private int taskCount; @@ -53,8 +53,8 @@ public void setRefreshing(boolean refreshing) { } @Override - public TaskHandler createTaskHandler() { - return new TaskHandler() { + public TaskMonitor createTaskMonitor() { + return new TaskMonitor() { @Override public void onStart(final Task task) { taskCount++; diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/tab/client/view/AbstractTab.java b/stroom-core-client-widget/src/main/java/stroom/widget/tab/client/view/AbstractTab.java index 409cb6c868d..d39b699cd5d 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/tab/client/view/AbstractTab.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/tab/client/view/AbstractTab.java @@ -17,13 +17,13 @@ package stroom.widget.tab.client.view; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.dom.client.Element; import com.google.gwt.user.client.ui.Widget; -public abstract class AbstractTab extends Widget implements TaskHandlerFactory { +public abstract class AbstractTab extends Widget implements TaskMonitorFactory { private boolean hidden; @@ -54,8 +54,8 @@ protected void setHover(final boolean hover) { } @Override - public TaskHandler createTaskHandler() { - return new TaskHandler() { + public TaskMonitor createTaskMonitor() { + return new TaskMonitor() { @Override public void onStart(final Task task) { diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/tab/client/view/CurveTab.java b/stroom-core-client-widget/src/main/java/stroom/widget/tab/client/view/CurveTab.java index 9514c57767a..4b6323210f4 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/tab/client/view/CurveTab.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/tab/client/view/CurveTab.java @@ -18,7 +18,7 @@ import stroom.svg.client.IconColour; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.spinner.client.SpinnerSmall; import stroom.widget.util.client.SvgImageUtil; @@ -142,7 +142,7 @@ protected Element getCloseElement() { } @Override - public TaskHandler createTaskHandler() { - return spinnerSmall.createTaskHandler(); + public TaskMonitor createTaskMonitor() { + return spinnerSmall.createTaskMonitor(); } } diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/util/client/GlobalKeyHandler.java b/stroom-core-client-widget/src/main/java/stroom/widget/util/client/GlobalKeyHandler.java new file mode 100644 index 00000000000..119d814c26d --- /dev/null +++ b/stroom-core-client-widget/src/main/java/stroom/widget/util/client/GlobalKeyHandler.java @@ -0,0 +1,11 @@ +package stroom.widget.util.client; + +import com.google.gwt.event.dom.client.KeyDownEvent; +import com.google.gwt.event.dom.client.KeyUpEvent; + +public interface GlobalKeyHandler { + + void onKeyDown(KeyDownEvent event); + + void onKeyUp(KeyUpEvent event); +} diff --git a/stroom-core-client-widget/src/main/java/stroom/widget/util/client/KeyBinding.java b/stroom-core-client-widget/src/main/java/stroom/widget/util/client/KeyBinding.java index 3e8033bf28f..b37de3cae9f 100644 --- a/stroom-core-client-widget/src/main/java/stroom/widget/util/client/KeyBinding.java +++ b/stroom-core-client-widget/src/main/java/stroom/widget/util/client/KeyBinding.java @@ -49,7 +49,7 @@ public class KeyBinding { private static final int CREATE_DOC_FIRST_KEY = KeyCodes.KEY_C; private static final int SUB_TAB_FIRST_KEY = KeyCodes.KEY_T; - private static final int KEY_SEQUENCE_TIMER_DELAY = 1_000; + private static final int KEY_SEQUENCE_TIMER_DELAY = 500; private static final Timer KEY_SEQUENCE_TIMER = new Timer() { @Override public void run() { @@ -204,8 +204,8 @@ public static Action test(final NativeEvent e) { logKey(e); // We don't want to test key binds in text input else we pick up things like the user typing '/' - if (shouldCheckKeySequence(e)) { - if (BrowserEvents.KEYDOWN.equals(e.getType())) { + if (BrowserEvents.KEYDOWN.equals(e.getType())) { + if (shouldCheckKeySequence(e)) { final Shortcut shortcut = getShortcut(e); action = testKeyDownEvent(e, shortcut); if (action == null) { @@ -224,7 +224,9 @@ public static Action test(final NativeEvent e) { // Clear the action as we have executed the command action = null; } - } else if (BrowserEvents.KEYUP.equals(e.getType())) { + } + } else if (BrowserEvents.KEYUP.equals(e.getType())) { + if (shouldCheckKeySequence(e)) { final Shortcut shortcut = getShortcut(e); testKeyUpEvent(e, shortcut); } @@ -233,29 +235,66 @@ public static Action test(final NativeEvent e) { } private static boolean shouldCheckKeySequence(final NativeEvent e) { + if (isInput(e)) { + if (KeyCodes.KEY_SHIFT == e.getKeyCode() || KeyCodes.KEY_ESCAPE == e.getKeyCode()) { + return true; + } + + // Only consider key sequences from inputs if a modifier key is pressed. + if (isModifierKey(e)) { + return true; + } + if (isFunctionKey(e)) { + return true; + } + } else { + return true; + } + return false; + } + + private static boolean isFunctionKey(final NativeEvent e) { + return KeyCodes.KEY_F1 == e.getKeyCode() || + KeyCodes.KEY_F2 == e.getKeyCode() || + KeyCodes.KEY_F3 == e.getKeyCode() || + KeyCodes.KEY_F4 == e.getKeyCode() || + KeyCodes.KEY_F5 == e.getKeyCode() || + KeyCodes.KEY_F6 == e.getKeyCode() || + KeyCodes.KEY_F7 == e.getKeyCode() || + KeyCodes.KEY_F8 == e.getKeyCode() || + KeyCodes.KEY_F9 == e.getKeyCode() || + KeyCodes.KEY_F10 == e.getKeyCode() || + KeyCodes.KEY_F11 == e.getKeyCode() || + KeyCodes.KEY_F12 == e.getKeyCode(); + } + + private static boolean isModifierKey(final NativeEvent e) { + return e.getAltKey() || e.getCtrlKey() || e.getMetaKey(); + } + + private static boolean isInput(final NativeEvent e) { final EventTarget eventTarget = e.getEventTarget(); - final boolean shouldCheck; + final boolean isInput; if (eventTarget != null) { if (Element.is(eventTarget)) { final Element element = Element.as(eventTarget); final String tagName = element.getTagName(); // TODO this is really clunky. Need to create our own textbox and text area // components so that we can control the key events - shouldCheck = !isTextBox(element, tagName) - && !"TEXTAREA".equalsIgnoreCase(tagName); + isInput = isTextBox(element, tagName) + || "TEXTAREA".equalsIgnoreCase(tagName); // final String className = GwtNullSafe.string(element.getClassName()); // final String type = element.getAttribute("type"); // GWT.log("className: " + className + " tagName: " + element.getTagName() // + " type: " + type + " shouldCheck: " + shouldCheck); } else { - shouldCheck = true; + isInput = false; } } else { - shouldCheck = true; + isInput = false; } -// GWT.log("shouldCheck: " + shouldCheck); - return shouldCheck; + return isInput; } private static boolean isTextBox(final Element element, final String tagName) { @@ -345,20 +384,20 @@ private static void clearKeySequenceState() { } private static void logKey(final NativeEvent e) { - final List keys = new ArrayList<>(); - if (e.getShiftKey()) { - keys.add("Shift"); - } - if (e.getCtrlKey()) { - keys.add("Ctrl"); - } - if (e.getAltKey()) { - keys.add("Alt"); - } - if (e.getMetaKey()) { - keys.add("Meta"); - } - keys.add(KeyBinding.keyCodeToString(e.getKeyCode())); +// final List keys = new ArrayList<>(); +// if (e.getShiftKey()) { +// keys.add("Shift"); +// } +// if (e.getCtrlKey()) { +// keys.add("Ctrl"); +// } +// if (e.getAltKey()) { +// keys.add("Alt"); +// } +// if (e.getMetaKey()) { +// keys.add("Meta"); +// } +// keys.add(KeyBinding.keyCodeToString(e.getKeyCode())); // GWT.log(e.getType() // + " (" + e.getKeyCode() + ") - " // + String.join("+", keys) diff --git a/stroom-core-client/src/main/java/stroom/about/client/presenter/AboutPresenter.java b/stroom-core-client/src/main/java/stroom/about/client/presenter/AboutPresenter.java index 8c11d86ba8b..8d47f4c984f 100644 --- a/stroom-core-client/src/main/java/stroom/about/client/presenter/AboutPresenter.java +++ b/stroom-core-client/src/main/java/stroom/about/client/presenter/AboutPresenter.java @@ -71,7 +71,7 @@ private void buildContent() { getView().getNodeName().setText("Node Name: " + sessionInfo.getNodeName()); }) .onFailure(caught -> AlertEvent.fireError(AboutPresenter.this, caught.getMessage(), null)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); clientPropertyCache.get(result -> { diff --git a/stroom-core-client/src/main/java/stroom/activity/client/ActivityEditPresenter.java b/stroom-core-client/src/main/java/stroom/activity/client/ActivityEditPresenter.java index 25816cb6885..9e51169c10e 100644 --- a/stroom-core-client/src/main/java/stroom/activity/client/ActivityEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/activity/client/ActivityEditPresenter.java @@ -214,7 +214,7 @@ protected void write(final Consumer consumer, .method(res -> res.validate(activity)) .onSuccess(result -> afterValidation(result, details, consumer, event)) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -242,7 +242,7 @@ private void afterValidation(final ActivityValidationResult validationResult, update(activity, details, consumer, event); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } else { update(activity, details, consumer, event); @@ -263,7 +263,7 @@ private void update(final Activity activity, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/activity/client/ActivityListPresenter.java b/stroom-core-client/src/main/java/stroom/activity/client/ActivityListPresenter.java index 09629410493..c4c591d589b 100644 --- a/stroom-core-client/src/main/java/stroom/activity/client/ActivityListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/activity/client/ActivityListPresenter.java @@ -109,7 +109,7 @@ protected void exec(final Range range, .method(res -> res.list(name)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } }; diff --git a/stroom-core-client/src/main/java/stroom/activity/client/CurrentActivity.java b/stroom-core-client/src/main/java/stroom/activity/client/CurrentActivity.java index ef29173831a..ad98726a328 100644 --- a/stroom-core-client/src/main/java/stroom/activity/client/CurrentActivity.java +++ b/stroom-core-client/src/main/java/stroom/activity/client/CurrentActivity.java @@ -19,7 +19,7 @@ import stroom.activity.shared.Activity; import stroom.activity.shared.ActivityResource; import stroom.dispatch.client.RestFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.event.shared.GwtEvent; @@ -52,7 +52,7 @@ public CurrentActivity(final EventBus eventBus, this.restFactory = restFactory; } - public void getActivity(final Consumer consumer, final TaskHandlerFactory taskHandlerFactory) { + public void getActivity(final Consumer consumer, final TaskMonitorFactory taskMonitorFactory) { if (fetched) { consumer.accept(currentActivity); } else { @@ -64,12 +64,12 @@ public void getActivity(final Consumer consumer, final TaskHandlerFact fetched = true; consumer.accept(a); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } - public void setActivity(final Activity activity, final TaskHandlerFactory taskHandlerFactory) { + public void setActivity(final Activity activity, final TaskMonitorFactory taskMonitorFactory) { restFactory .create(ACTIVITY_RESOURCE) .method(res -> res.setCurrentActivity(activity)) @@ -78,7 +78,7 @@ public void setActivity(final Activity activity, final TaskHandlerFactory taskHa fetched = true; ActivityChangedEvent.fire(this, a); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/activity/client/ManageActivityPresenter.java b/stroom-core-client/src/main/java/stroom/activity/client/ManageActivityPresenter.java index 246e818d8a5..f8a813995f3 100644 --- a/stroom-core-client/src/main/java/stroom/activity/client/ManageActivityPresenter.java +++ b/stroom-core-client/src/main/java/stroom/activity/client/ManageActivityPresenter.java @@ -180,7 +180,7 @@ private void updateQuickFilterTooltipContentSupplier() { "Choose Activity Quick Filter", helpUrl); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } }, this); @@ -249,7 +249,7 @@ private void onOpen() { .create(ACTIVITY_RESOURCE) .method(res -> res.fetch(e.getId())) .onSuccess(this::onEdit) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -283,7 +283,7 @@ private void onDelete() { listPresenter.getSelectionModel().clear(); updateQuickFilterTooltipContentSupplier(); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } }); diff --git a/stroom-core-client/src/main/java/stroom/activity/client/SplashPresenter.java b/stroom-core-client/src/main/java/stroom/activity/client/SplashPresenter.java index 829d9abbee7..df43da5d427 100644 --- a/stroom-core-client/src/main/java/stroom/activity/client/SplashPresenter.java +++ b/stroom-core-client/src/main/java/stroom/activity/client/SplashPresenter.java @@ -22,7 +22,7 @@ import stroom.core.client.UrlParameters; import stroom.dispatch.client.RestErrorHandler; import stroom.dispatch.client.RestFactory; -import stroom.task.client.DefaultTaskListener; +import stroom.task.client.DefaultTaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.ui.config.shared.SplashConfig; import stroom.widget.popup.client.event.ShowPopupEvent; @@ -85,7 +85,7 @@ public void show(final Consumer consumer) { consumer.accept(e.isOk()); }) .onFailure(RestErrorHandler.forPopup(this, e)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } else { AlertEvent.fireWarn(SplashPresenter.this, @@ -104,7 +104,7 @@ public void show(final Consumer consumer) { consumer.accept(true); } } - }, new DefaultTaskListener(this)); + }, new DefaultTaskMonitorFactory(this)); } public void setHtml(final String html) { diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/AnalyticsPlugin.java b/stroom-core-client/src/main/java/stroom/analytics/client/AnalyticsPlugin.java index 3a654e0695a..e825040de21 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/AnalyticsPlugin.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/AnalyticsPlugin.java @@ -29,7 +29,7 @@ import stroom.document.client.DocumentPluginEventManager; import stroom.entity.client.presenter.DocumentEditPresenter; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -68,13 +68,13 @@ public AnalyticsPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(ANALYTIC_RULE_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final AnalyticRuleDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(ANALYTIC_RULE_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticDataShardListPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticDataShardListPresenter.java index 2bc70a54a2e..e5ffdde3863 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticDataShardListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticDataShardListPresenter.java @@ -31,7 +31,7 @@ import stroom.docref.DocRef; import stroom.node.client.NodeManager; import stroom.preferences.client.DateTimeFormatter; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.client.DelayedUpdate; import stroom.util.shared.ModelStringUtil; import stroom.util.shared.ResultPage; @@ -162,16 +162,16 @@ private void update() { public void fetchNodes(final Range range, final Consumer> dataConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { nodeManager.listAllNodes( - nodeNames -> fetchTasksForNodes(range, dataConsumer, nodeNames, taskHandlerFactory), - errorHandler, taskHandlerFactory); + nodeNames -> fetchTasksForNodes(range, dataConsumer, nodeNames, taskMonitorFactory), + errorHandler, taskMonitorFactory); } private void fetchTasksForNodes(final Range range, final Consumer> dataConsumer, final List nodeNames, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { responseMap.clear(); for (final String nodeName : nodeNames) { if (criteria.getAnalyticDocUuid() != null) { @@ -189,7 +189,7 @@ private void fetchTasksForNodes(final Range range, errorMap.put(nodeName, Collections.singletonList(throwable.getMessage())); delayedUpdate.update(); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticDataShardsPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticDataShardsPresenter.java index e8f89516c68..a7fc745cd1f 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticDataShardsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticDataShardsPresenter.java @@ -112,7 +112,7 @@ private void update() { queryToolbarPresenter.onError(Collections.singletonList(t.getMessage())); queryToolbarPresenter.onSearching(false); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticEmailDestinationPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticEmailDestinationPresenter.java index 09b1e544433..2e5f0a8216f 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticEmailDestinationPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticEmailDestinationPresenter.java @@ -118,7 +118,7 @@ private void testTemplate(final Function t }) .onFailure(throwable -> AlertEvent.fireError(this, throwable.getMessage(), null)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -140,7 +140,7 @@ private void onSendTestEmailClicked(final ClickEvent event) { restFactory .create(ANALYTIC_RULE_RESOURCE) .call(res -> res.sendTestEmail(emailDestination)) - .taskHandlerFactory(getView().getSendTestEmailBtn()) + .taskMonitorFactory(getView().getSendTestEmailBtn()) .exec(); } }); diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticNotificationEditPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticNotificationEditPresenter.java index 1d4f27811f1..af4f2719997 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticNotificationEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticNotificationEditPresenter.java @@ -25,7 +25,7 @@ import stroom.analytics.shared.NotificationStreamDestination; import stroom.dashboard.client.main.UniqueUtil; import stroom.document.client.event.DirtyUiHandlers; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.ui.config.shared.AnalyticUiDefaultConfig; import stroom.util.shared.GwtNullSafe; @@ -178,8 +178,8 @@ public void onDirty() { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - analyticEmailDestinationPresenter.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + analyticEmailDestinationPresenter.setTaskMonitorFactory(taskMonitorFactory); // analyticStreamDestinationPresenter.setTaskListener(taskListener); } diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticProcessingPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticProcessingPresenter.java index 778c803cff3..fe94d649c9d 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticProcessingPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticProcessingPresenter.java @@ -31,7 +31,7 @@ import stroom.pipeline.client.event.ChangeDataEvent.ChangeDataHandler; import stroom.pipeline.client.event.HasChangeDataHandlers; import stroom.security.shared.DocumentPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import com.google.inject.Inject; @@ -179,11 +179,11 @@ public void onDirty() { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - this.scheduledProcessingPresenter.setTaskHandlerFactory(taskHandlerFactory); - this.tableBuilderProcessingPresenter.setTaskHandlerFactory(taskHandlerFactory); - this.streamingProcessingPresenter.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + this.scheduledProcessingPresenter.setTaskMonitorFactory(taskMonitorFactory); + this.tableBuilderProcessingPresenter.setTaskMonitorFactory(taskMonitorFactory); + this.streamingProcessingPresenter.setTaskMonitorFactory(taskMonitorFactory); } public interface AnalyticProcessingView extends View, HasUiHandlers { diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticQueryEditPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticQueryEditPresenter.java index 6faac7ddade..f89efdc6e26 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticQueryEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/AnalyticQueryEditPresenter.java @@ -23,7 +23,7 @@ import stroom.entity.client.presenter.HasToolbar; import stroom.query.client.presenter.QueryEditPresenter; import stroom.query.client.presenter.QueryEditPresenter.QueryEditView; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.user.client.ui.Widget; import com.google.web.bindery.event.shared.EventBus; @@ -81,8 +81,8 @@ public void onClose() { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - queryEditPresenter.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + queryEditPresenter.setTaskMonitorFactory(taskMonitorFactory); } } diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/DuplicateManagementListPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/DuplicateManagementListPresenter.java index 86079108204..41bdeb39e10 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/DuplicateManagementListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/DuplicateManagementListPresenter.java @@ -92,7 +92,7 @@ protected void exec(final Range range, dataConsumer.accept(result.getResultPage()); }) .onFailure(errorHandler) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } } @@ -178,7 +178,7 @@ private void onDelete() { .create(DUPLICATE_CHECK_RESOURCE) .method(res -> res.delete(request)) .onSuccess(r -> refresh()) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }); diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessEditPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessEditPresenter.java index 8216b4a46d7..ec6d756297a 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessEditPresenter.java @@ -84,7 +84,7 @@ public ScheduledProcessEditPresenter(final EventBus eventBus, scheduleReferenceTimeConsumer.accept(new ScheduleReferenceTime(referenceTime, lastExecuted)); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec()); nodeManager.listAllNodes( diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessHistoryListPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessHistoryListPresenter.java index b8fe0556019..e009f104d42 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessHistoryListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessHistoryListPresenter.java @@ -97,7 +97,7 @@ protected void exec(final Range range, .method(res -> res.fetchExecutionHistory(request)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } else { dataConsumer.accept(ResultPage.empty()); diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessListPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessListPresenter.java index b468e1ead18..57dbb147f9f 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessListPresenter.java @@ -109,7 +109,7 @@ protected void exec(final Range range, .method(res -> res.fetchExecutionSchedule(request)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } } @@ -148,7 +148,7 @@ public TickBoxState getValue(final ExecutionSchedule row) { .create(EXECUTION_SCHEDULE_RESOURCE) .method(res -> res.updateExecutionSchedule(row.copy().enabled(value.toBoolean()).build())) .onSuccess(updated -> refresh()) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); }); dataGrid.addColumn(enabledColumn, "Enabled", 80); diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessingPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessingPresenter.java index 172d560857a..a8cf1d3353c 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessingPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/ScheduledProcessingPresenter.java @@ -111,7 +111,7 @@ private void add(final ExecutionSchedule newSchedule) { null); } else { - scheduledProcessEditPresenter.setTaskHandlerFactory(this); + scheduledProcessEditPresenter.setTaskMonitorFactory(this); scheduledProcessEditPresenter.show(newSchedule, executionSchedule -> { if (executionSchedule != null) { restFactory @@ -121,7 +121,7 @@ private void add(final ExecutionSchedule newSchedule) { scheduledProcessListPresenter.refresh(); scheduledProcessListPresenter.setSelected(created); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } }); @@ -131,7 +131,7 @@ private void add(final ExecutionSchedule newSchedule) { public void edit() { final ExecutionSchedule selected = scheduledProcessListPresenter.getSelected(); if (selected != null) { - scheduledProcessEditPresenter.setTaskHandlerFactory(this); + scheduledProcessEditPresenter.setTaskMonitorFactory(this); scheduledProcessEditPresenter.show(selected, executionSchedule -> { if (executionSchedule != null) { restFactory @@ -141,7 +141,7 @@ public void edit() { scheduledProcessListPresenter.refresh(); scheduledProcessListPresenter.setSelected(updated); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } }); @@ -155,7 +155,7 @@ public void remove() { .create(EXECUTION_SCHEDULE_RESOURCE) .method(res -> res.deleteExecutionSchedule(selected)) .onSuccess(success -> scheduledProcessListPresenter.refresh()) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/StreamingProcessingPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/StreamingProcessingPresenter.java index c73011e67b1..39474d895e5 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/StreamingProcessingPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/StreamingProcessingPresenter.java @@ -62,7 +62,7 @@ public void update(final AnalyticRuleDoc analyticRuleDoc, processorPresenter.read(analyticRuleDoc.asDocRef(), analyticRuleDoc, readOnly); processorPresenter.setAllowUpdate(true); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/TableBuilderProcessingPresenter.java b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/TableBuilderProcessingPresenter.java index cdaa0fcc6d8..be459c56310 100644 --- a/stroom-core-client/src/main/java/stroom/analytics/client/presenter/TableBuilderProcessingPresenter.java +++ b/stroom-core-client/src/main/java/stroom/analytics/client/presenter/TableBuilderProcessingPresenter.java @@ -107,7 +107,7 @@ private void refreshTracker() { final SafeHtml safeHtml = getInfo(result); getView().setInfo(safeHtml); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/annotation/client/AnnotationEditPresenter.java b/stroom-core-client/src/main/java/stroom/annotation/client/AnnotationEditPresenter.java index 10d83a59811..35ad5b03e52 100644 --- a/stroom-core-client/src/main/java/stroom/annotation/client/AnnotationEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/annotation/client/AnnotationEditPresenter.java @@ -137,7 +137,7 @@ public AnnotationEditPresenter(final EventBus eventBus, .create(annotationResource) .method(res -> res.getStatus(filter)) .onSuccess(consumer) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); }); this.commentPresenter.setDataSupplier((filter, consumer) -> { @@ -146,7 +146,7 @@ public AnnotationEditPresenter(final EventBus eventBus, .create(annotationResource) .method(res -> res.getComment(filter)) .onSuccess(consumer) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); }); } @@ -169,7 +169,7 @@ protected void onBind() { .create(annotationResource) .method(res -> res.getComment(null)) .onSuccess(values -> getView().setHasCommentValues(values != null && !values.isEmpty())) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -293,7 +293,7 @@ private void addEntry(final CreateEntryRequest request) { AnnotationEditPresenter.this, caught.getMessage(), null)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -327,7 +327,7 @@ public void show(final Annotation annotation, final List linkedEvents) .create(annotationResource) .method(res -> res.get(annotation.getId())) .onSuccess(this::edit) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -390,7 +390,7 @@ private void read(final AnnotationDetail annotationDetail) { setStatus(values.get(0)); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -892,7 +892,7 @@ public void showLinkedEvents() { .create(annotationResource) .method(res -> res.get(annotationDetail.getAnnotation().getId())) .onSuccess(this::updateHistory) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } }); diff --git a/stroom-core-client/src/main/java/stroom/annotation/client/ChangeAssignedToPresenter.java b/stroom-core-client/src/main/java/stroom/annotation/client/ChangeAssignedToPresenter.java index d854dd48839..81f478c41b6 100644 --- a/stroom-core-client/src/main/java/stroom/annotation/client/ChangeAssignedToPresenter.java +++ b/stroom-core-client/src/main/java/stroom/annotation/client/ChangeAssignedToPresenter.java @@ -78,7 +78,7 @@ public void show(final List annotationIdList) { e.hide(); }) .onFailure(RestErrorHandler.forPopup(this, e)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } else { e.hide(); diff --git a/stroom-core-client/src/main/java/stroom/annotation/client/ChangeStatusPresenter.java b/stroom-core-client/src/main/java/stroom/annotation/client/ChangeStatusPresenter.java index 5b625f9210e..1f4a910af1a 100644 --- a/stroom-core-client/src/main/java/stroom/annotation/client/ChangeStatusPresenter.java +++ b/stroom-core-client/src/main/java/stroom/annotation/client/ChangeStatusPresenter.java @@ -79,7 +79,7 @@ public void show(final List annotationIdList) { changeStatus(values.get(0)); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -100,7 +100,7 @@ public void show(final List annotationIdList) { e.hide(); }) .onFailure(RestErrorHandler.forPopup(this, e)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } else { e.hide(); @@ -125,7 +125,7 @@ public void showStatusChooser(final Element element) { .create(annotationResource) .method(res -> res.getStatus(filter)) .onSuccess(consumer) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); }); statusPresenter.clearFilter(); diff --git a/stroom-core-client/src/main/java/stroom/annotation/client/LinkedEventPresenter.java b/stroom-core-client/src/main/java/stroom/annotation/client/LinkedEventPresenter.java index 1bf05907a67..755f867b1f5 100644 --- a/stroom-core-client/src/main/java/stroom/annotation/client/LinkedEventPresenter.java +++ b/stroom-core-client/src/main/java/stroom/annotation/client/LinkedEventPresenter.java @@ -101,7 +101,7 @@ protected void onBind() { .create(annotationResource) .method(res -> res.link(new EventLink(annotation.getId(), eventId))) .onSuccess(this::setData) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } }))); @@ -124,7 +124,7 @@ protected void onBind() { .create(annotationResource) .method(res -> res.unlink(new EventLink(annotation.getId(), selected))) .onSuccess(this::setData) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } })); @@ -140,7 +140,7 @@ public void edit(final Annotation annotation, final Consumer consumer) .create(annotationResource) .method(res -> res.getLinkedEvents(annotation.getId())) .onSuccess(this::show) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/cache/client/presenter/CacheListPresenter.java b/stroom-core-client/src/main/java/stroom/cache/client/presenter/CacheListPresenter.java index db155929c0b..37d7d5d63ce 100644 --- a/stroom-core-client/src/main/java/stroom/cache/client/presenter/CacheListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/cache/client/presenter/CacheListPresenter.java @@ -94,7 +94,7 @@ public CacheListPresenter(final EventBus eventBus, cacheUpdateHandler.accept(row); } }) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); }); @@ -165,7 +165,7 @@ private void fetchNamesForNodes(final List nodeNames) { delayedUpdate.update(); }) .onFailure(throwable -> delayedUpdate.update()) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/cache/client/presenter/CacheNodeListPresenter.java b/stroom-core-client/src/main/java/stroom/cache/client/presenter/CacheNodeListPresenter.java index 8c6b606e3b3..9dbcd0ba1e7 100644 --- a/stroom-core-client/src/main/java/stroom/cache/client/presenter/CacheNodeListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/cache/client/presenter/CacheNodeListPresenter.java @@ -132,7 +132,7 @@ private void addClearColumn() { .onSuccess(result -> { dataProvider.refresh(); }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); }); } @@ -338,7 +338,7 @@ private void fetchTasksForNodes(final Consumer dataConsumer, responseMap.remove(nodeName); delayedUpdate.update(); }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/config/global/client/presenter/GlobalPropertyTabPresenter.java b/stroom-core-client/src/main/java/stroom/config/global/client/presenter/GlobalPropertyTabPresenter.java index 93b9a50ad71..00834ee9deb 100644 --- a/stroom-core-client/src/main/java/stroom/config/global/client/presenter/GlobalPropertyTabPresenter.java +++ b/stroom-core-client/src/main/java/stroom/config/global/client/presenter/GlobalPropertyTabPresenter.java @@ -140,7 +140,7 @@ public void onEdit(final ConfigProperty e) { if (e != null) { if (editProvider != null) { final ManageGlobalPropertyEditPresenter editor = editProvider.get(); - editor.setTaskHandlerFactory(this); + editor.setTaskMonitorFactory(this); editor.showEntity(e, listPresenter::refresh); } } diff --git a/stroom-core-client/src/main/java/stroom/config/global/client/presenter/ManageGlobalPropertyEditPresenter.java b/stroom-core-client/src/main/java/stroom/config/global/client/presenter/ManageGlobalPropertyEditPresenter.java index 8979a457450..2391089f5a3 100644 --- a/stroom-core-client/src/main/java/stroom/config/global/client/presenter/ManageGlobalPropertyEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/config/global/client/presenter/ManageGlobalPropertyEditPresenter.java @@ -230,7 +230,7 @@ private void updateValuesFromResource(final String propertyName, final Runnable show(configProperty, hideRunnable)) .onFailure(error -> showError(error, "Error fetching property " + propertyName, null)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -330,7 +330,7 @@ private void refreshYamlOverrideForNode(final String nodeName) { // updateEffectiveValueForNode(nodeName, ERROR_VALUE); delayedUpdate.update(); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -470,7 +470,7 @@ private void write(final HidePopupRequestEvent event) { }) .onFailure(throwable -> showError(throwable, "Error creating property", event::reset)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } else { restFactory @@ -485,7 +485,7 @@ private void write(final HidePopupRequestEvent event) { }) .onFailure(throwable -> showError(throwable, "Error updating property", event::reset)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/config/global/client/presenter/ManageGlobalPropertyListPresenter.java b/stroom-core-client/src/main/java/stroom/config/global/client/presenter/ManageGlobalPropertyListPresenter.java index 41e162b0dc7..50d86957953 100644 --- a/stroom-core-client/src/main/java/stroom/config/global/client/presenter/ManageGlobalPropertyListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/config/global/client/presenter/ManageGlobalPropertyListPresenter.java @@ -178,7 +178,7 @@ private void refreshTable(final Range range) { ManageGlobalPropertyListPresenter.this, caught.getMessage(), null)) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } @@ -229,7 +229,7 @@ private void refreshPropertiesForNode(final String nodeName) { // unless another node has already kicked it off updateChildMapsTimer.update(); }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/content/client/presenter/ContentTabPanePresenter.java b/stroom-core-client/src/main/java/stroom/content/client/presenter/ContentTabPanePresenter.java index 27f61d68771..060e53810e0 100644 --- a/stroom-core-client/src/main/java/stroom/content/client/presenter/ContentTabPanePresenter.java +++ b/stroom-core-client/src/main/java/stroom/content/client/presenter/ContentTabPanePresenter.java @@ -29,10 +29,10 @@ import stroom.data.table.client.Refreshable; import stroom.explorer.client.presenter.RecentItems; import stroom.main.client.presenter.MainPresenter; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.tab.client.event.MaximiseEvent; import stroom.widget.tab.client.presenter.CurveTabLayoutPresenter; import stroom.widget.tab.client.presenter.CurveTabLayoutView; @@ -154,10 +154,10 @@ public void onOpen(final OpenContentTabEvent event) { forceReveal(); add(event.getTabData(), event.getLayer()); - if (event.getLayer() instanceof HasTaskHandlerFactory) { + if (event.getLayer() instanceof HasTaskMonitorFactory) { final AbstractTab tab = getView().getTabBar().getTab(event.getTabData()); - ((HasTaskHandlerFactory) event.getLayer()) - .setTaskHandlerFactory(new TabTaskListener(tab)); + ((HasTaskMonitorFactory) event.getLayer()) + .setTaskMonitorFactory(new TabTaskMonitorFactory(tab)); } } @@ -176,9 +176,9 @@ public void onClose(final CloseContentTabEvent event) { } } - if (event.getTabData() instanceof HasTaskHandlerFactory) { - ((HasTaskHandlerFactory) event.getTabData()) - .setTaskHandlerFactory(new DefaultTaskListener(this)); + if (event.getTabData() instanceof HasTaskMonitorFactory) { + ((HasTaskMonitorFactory) event.getTabData()) + .setTaskMonitorFactory(new DefaultTaskMonitorFactory(this)); } } @@ -230,17 +230,17 @@ public interface ContentTabPaneProxy extends Proxy { } - private static class TabTaskListener implements TaskHandlerFactory { + private static class TabTaskMonitorFactory implements TaskMonitorFactory { private final AbstractTab tab; - public TabTaskListener(final AbstractTab tab) { + public TabTaskMonitorFactory(final AbstractTab tab) { this.tab = tab; } @Override - public TaskHandler createTaskHandler() { - return tab.createTaskHandler(); + public TaskMonitor createTaskMonitor() { + return tab.createTaskMonitor(); } } } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/DashboardPlugin.java b/stroom-core-client/src/main/java/stroom/dashboard/client/DashboardPlugin.java index edaee13879a..7f28b3b51c7 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/DashboardPlugin.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/DashboardPlugin.java @@ -36,8 +36,8 @@ import stroom.query.api.v2.SearchRequestSource; import stroom.query.api.v2.SearchRequestSource.SourceType; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.http.client.URL; @@ -81,11 +81,11 @@ public DashboardPlugin(final EventBus eventBus, public MyPresenterWidget open(final DocRef docRef, final boolean forceOpen, final boolean fullScreen, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { if (docRef.getType().equals(getType())) { currentUuid = docRef.getUuid(); } - return super.open(docRef, forceOpen, fullScreen, taskHandlerFactory); + return super.open(docRef, forceOpen, fullScreen, taskMonitorFactory); } private void openParameterisedDashboard(final String href) { @@ -122,7 +122,7 @@ private void openParameterisedDashboard(final String href) { // Actually close the tab. event.getCallback().closeTab(true); }; - showDocument(docRef, presenter, closeHandler, presenter, false, new DefaultTaskListener(this)); + showDocument(docRef, presenter, closeHandler, presenter, false, new DefaultTaskMonitorFactory(this)); } } @@ -173,7 +173,7 @@ private void reopen(final ResultStoreInfo resultStoreInfo) { // Actually close the tab. event.getCallback().closeTab(true); }; - showDocument(docRef, presenter, closeHandler, presenter, false, new DefaultTaskListener(this)); + showDocument(docRef, presenter, closeHandler, presenter, false, new DefaultTaskMonitorFactory(this)); } } @@ -187,13 +187,13 @@ private void reopen(final ResultStoreInfo resultStoreInfo) { public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(DASHBOARD_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -202,13 +202,13 @@ public void save(final DocRef docRef, final DashboardDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(DASHBOARD_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/input/ListInputPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/input/ListInputPresenter.java index 407221851cf..700be7cb1cb 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/input/ListInputPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/input/ListInputPresenter.java @@ -108,7 +108,7 @@ private void update(final ListInputComponentSettings settings) { getView().setAllowTextEntry(settings.isAllowTextEntry()); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } else { getView().setValues(settings.getValues()); diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/main/ComponentDataModifier.java b/stroom-core-client/src/main/java/stroom/dashboard/client/main/ComponentDataModifier.java index b8cf1feb52b..b08ddbd1ad1 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/main/ComponentDataModifier.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/main/ComponentDataModifier.java @@ -17,9 +17,9 @@ package stroom.dashboard.client.main; import stroom.dashboard.shared.ComponentConfig; -import stroom.task.client.HasTaskHandlerFactory; +import stroom.task.client.HasTaskMonitorFactory; -public interface ComponentDataModifier extends HasTaskHandlerFactory { +public interface ComponentDataModifier extends HasTaskMonitorFactory { boolean validate(); diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/main/DashboardPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/main/DashboardPresenter.java index 85ea4fa9ac1..bec64084926 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/main/DashboardPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/main/DashboardPresenter.java @@ -56,7 +56,7 @@ import stroom.query.client.presenter.SearchErrorListener; import stroom.query.client.presenter.SearchStateListener; import stroom.svg.shared.SvgImage; -import stroom.task.client.HasTaskHandlerFactory; +import stroom.task.client.HasTaskMonitorFactory; import stroom.util.shared.GwtNullSafe; import stroom.util.shared.Version; import stroom.widget.button.client.ButtonPanel; @@ -547,10 +547,10 @@ private Component addComponent(final String type, final ComponentConfig componen final Queryable queryable = (Queryable) component; queryable.addSearchStateListener(this); queryable.addSearchErrorListener(this); - queryable.setTaskHandlerFactory(this); + queryable.setTaskMonitorFactory(this); queryable.setQueryInfo(queryInfo); - } else if (component instanceof HasTaskHandlerFactory) { - ((HasTaskHandlerFactory) component).setTaskHandlerFactory(this); + } else if (component instanceof HasTaskMonitorFactory) { + ((HasTaskMonitorFactory) component).setTaskMonitorFactory(this); } component.read(componentConfig); diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/main/Queryable.java b/stroom-core-client/src/main/java/stroom/dashboard/client/main/Queryable.java index 0604c68d9f1..038d80d4ca0 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/main/Queryable.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/main/Queryable.java @@ -20,7 +20,7 @@ import stroom.query.api.v2.ResultStoreInfo; import stroom.query.client.presenter.SearchErrorListener; import stroom.query.client.presenter.SearchStateListener; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import java.util.List; @@ -50,5 +50,5 @@ public interface Queryable { void setResultStoreInfo(ResultStoreInfo resultStoreInfo); - void setTaskHandlerFactory(TaskHandlerFactory taskHandlerFactory); + void setTaskMonitorFactory(TaskMonitorFactory taskMonitorFactory); } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/main/SearchModel.java b/stroom-core-client/src/main/java/stroom/dashboard/client/main/SearchModel.java index 79bdd4355cc..cfba674b0ea 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/main/SearchModel.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/main/SearchModel.java @@ -39,9 +39,9 @@ import stroom.query.client.presenter.ResultStoreModel; import stroom.query.client.presenter.SearchErrorListener; import stroom.query.client.presenter.SearchStateListener; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.event.shared.GwtEvent; @@ -57,7 +57,7 @@ import java.util.function.Consumer; import java.util.stream.Collectors; -public class SearchModel implements HasTaskHandlerFactory, HasHandlers { +public class SearchModel implements HasTaskMonitorFactory, HasHandlers { private static final DashboardResource DASHBOARD_RESOURCE = GWT.create(DashboardResource.class); @@ -68,7 +68,7 @@ public class SearchModel implements HasTaskHandlerFactory, HasHandlers { private String componentId; private final DateTimeSettingsFactory dateTimeSettingsFactory; private final ResultStoreModel resultStoreModel; - private TaskHandlerFactory taskHandlerFactory = new DefaultTaskListener(this); + private TaskMonitorFactory taskMonitorFactory = new DefaultTaskMonitorFactory(this); private Map resultComponents = new HashMap<>(); private DashboardSearchResponse currentResponse; private String currentNode; @@ -262,7 +262,7 @@ public void refresh(final String componentId, final Consumer resultConsu } resultConsumer.accept(null); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } @@ -277,14 +277,14 @@ public void refresh(final String componentId, final Consumer resultConsu private void deleteStore(final String node, final QueryKey queryKey, final DestroyReason destroyReason) { if (queryKey != null) { resultStoreModel.destroy(node, queryKey, destroyReason, (ok) -> - GWT.log("Destroyed store " + queryKey), taskHandlerFactory); + GWT.log("Destroyed store " + queryKey), taskMonitorFactory); } } private void terminate(final String node, final QueryKey queryKey) { if (queryKey != null) { resultStoreModel.terminate(node, queryKey, (ok) -> - GWT.log("Terminate search " + queryKey), taskHandlerFactory); + GWT.log("Terminate search " + queryKey), taskMonitorFactory); } } @@ -355,7 +355,7 @@ private void poll(final Fetch initialFetch, final boolean storeHistory) { poll(Fetch.CHANGES, false); } }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } @@ -540,8 +540,8 @@ public void setResultStoreInfo(final ResultStoreInfo resultStoreInfo) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } @Override diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/main/SettingsPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/main/SettingsPresenter.java index f75fa9ff458..bcd53b0e5b0 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/main/SettingsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/main/SettingsPresenter.java @@ -67,7 +67,7 @@ public TabData addTab(final String text, final Layer layer) { if (layer instanceof ComponentDataModifier) { final ComponentDataModifier componentDataModifier = (ComponentDataModifier) layer; - componentDataModifier.setTaskHandlerFactory(this); + componentDataModifier.setTaskMonitorFactory(this); modifiers.put(tab, componentDataModifier); } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/query/NamePresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/query/NamePresenter.java index e43533f0385..23ac259f6c0 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/query/NamePresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/query/NamePresenter.java @@ -103,7 +103,7 @@ private void create(final StoredQuery query, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -118,7 +118,7 @@ private void update(final StoredQuery query, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryFavouritesPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryFavouritesPresenter.java index ebf60f15cb1..f4586346b25 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryFavouritesPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryFavouritesPresenter.java @@ -190,7 +190,7 @@ private void refresh(final boolean showAfterRefresh) { .fire(); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -203,7 +203,7 @@ private void delete(final StoredQuery query) { .create(STORED_QUERY_RESOURCE) .method(res -> res.delete(query)) .onSuccess(result -> refresh(false)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryHistoryPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryHistoryPresenter.java index c87bbfb3012..a6da312066b 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryHistoryPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryHistoryPresenter.java @@ -142,7 +142,7 @@ private void refresh(final boolean showAfterRefresh) { .fire(); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryInfo.java b/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryInfo.java index 307c228ba80..973982678a3 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryInfo.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryInfo.java @@ -1,6 +1,6 @@ package stroom.dashboard.client.query; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import javax.inject.Inject; import javax.inject.Provider; @@ -15,13 +15,13 @@ public QueryInfo(final Provider queryInfoPresenterProvider) this.queryInfoPresenterProvider = queryInfoPresenterProvider; } - public void prompt(final Runnable runnable, final TaskHandlerFactory taskHandlerFactory) { + public void prompt(final Runnable runnable, final TaskMonitorFactory taskMonitorFactory) { queryInfoPresenterProvider.get().show(message, state -> { if (state.isOk()) { message = state.getQueryInfo(); runnable.run(); } - }, taskHandlerFactory); + }, taskMonitorFactory); } public String getMessage() { diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryInfoPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryInfoPresenter.java index 2963c560d50..a35d611617f 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryInfoPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryInfoPresenter.java @@ -19,7 +19,7 @@ import stroom.activity.client.CurrentActivity; import stroom.activity.shared.Activity; import stroom.alert.client.event.AlertEvent; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.ui.config.shared.QueryConfig; import stroom.widget.popup.client.event.ShowPopupEvent; @@ -63,7 +63,7 @@ private boolean isRequired(final Activity activity) { public void show(final String queryInfo, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { currentActivity.getActivity(activity -> { final boolean required = isRequired(activity); uiConfigCache.get(uiConfig -> { @@ -113,8 +113,8 @@ public void show(final String queryInfo, consumer.accept(new State(null, true)); } } - }, taskHandlerFactory); - }, taskHandlerFactory); + }, taskMonitorFactory); + }, taskMonitorFactory); } public interface QueryInfoView extends View, Focus { diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryPresenter.java index 690be66d420..7bdb4f12c43 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/query/QueryPresenter.java @@ -70,7 +70,7 @@ import stroom.svg.client.Preset; import stroom.svg.client.SvgPresets; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.util.shared.EqualsBuilder; import stroom.util.shared.ModelStringUtil; @@ -581,7 +581,7 @@ private void openEditor(final QueryData queryData, final DocRef pipeline) { AlertEvent.fireInfo(this, "Created batch processor", null); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -782,7 +782,7 @@ private void init() { resume(getQuerySettings().getLastQueryNode(), getQuerySettings().getLastQueryKey()); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -933,7 +933,7 @@ private void downloadQuery() { .method(res -> res.downloadQuery(searchRequest)) .onSuccess(result -> ExportFileCompleteUtil.onSuccess(locationManager, this, result)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -945,9 +945,9 @@ private void setWarningsVisible(final boolean show) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - searchModel.setTaskHandlerFactory(taskHandlerFactory); - fieldSelectionBoxModel.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + searchModel.setTaskMonitorFactory(taskMonitorFactory); + fieldSelectionBoxModel.setTaskMonitorFactory(taskMonitorFactory); } @Override diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/query/SelectionHandlerPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/query/SelectionHandlerPresenter.java index 63dfbd4fb0a..3af5f45f56c 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/query/SelectionHandlerPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/query/SelectionHandlerPresenter.java @@ -26,7 +26,7 @@ import stroom.docref.DocRef; import stroom.query.api.v2.ExpressionOperator; import stroom.query.client.presenter.DynamicFieldSelectionListModel; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.RandomId; import com.google.gwt.user.client.ui.Focus; @@ -142,9 +142,9 @@ private void addFieldNames(final Component component, final List all } @Override - public synchronized void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - fieldSelectionBoxModel.setTaskHandlerFactory(taskHandlerFactory); + public synchronized void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + fieldSelectionBoxModel.setTaskMonitorFactory(taskMonitorFactory); } public interface SelectionHandlerView extends View, Focus, HasUiHandlers { diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/table/ColumnFunctionEditorPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/table/ColumnFunctionEditorPresenter.java index 5726de08734..470bedbc575 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/table/ColumnFunctionEditorPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/table/ColumnFunctionEditorPresenter.java @@ -123,7 +123,7 @@ public void show(final TablePresenter tablePresenter, @Override public void onShow(final ShowPopupEvent e) { - queryHelpPresenter.setTaskHandlerFactory(this); + queryHelpPresenter.setTaskMonitorFactory(this); queryHelpPresenter.setShowAll(false); queryHelpPresenter.linkToEditor(this.editorPresenter); queryHelpPresenter.refresh(); @@ -163,7 +163,7 @@ public void onHideRequest(final HidePopupRequestEvent e) { } }) .onFailure(RestErrorHandler.forPopup(this, e)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/table/TablePresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/table/TablePresenter.java index 7a91ed51dc4..b9663f2b54c 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/table/TablePresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/table/TablePresenter.java @@ -79,7 +79,7 @@ import stroom.security.client.api.ClientSecurityContext; import stroom.security.shared.AppPermission; import stroom.svg.client.SvgPresets; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.ui.config.shared.UserPreferences; import stroom.util.shared.Expander; @@ -184,7 +184,7 @@ public TablePresenter(final EventBus eventBus, this.columnSelectionListModel = columnSelectionListModel; this.dataSourceClient = dataSourceClient; - columnSelectionListModel.setTaskHandlerFactory(this); + columnSelectionListModel.setTaskMonitorFactory(this); dataGrid = new MyDataGrid<>(); selectionModel = dataGrid.addDefaultSelectionModel(true); @@ -306,7 +306,7 @@ protected void onBind() { private void setPause(final boolean pause, final boolean refresh) { - // If curently paused then refresh if we are allowed. + // If currently paused then refresh if we are allowed. if (refresh && this.pause) { refresh(); } @@ -422,7 +422,7 @@ private void download() { .onSuccess(result -> ExportFileCompleteUtil.onSuccess(locationManager, this, result)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } e.hide(); @@ -1067,9 +1067,9 @@ public String getType() { } @Override - public synchronized void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - columnSelectionListModel.setTaskHandlerFactory(taskHandlerFactory); + public synchronized void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + columnSelectionListModel.setTaskMonitorFactory(taskMonitorFactory); } // -------------------------------------------------------------------------------- diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/text/TextPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/text/TextPresenter.java index 2cd1db354f8..760bbf3b730 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/text/TextPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/text/TextPresenter.java @@ -44,7 +44,7 @@ import stroom.query.client.presenter.TableRow; import stroom.security.client.api.ClientSecurityContext; import stroom.security.shared.AppPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.DataRange; import stroom.util.shared.DefaultLocation; import stroom.util.shared.EqualsUtil; @@ -622,7 +622,7 @@ public void run() { } } }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }; @@ -731,7 +731,7 @@ public String getType() { // -------------------------------------------------------------------------------- - public interface TextView extends View, HasUiHandlers, TaskHandlerFactory { + public interface TextView extends View, HasUiHandlers, TaskMonitorFactory { void setContent(View view); diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/text/TextViewImpl.java b/stroom-core-client/src/main/java/stroom/dashboard/client/text/TextViewImpl.java index aaefb8c03e2..5c697b248d2 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/text/TextViewImpl.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/text/TextViewImpl.java @@ -19,7 +19,7 @@ import stroom.dashboard.client.text.TextPresenter.TextView; import stroom.data.client.view.ClassificationLabel; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.button.client.FabButton; import stroom.widget.spinner.client.SpinnerLarge; @@ -81,8 +81,8 @@ public void onSteppingClick(final ClickEvent e) { } @Override - public TaskHandler createTaskHandler() { - return spinner.createTaskHandler(); + public TaskMonitor createTaskMonitor() { + return spinner.createTaskMonitor(); } public interface Binder extends UiBinder { diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/vis/BasicVisSettingsPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/vis/BasicVisSettingsPresenter.java index eb1b88b110a..5badd08daa7 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/vis/BasicVisSettingsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/vis/BasicVisSettingsPresenter.java @@ -138,7 +138,7 @@ private void loadVisualisation(final DocRef docRef, final JSONObject dynamicSett final JSONObject settings = JSONUtil.getObject(JSONUtil.parse(jsonString)); readSettings(settings, dynamicSettings); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/vis/MessageSupport.java b/stroom-core-client/src/main/java/stroom/dashboard/client/vis/MessageSupport.java index 202ef0ecb7c..7fb8ed558ac 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/vis/MessageSupport.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/vis/MessageSupport.java @@ -19,9 +19,9 @@ import stroom.dashboard.client.vis.PostMessage.FrameListener; import stroom.hyperlink.client.Hyperlink; import stroom.hyperlink.client.HyperlinkEvent; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.client.JSONUtil; import com.google.gwt.core.client.Callback; @@ -42,7 +42,7 @@ import java.util.Map; public class MessageSupport - implements FrameListener, HasHandlers, HasUiHandlers, HasTaskHandlerFactory { + implements FrameListener, HasHandlers, HasUiHandlers, HasTaskMonitorFactory { private static final Map> callbacks = new HashMap<>(); private static int frameIdCounter; @@ -50,7 +50,7 @@ public class MessageSupport private final EventBus eventBus; private final Element frame; private final int frameId; - private TaskHandlerFactory taskHandlerFactory = new DefaultTaskListener(this); + private TaskMonitorFactory taskMonitorFactory = new DefaultTaskMonitorFactory(this); private SelectionUiHandlers uiHandlers; @@ -114,7 +114,7 @@ public void receiveMessage(final MessageEvent event, final JSONObject message) { final String href = JSONUtil.getString(message.get("href")); final String target = JSONUtil.getString(message.get("target")); final Hyperlink hyperlink = Hyperlink.builder().href(href).type(target).build(); - HyperlinkEvent.fire(this, hyperlink, taskHandlerFactory); + HyperlinkEvent.fire(this, hyperlink, taskMonitorFactory); } else if ("select".equals(functionName)) { final JSONValue selection = message.get("selection"); @@ -167,7 +167,7 @@ public void fireEvent(final GwtEvent event) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/vis/VisFrame.java b/stroom-core-client/src/main/java/stroom/dashboard/client/vis/VisFrame.java index 1db800cc6fd..9afda7b9906 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/vis/VisFrame.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/vis/VisFrame.java @@ -17,8 +17,8 @@ package stroom.dashboard.client.vis; import stroom.script.shared.ScriptDoc; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.visualisation.client.presenter.VisFunction; import stroom.visualisation.client.presenter.VisFunction.LoadStatus; @@ -38,7 +38,7 @@ import java.util.List; -public class VisFrame extends Composite implements VisPane, HasTaskHandlerFactory { +public class VisFrame extends Composite implements VisPane, HasTaskMonitorFactory { private final MessageSupport messageSupport; private VisFunction function; @@ -267,7 +267,7 @@ public void removeFromParent() { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - messageSupport.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + messageSupport.setTaskMonitorFactory(taskMonitorFactory); } } diff --git a/stroom-core-client/src/main/java/stroom/dashboard/client/vis/VisPresenter.java b/stroom-core-client/src/main/java/stroom/dashboard/client/vis/VisPresenter.java index 3d367767222..9e47bf0d268 100644 --- a/stroom-core-client/src/main/java/stroom/dashboard/client/vis/VisPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dashboard/client/vis/VisPresenter.java @@ -137,7 +137,7 @@ public VisPresenter(final EventBus eventBus, final VisView view, this.currentPreferences = currentPreferences; visFrame = new VisFrame(eventBus); - visFrame.setTaskHandlerFactory(getView().getRefreshButton()); + visFrame.setTaskMonitorFactory(getView().getRefreshButton()); visFrame.setUiHandlers(this); view.setVisFrame(visFrame); @@ -214,7 +214,7 @@ protected void onBind() { private void setPause(final boolean pause, final boolean refresh) { - // If curently paused then refresh if we are allowed. + // If currently paused then refresh if we are allowed. if (refresh && this.pause) { refresh(); } @@ -483,7 +483,7 @@ private void loadVisualisation(final VisFunction function, final DocRef visualis } }) .onFailure(caught -> failure(function, caught.getMessage())) - .taskHandlerFactory(getView().getRefreshButton()) + .taskMonitorFactory(getView().getRefreshButton()) .exec(); } @@ -494,7 +494,7 @@ private void loadScripts(final VisFunction function, final DocRef scriptRef) { .method(res -> res.fetchLinkedScripts( new FetchLinkedScriptRequest(scriptRef, scriptCache.getLoadedScripts()))) .onSuccess(result -> startInjectingScripts(result, function)) - .taskHandlerFactory(getView().getRefreshButton()) + .taskMonitorFactory(getView().getRefreshButton()) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/data/client/AbstractTabPresenterPlugin.java b/stroom-core-client/src/main/java/stroom/data/client/AbstractTabPresenterPlugin.java index 332fd032e99..431f054797d 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/AbstractTabPresenterPlugin.java +++ b/stroom-core-client/src/main/java/stroom/data/client/AbstractTabPresenterPlugin.java @@ -23,10 +23,10 @@ import stroom.core.client.ContentManager; import stroom.core.client.event.CloseContentEvent; import stroom.core.client.presenter.Plugin; -import stroom.task.client.DefaultTaskListener; +import stroom.task.client.DefaultTaskMonitorFactory; import stroom.task.client.SimpleTask; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import com.google.inject.Provider; import com.google.web.bindery.event.shared.EventBus; @@ -78,14 +78,14 @@ Optional openTabPresenter(final boolean forceOpen, null); } else { tabPresenter = keyToPresenterMap.get(presenterKey); - final TaskHandler taskHandler = new DefaultTaskListener(this).createTaskHandler(); + final TaskMonitor taskMonitor = new DefaultTaskMonitorFactory(this).createTaskMonitor(); final Task task = new SimpleTask("Opening " + getName() + " (" + presenterKey + ")"); if (tabPresenter != null) { // If we already have a tab item for this key then make sure it is visible. // Start spinning. - taskHandler.onStart(task); + taskMonitor.onStart(task); // Let the caller set what it wants on the presenter tabPresenterConsumer.accept(tabPresenter); @@ -94,11 +94,11 @@ Optional openTabPresenter(final boolean forceOpen, SelectContentTabEvent.fire(this, tabPresenter); // Stop spinning. - taskHandler.onEnd(task); + taskMonitor.onEnd(task); } else if (forceOpen) { // Start spinning. - taskHandler.onStart(task); + taskMonitor.onStart(task); // If the item isn't already open but we are forcing it open then, // create a new presenter and register it as open. @@ -114,7 +114,7 @@ Optional openTabPresenter(final boolean forceOpen, final CloseContentEvent.Handler closeHandler = createCloseHandler(tabPresenter); // Load the document and show the tab. - showTab(presenterKey, tabPresenter, closeHandler, taskHandler, task); + showTab(presenterKey, tabPresenter, closeHandler, taskMonitor, task); } } @@ -124,7 +124,7 @@ Optional openTabPresenter(final boolean forceOpen, private void showTab(final K presenterKey, final T tabPresenter, final CloseContentEvent.Handler closeHandler, - final TaskHandler taskHandler, + final TaskMonitor taskMonitor, final Task task) { try { if (presenterKey == null) { @@ -141,7 +141,7 @@ private void showTab(final K presenterKey, } } finally { // Stop spinning. - taskHandler.onEnd(task); + taskMonitor.onEnd(task); } } diff --git a/stroom-core-client/src/main/java/stroom/data/client/presenter/AbstractMetaListPresenter.java b/stroom-core-client/src/main/java/stroom/data/client/presenter/AbstractMetaListPresenter.java index 777ff289e10..7128ec9326d 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/presenter/AbstractMetaListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/client/presenter/AbstractMetaListPresenter.java @@ -155,7 +155,7 @@ protected void exec(final Range range, .method(res -> res.findMetaRow(criteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } else { dataConsumer.accept(new ResultPage<>(Collections.emptyList())); @@ -678,7 +678,7 @@ private Runnable update(final FindMetaCriteria criteria, ? "s" : ""), this::refresh)) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); }; } @@ -688,7 +688,7 @@ private void download(final FindMetaCriteria criteria) { .create(DATA_RESOURCE) .method(res -> res.download(criteria)) .onSuccess(result -> ExportFileCompleteUtil.onSuccess(locationManager, this, result)) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } @@ -721,7 +721,7 @@ private void process(final DocRef pipeline, AlertEvent.fireInfo(this, "Created processor filter", null); } }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } @@ -797,7 +797,7 @@ private void reprocess(final FindMetaCriteria criteria, } } }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/data/client/presenter/DataPresenter.java b/stroom-core-client/src/main/java/stroom/data/client/presenter/DataPresenter.java index 8ed4748c576..82c25d2afcb 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/presenter/DataPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/client/presenter/DataPresenter.java @@ -35,7 +35,7 @@ import stroom.pipeline.shared.stepping.StepType; import stroom.security.client.api.ClientSecurityContext; import stroom.security.shared.AppPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.ui.config.shared.SourceConfig; import stroom.util.shared.Count; @@ -471,7 +471,7 @@ public void fetchData(final SourceLocation sourceLocation) { null, Collections.singletonList(caught.getMessage())); }) - .taskHandlerFactory(dataView) + .taskMonitorFactory(dataView) .exec(); } @@ -581,7 +581,7 @@ private void update(final boolean fireEvents, }) .onFailure(caught -> itemNavigatorPresenter.setRefreshing(false)) - .taskHandlerFactory(dataView) + .taskMonitorFactory(dataView) .exec(); } else { showInvalidStreamErrorMsg(); @@ -760,7 +760,7 @@ public void run() { }) .onFailure(caught -> itemNavigatorPresenter.setRefreshing(false)) - .taskHandlerFactory(dataView) + .taskMonitorFactory(dataView) .exec(); } } @@ -1119,7 +1119,7 @@ private void fetchMetaInfoData(final Long metaId) { .create(DATA_RESOURCE) .method(res -> res.viewInfo(metaId)) .onSuccess(this::handleMetaInfoResult) - .taskHandlerFactory(dataView) + .taskMonitorFactory(dataView) .exec(); } } @@ -1227,7 +1227,7 @@ private void showErrors(final SourceLocation sourceLocation, // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - public interface DataView extends View, Focus, TaskHandlerFactory { + public interface DataView extends View, Focus, TaskMonitorFactory { void addSourceLinkClickHandler(final ClickHandler clickHandler); diff --git a/stroom-core-client/src/main/java/stroom/data/client/presenter/DataTypeUiManager.java b/stroom-core-client/src/main/java/stroom/data/client/presenter/DataTypeUiManager.java index 0132e5b61af..1acb8be680f 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/presenter/DataTypeUiManager.java +++ b/stroom-core-client/src/main/java/stroom/data/client/presenter/DataTypeUiManager.java @@ -18,7 +18,7 @@ import stroom.dispatch.client.RestFactory; import stroom.meta.shared.MetaResource; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; @@ -40,12 +40,12 @@ public DataTypeUiManager(final RestFactory restFactory) { } public void getTypes(final Consumer> consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(META_RESOURCE) .method(MetaResource::getTypes) .onSuccess(consumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/data/client/presenter/DataUploadPresenter.java b/stroom-core-client/src/main/java/stroom/data/client/presenter/DataUploadPresenter.java index a18d6f5d33e..93ed0a784ab 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/presenter/DataUploadPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/client/presenter/DataUploadPresenter.java @@ -99,7 +99,7 @@ protected void onSuccess(final ResourceKey resourceKey) { currentHideRequest.hide(); })) .onFailure(throwable -> error("Error uploading file: " + throwable.getMessage())) - .taskHandlerFactory(DataUploadPresenter.this) + .taskMonitorFactory(DataUploadPresenter.this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/data/client/presenter/ExpressionValidator.java b/stroom-core-client/src/main/java/stroom/data/client/presenter/ExpressionValidator.java index 652328d5c06..b334fbea741 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/presenter/ExpressionValidator.java +++ b/stroom-core-client/src/main/java/stroom/data/client/presenter/ExpressionValidator.java @@ -9,7 +9,7 @@ import stroom.query.client.presenter.DateTimeSettingsFactory; import stroom.query.shared.ExpressionResource; import stroom.query.shared.ValidateExpressionRequest; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.shared.GWT; import com.google.gwt.event.shared.HasHandlers; @@ -42,7 +42,7 @@ protected void validateExpression(final HasHandlers hasHandlers, final List fields, final ExpressionOperator expression, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { if (expression != null) { if (Objects.equals(expression, validatedExpression)) { // Same expression as last time, nothing new to validate, so carry on @@ -80,7 +80,7 @@ protected void validateExpression(final HasHandlers hasHandlers, hasHandlers, throwable.getMessage(), null); expressionValidationMessage = throwable.getMessage(); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/data/client/presenter/ProcessorTaskListPresenter.java b/stroom-core-client/src/main/java/stroom/data/client/presenter/ProcessorTaskListPresenter.java index 4ca7a7c8e85..7c17374b8ed 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/presenter/ProcessorTaskListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/client/presenter/ProcessorTaskListPresenter.java @@ -102,7 +102,7 @@ protected void exec(final Range range, .method(res -> res.find(criteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } } @@ -126,7 +126,7 @@ protected void showInfo(final ProcessorTask row, final PopupPosition popupPositi .orElse(null); showTooltip(popupPosition, row, meta); }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }, "
", ColumnSizeConstants.ICON_COL); diff --git a/stroom-core-client/src/main/java/stroom/data/client/presenter/ProcessorTaskSummaryPresenter.java b/stroom-core-client/src/main/java/stroom/data/client/presenter/ProcessorTaskSummaryPresenter.java index 85cf58c61a5..0590fde4fd9 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/presenter/ProcessorTaskSummaryPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/client/presenter/ProcessorTaskSummaryPresenter.java @@ -88,7 +88,7 @@ protected void exec(final Range range, .method(res -> res.findSummary(criteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/data/client/presenter/SelectionSummaryPresenter.java b/stroom-core-client/src/main/java/stroom/data/client/presenter/SelectionSummaryPresenter.java index 8ed75ab0135..56153ecdbb4 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/presenter/SelectionSummaryPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/client/presenter/SelectionSummaryPresenter.java @@ -55,14 +55,14 @@ public void show(final FindMetaCriteria criteria, .create(META_RESOURCE) .method(res -> res.getReprocessSelectionSummary(criteria)) .onSuccess(result -> update(postAction, action, result)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } else { restFactory .create(META_RESOURCE) .method(res -> res.getSelectionSummary(criteria)) .onSuccess(result -> update(postAction, action, result)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } }) diff --git a/stroom-core-client/src/main/java/stroom/data/client/presenter/SourcePresenter.java b/stroom-core-client/src/main/java/stroom/data/client/presenter/SourcePresenter.java index fcba62c055f..7127c1de105 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/presenter/SourcePresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/client/presenter/SourcePresenter.java @@ -15,7 +15,7 @@ import stroom.pipeline.stepping.client.event.BeginPipelineSteppingEvent; import stroom.security.client.api.ClientSecurityContext; import stroom.security.shared.AppPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.ui.config.shared.SourceConfig; import stroom.util.shared.Count; @@ -426,7 +426,7 @@ private void fetchSource(final SourceLocation sourceLocation) { SourcePresenter.this, caught.getMessage(), null)) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } @@ -871,7 +871,7 @@ public void advanceCharactersBackwards() { // =================================================================== - public interface SourceView extends View, TaskHandlerFactory { + public interface SourceView extends View, TaskMonitorFactory { void setProgressView(final View view); diff --git a/stroom-core-client/src/main/java/stroom/data/client/view/ClassificationLabel.java b/stroom-core-client/src/main/java/stroom/data/client/view/ClassificationLabel.java index 1154c077399..c519d87f1a1 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/view/ClassificationLabel.java +++ b/stroom-core-client/src/main/java/stroom/data/client/view/ClassificationLabel.java @@ -16,7 +16,7 @@ package stroom.data.client.view; -import stroom.task.client.DefaultTaskListener; +import stroom.task.client.DefaultTaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import com.google.gwt.core.client.GWT; @@ -55,7 +55,7 @@ public ClassificationLabel(final UiConfigCache clientPropertyCache) { } } } - }, new DefaultTaskListener(this)); + }, new DefaultTaskMonitorFactory(this)); } public void setClassification(final String text) { diff --git a/stroom-core-client/src/main/java/stroom/data/client/view/DataViewImpl.java b/stroom-core-client/src/main/java/stroom/data/client/view/DataViewImpl.java index 4b5df17ba13..5d5eb17b45a 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/view/DataViewImpl.java +++ b/stroom-core-client/src/main/java/stroom/data/client/view/DataViewImpl.java @@ -18,7 +18,7 @@ import stroom.data.client.presenter.DataPresenter.DataView; import stroom.data.client.presenter.ItemNavigatorPresenter.ItemNavigatorView; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.button.client.ButtonPanel; import stroom.widget.progress.client.presenter.ProgressPresenter.ProgressView; import stroom.widget.spinner.client.SpinnerLarge; @@ -130,8 +130,8 @@ public void setProgressView(final ProgressView progressView) { } @Override - public TaskHandler createTaskHandler() { - return spinner.createTaskHandler(); + public TaskMonitor createTaskMonitor() { + return spinner.createTaskMonitor(); } public interface Binder extends UiBinder { diff --git a/stroom-core-client/src/main/java/stroom/data/client/view/SourceViewImpl.java b/stroom-core-client/src/main/java/stroom/data/client/view/SourceViewImpl.java index 545993157ff..d68e38d8757 100644 --- a/stroom-core-client/src/main/java/stroom/data/client/view/SourceViewImpl.java +++ b/stroom-core-client/src/main/java/stroom/data/client/view/SourceViewImpl.java @@ -2,7 +2,7 @@ import stroom.data.client.presenter.SourcePresenter.SourceView; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.button.client.FabButton; import stroom.widget.spinner.client.SpinnerLarge; @@ -112,8 +112,8 @@ public void setProgressView(final View progressView) { } @Override - public TaskHandler createTaskHandler() { - return spinner.createTaskHandler(); + public TaskMonitor createTaskMonitor() { + return spinner.createTaskMonitor(); } public interface Binder extends UiBinder { diff --git a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeEditPresenter.java b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeEditPresenter.java index 2ab27883a0a..6e31c511156 100644 --- a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeEditPresenter.java @@ -124,7 +124,7 @@ private void doWithVolumeValidation(final FsVolume volume, } }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -139,7 +139,7 @@ private void updateVolume(final Consumer consumer, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -154,7 +154,7 @@ private void createVolume(final Consumer consumer, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupEditPresenter.java b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupEditPresenter.java index cfaddcde9b3..c9cb8900753 100644 --- a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupEditPresenter.java @@ -107,7 +107,7 @@ protected void onBind() { .onSuccess(response -> delayedUpdate.update()) .onFailure(throwable -> { }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); })); } @@ -125,7 +125,7 @@ private void edit() { .create(FS_VOLUME_RESOURCE) .method(res -> res.fetch(volume.getId())) .onSuccess(result -> editVolume(result, "Edit Volume")) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -155,7 +155,7 @@ private void delete() { .create(FS_VOLUME_RESOURCE) .method(res -> res.delete(volume.getId())) .onSuccess(response -> volumeStatusListPresenter.refresh()) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -252,7 +252,7 @@ private void doWithGroupNameValidation(final String groupName, } }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -268,7 +268,7 @@ private void createVolumeGroup(final Consumer consumer, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupListPresenter.java b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupListPresenter.java index 1a566757f49..bd286245ab5 100644 --- a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupListPresenter.java @@ -74,7 +74,7 @@ protected void exec(final Range range, .method(res -> res.find(criteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } }; diff --git a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupPresenter.java b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupPresenter.java index d7d0c7513f6..cf6e6e2220b 100644 --- a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeGroupPresenter.java @@ -100,7 +100,7 @@ private void edit() { .create(FS_VOLUME_GROUP_RESOURCE) .method(res -> res.fetch(volume.getId())) .onSuccess(this::edit) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -130,7 +130,7 @@ private void delete() { .create(FS_VOLUME_GROUP_RESOURCE) .method(res -> res.delete(volume.getId())) .onSuccess(response -> refresh()) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeStatusListPresenter.java b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeStatusListPresenter.java index 04e6cb8cc30..b52feebb358 100644 --- a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeStatusListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/FsVolumeStatusListPresenter.java @@ -98,7 +98,7 @@ protected void exec(final Range range, .method(resource -> resource.find(criteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }; diff --git a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/NewFsVolumeGroupPresenter.java b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/NewFsVolumeGroupPresenter.java index b84842406e5..2af4d87d6d4 100644 --- a/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/NewFsVolumeGroupPresenter.java +++ b/stroom-core-client/src/main/java/stroom/data/store/impl/fs/client/presenter/NewFsVolumeGroupPresenter.java @@ -104,7 +104,7 @@ private void checkVolumeGroupName(final String name, final HidePopupRequestEvent } }) .onFailure(RestErrorHandler.forPopup(this, e)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -117,7 +117,7 @@ private void createVolumeGroup(final String name, final HidePopupRequestEvent e) e.hide(); }) .onFailure(RestErrorHandler.forPopup(this, e)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/dictionary/client/DictionaryPlugin.java b/stroom-core-client/src/main/java/stroom/dictionary/client/DictionaryPlugin.java index ec0b72e73f4..fa3604cc0aa 100644 --- a/stroom-core-client/src/main/java/stroom/dictionary/client/DictionaryPlugin.java +++ b/stroom-core-client/src/main/java/stroom/dictionary/client/DictionaryPlugin.java @@ -29,7 +29,7 @@ import stroom.document.client.DocumentPluginEventManager; import stroom.entity.client.presenter.DocumentEditPresenter; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -68,13 +68,13 @@ public DictionaryPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(DICTIONARY_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final DictionaryDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(DICTIONARY_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/dictionary/client/presenter/DictionaryPresenter.java b/stroom-core-client/src/main/java/stroom/dictionary/client/presenter/DictionaryPresenter.java index 0b9a4014be1..da74d383ddb 100644 --- a/stroom-core-client/src/main/java/stroom/dictionary/client/presenter/DictionaryPresenter.java +++ b/stroom-core-client/src/main/java/stroom/dictionary/client/presenter/DictionaryPresenter.java @@ -128,7 +128,7 @@ protected void onBind() { .create(DICTIONARY_RESOURCE) .method(res -> res.download(docRef)) .onSuccess(result -> ExportFileCompleteUtil.onSuccess(locationManager, this, result)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); })); } diff --git a/stroom-core-client/src/main/java/stroom/dispatch/client/AbstractSubmitCompleteHandler.java b/stroom-core-client/src/main/java/stroom/dispatch/client/AbstractSubmitCompleteHandler.java index 06503cb405e..ec8c3fcb229 100644 --- a/stroom-core-client/src/main/java/stroom/dispatch/client/AbstractSubmitCompleteHandler.java +++ b/stroom-core-client/src/main/java/stroom/dispatch/client/AbstractSubmitCompleteHandler.java @@ -18,8 +18,8 @@ import stroom.task.client.SimpleTask; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.PropertyMap; import stroom.util.shared.ResourceKey; @@ -30,20 +30,20 @@ public abstract class AbstractSubmitCompleteHandler implements SubmitHandler, SubmitCompleteHandler { - private final TaskHandlerFactory taskHandlerFactory; + private final TaskMonitorFactory taskMonitorFactory; private final Task task; - private TaskHandler taskHandler; + private TaskMonitor taskMonitor; public AbstractSubmitCompleteHandler(final String taskName, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { this.task = new SimpleTask(taskName); - this.taskHandlerFactory = taskHandlerFactory; + this.taskMonitorFactory = taskMonitorFactory; } @Override public void onSubmit(final SubmitEvent event) { - taskHandler = taskHandlerFactory.createTaskHandler(); - taskHandler.onStart(task); + taskMonitor = taskMonitorFactory.createTaskMonitor(); + taskMonitor.onStart(task); } @Override @@ -66,7 +66,7 @@ public void onSubmitComplete(final SubmitCompleteEvent event) { } else { onFailure("Unable to read file"); } - taskHandler.onEnd(task); + taskMonitor.onEnd(task); } protected abstract void onSuccess(ResourceKey resourceKey); diff --git a/stroom-core-client/src/main/java/stroom/dispatch/client/QuietTaskListener.java b/stroom-core-client/src/main/java/stroom/dispatch/client/QuietTaskMonitorFactory.java similarity index 54% rename from stroom-core-client/src/main/java/stroom/dispatch/client/QuietTaskListener.java rename to stroom-core-client/src/main/java/stroom/dispatch/client/QuietTaskMonitorFactory.java index b00656a4c83..74180fb4dea 100644 --- a/stroom-core-client/src/main/java/stroom/dispatch/client/QuietTaskListener.java +++ b/stroom-core-client/src/main/java/stroom/dispatch/client/QuietTaskMonitorFactory.java @@ -1,14 +1,14 @@ package stroom.dispatch.client; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; -public class QuietTaskListener implements TaskHandlerFactory { +public class QuietTaskMonitorFactory implements TaskMonitorFactory { @Override - public TaskHandler createTaskHandler() { - return new TaskHandler() { + public TaskMonitor createTaskMonitor() { + return new TaskMonitor() { @Override public void onStart(final Task task) { diff --git a/stroom-core-client/src/main/java/stroom/dispatch/client/RestFactory.java b/stroom-core-client/src/main/java/stroom/dispatch/client/RestFactory.java index 75341beaceb..bcc569ba3af 100644 --- a/stroom-core-client/src/main/java/stroom/dispatch/client/RestFactory.java +++ b/stroom-core-client/src/main/java/stroom/dispatch/client/RestFactory.java @@ -1,6 +1,6 @@ package stroom.dispatch.client; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import org.fusesource.restygwt.client.DirectRestService; @@ -23,9 +23,9 @@ interface MethodExecutor { /** * Set a task listener if we want to listen to the request start and finish events. **/ - TaskExecutor taskHandlerFactory(TaskHandlerFactory taskHandlerFactory); + TaskExecutor taskMonitorFactory(TaskMonitorFactory taskMonitorFactory); - TaskExecutor taskHandlerFactory(TaskHandlerFactory taskHandlerFactory, String taskMessage); + TaskExecutor taskMonitorFactory(TaskMonitorFactory taskMonitorFactory, String taskMessage); MethodExecutor onSuccess(Consumer resultConsumer); diff --git a/stroom-core-client/src/main/java/stroom/dispatch/client/RestFactoryImpl.java b/stroom-core-client/src/main/java/stroom/dispatch/client/RestFactoryImpl.java index bd8b0c96102..021c16bd5e0 100644 --- a/stroom-core-client/src/main/java/stroom/dispatch/client/RestFactoryImpl.java +++ b/stroom-core-client/src/main/java/stroom/dispatch/client/RestFactoryImpl.java @@ -1,9 +1,9 @@ package stroom.dispatch.client; -import stroom.task.client.DefaultTaskListener; +import stroom.task.client.DefaultTaskMonitorFactory; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.GwtNullSafe; import com.google.gwt.core.client.GWT; @@ -98,12 +98,12 @@ public MethodExecutorImpl(final HasHandlers hasHandlers, } @Override - public TaskExecutor taskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - return taskHandlerFactory(taskHandlerFactory, null); + public TaskExecutor taskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + return taskMonitorFactory(taskMonitorFactory, null); } @Override - public TaskExecutor taskHandlerFactory(final TaskHandlerFactory taskHandlerFactory, + public TaskExecutor taskMonitorFactory(final TaskMonitorFactory taskMonitorFactory, final String taskMessage) { return new TaskExecutorImpl<>( hasHandlers, @@ -111,7 +111,7 @@ public TaskExecutor taskHandlerFactory(final TaskHandlerFactory taskHandle function, resultConsumer, errorConsumer, - taskHandlerFactory, + taskMonitorFactory, taskMessage); } @@ -136,7 +136,7 @@ private static class TaskExecutorImpl implements private final Consumer resultConsumer; private final RestErrorHandler errorHandler; - private final TaskHandlerFactory taskHandlerFactory; + private final TaskMonitorFactory taskMonitorFactory; private final Task task; public TaskExecutorImpl(final HasHandlers hasHandlers, @@ -144,14 +144,14 @@ public TaskExecutorImpl(final HasHandlers hasHandlers, final Function function, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory, + final TaskMonitorFactory taskMonitorFactory, final String taskMessage) { this.hasHandlers = hasHandlers; this.service = service; this.function = function; this.resultConsumer = resultConsumer; this.errorHandler = errorHandler; - this.taskHandlerFactory = taskHandlerFactory; + this.taskMonitorFactory = taskMonitorFactory; this.task = new RestFactoryTask<>(service, function, taskMessage); } @@ -159,18 +159,18 @@ public TaskExecutorImpl(final HasHandlers hasHandlers, public void exec() { final RestErrorHandler errorHandler = GwtNullSafe .requireNonNullElseGet(this.errorHandler, () -> new DefaultErrorHandler(hasHandlers, null)); - final TaskHandlerFactory taskHandlerFactory = GwtNullSafe - .requireNonNullElseGet(this.taskHandlerFactory, () -> new DefaultTaskListener(hasHandlers)); + final TaskMonitorFactory taskMonitorFactory = GwtNullSafe + .requireNonNullElseGet(this.taskMonitorFactory, () -> new DefaultTaskMonitorFactory(hasHandlers)); - final TaskHandler taskHandler = taskHandlerFactory.createTaskHandler(); + final TaskMonitor taskMonitor = taskMonitorFactory.createTaskMonitor(); final MethodCallbackImpl methodCallback = new MethodCallbackImpl<>( hasHandlers, resultConsumer, errorHandler, - taskHandler, + taskMonitor, task); final REST rest = REST.withCallback(methodCallback); - taskHandler.onStart(task); + taskMonitor.onStart(task); function.apply(rest.call(service)); } } @@ -186,18 +186,18 @@ private static class MethodCallbackImpl implements MethodCallback { private final HasHandlers hasHandlers; private final Consumer resultConsumer; private final RestErrorHandler errorHandler; - private final TaskHandler taskHandler; + private final TaskMonitor taskMonitor; private final Task task; public MethodCallbackImpl(final HasHandlers hasHandlers, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandler taskHandler, + final TaskMonitor taskMonitor, final Task task) { this.hasHandlers = hasHandlers; this.resultConsumer = resultConsumer; this.errorHandler = errorHandler; - this.taskHandler = taskHandler; + this.taskMonitor = taskMonitor; this.task = task; } @@ -208,7 +208,7 @@ public void onFailure(final Method method, final Throwable throwable) { } catch (final Throwable t) { new DefaultErrorHandler(hasHandlers, null).onError(new RestError(method, t)); } finally { - taskHandler.onEnd(task); + taskMonitor.onEnd(task); } } @@ -221,7 +221,7 @@ public void onSuccess(final Method method, final R response) { } catch (final Throwable t) { new DefaultErrorHandler(hasHandlers, null).onError(new RestError(method, t)); } finally { - taskHandler.onEnd(task); + taskMonitor.onEnd(task); } } } diff --git a/stroom-core-client/src/main/java/stroom/document/client/DocumentPlugin.java b/stroom-core-client/src/main/java/stroom/document/client/DocumentPlugin.java index 2489caede12..0db59a01f87 100644 --- a/stroom-core-client/src/main/java/stroom/document/client/DocumentPlugin.java +++ b/stroom-core-client/src/main/java/stroom/document/client/DocumentPlugin.java @@ -34,11 +34,11 @@ import stroom.explorer.shared.ExplorerNode; import stroom.security.client.api.ClientSecurityContext; import stroom.security.shared.DocumentPermission; -import stroom.task.client.HasTaskHandlerFactory; +import stroom.task.client.HasTaskMonitorFactory; import stroom.task.client.SimpleTask; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import com.google.web.bindery.event.shared.EventBus; import com.gwtplatform.mvp.client.MyPresenterWidget; @@ -99,13 +99,13 @@ public DocumentPlugin(final EventBus eventBus, public MyPresenterWidget open(final DocRef docRef, final boolean forceOpen, final boolean fullScreen, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { MyPresenterWidget presenter = null; - final TaskHandler taskHandler = taskHandlerFactory.createTaskHandler(); + final TaskMonitor taskMonitor = taskMonitorFactory.createTaskMonitor(); final Task task = new SimpleTask("Opening: " + docRef); try { // Start spinning. - taskHandler.onStart(task); + taskMonitor.onStart(task); final DocumentTabData existing = documentToTabDataMap.get(docRef); // If we already have a tab item for this document then make sure it is @@ -124,8 +124,8 @@ public MyPresenterWidget open(final DocRef docRef, final MyPresenterWidget documentEditPresenter = createEditor(); presenter = documentEditPresenter; - if (documentEditPresenter instanceof HasTaskHandlerFactory) { - ((HasTaskHandlerFactory) documentEditPresenter).setTaskHandlerFactory(taskHandlerFactory); + if (documentEditPresenter instanceof HasTaskMonitorFactory) { + ((HasTaskMonitorFactory) documentEditPresenter).setTaskMonitorFactory(taskMonitorFactory); } if (documentEditPresenter instanceof DocumentTabData) { @@ -137,13 +137,13 @@ public MyPresenterWidget open(final DocRef docRef, // Load the document and show the tab. final CloseContentEvent.Handler closeHandler = new EntityCloseHandler(tabData); - showDocument(docRef, documentEditPresenter, closeHandler, tabData, fullScreen, taskHandlerFactory); + showDocument(docRef, documentEditPresenter, closeHandler, tabData, fullScreen, taskMonitorFactory); } } } finally { // Stop spinning. - taskHandler.onEnd(task); + taskMonitor.onEnd(task); } return presenter; @@ -155,7 +155,7 @@ protected void showDocument(final DocRef docRef, final CloseContentEvent.Handler closeHandler, final DocumentTabData tabData, final boolean fullScreen, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { final RestErrorHandler errorHandler = caught -> AlertEvent.fireError( DocumentPlugin.this, @@ -186,7 +186,7 @@ protected void showDocument(final DocRef docRef, } }, throwable -> AlertEvent.fireErrorFromException(this, throwable, null), - taskHandlerFactory); + taskMonitorFactory); } else { // Open the tab. if (fullScreen) { @@ -199,7 +199,7 @@ protected void showDocument(final DocRef docRef, }; // Load the document and show the tab. - load(docRef, loadConsumer, errorHandler, taskHandlerFactory); + load(docRef, loadConsumer, errorHandler, taskMonitorFactory); } private void showFullScreen(final MyPresenterWidget documentEditPresenter) { @@ -522,13 +522,13 @@ private void removeTabData(final DocumentTabData tabData) { public abstract void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory); + final TaskMonitorFactory taskMonitorFactory); public abstract void save(final DocRef docRef, final D document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory); + final TaskMonitorFactory taskMonitorFactory); protected abstract DocRef getDocRef(D document); diff --git a/stroom-core-client/src/main/java/stroom/document/client/DocumentPluginEventManager.java b/stroom-core-client/src/main/java/stroom/document/client/DocumentPluginEventManager.java index 6d61127733f..4445cdf4ffe 100644 --- a/stroom-core-client/src/main/java/stroom/document/client/DocumentPluginEventManager.java +++ b/stroom-core-client/src/main/java/stroom/document/client/DocumentPluginEventManager.java @@ -47,7 +47,7 @@ import stroom.document.client.event.ShowPermissionsDialogEvent; import stroom.document.client.event.ShowRenameDocumentDialogEvent; import stroom.explorer.client.event.CreateNewDocumentEvent; -import stroom.explorer.client.event.ExplorerTaskListener; +import stroom.explorer.client.event.ExplorerTaskMonitorFactory; import stroom.explorer.client.event.ExplorerTreeDeleteEvent; import stroom.explorer.client.event.ExplorerTreeSelectEvent; import stroom.explorer.client.event.HighlightExplorerNodeEvent; @@ -88,8 +88,8 @@ import stroom.security.shared.DocumentPermission; import stroom.svg.client.IconColour; import stroom.svg.shared.SvgImage; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.client.ClipboardUtil; import stroom.util.shared.GwtNullSafe; import stroom.widget.menu.client.presenter.IconMenuItem; @@ -132,7 +132,7 @@ public class DocumentPluginEventManager extends Plugin { private static final ExplorerResource EXPLORER_RESOURCE = GWT.create(ExplorerResource.class); private static final ExplorerFavouriteResource EXPLORER_FAV_RESOURCE = GWT.create(ExplorerFavouriteResource.class); - private final TaskHandlerFactory explorerListener = new ExplorerTaskListener(this); + private final TaskMonitorFactory explorerListener = new ExplorerTaskMonitorFactory(this); private final HasSaveRegistry hasSaveRegistry; private final RestFactory restFactory; @@ -243,7 +243,7 @@ protected void onBind() { explorerNode.getDocRef(), event.getSelectionType().isDoubleSelect(), false, - new DefaultTaskListener(this)); + new DefaultTaskMonitorFactory(this)); } } } @@ -291,9 +291,9 @@ protected void onBind() { final DocumentPlugin plugin = documentPluginRegistry.get(tabData.getType()); if (plugin != null) { // Get the explorer node for the docref. - TaskHandlerFactory taskHandlerFactory = null; - if (tabData instanceof TaskHandlerFactory) { - taskHandlerFactory = (TaskHandlerFactory) tabData; + TaskMonitorFactory taskMonitorFactory = null; + if (tabData instanceof TaskMonitorFactory) { + taskMonitorFactory = (TaskMonitorFactory) tabData; } restFactory @@ -303,7 +303,7 @@ protected void onBind() { // Now we have the explorer node proceed with the save as. plugin.saveAs(tabData, explorerNode); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } })); @@ -556,7 +556,7 @@ private void renameItems(final List explorerNodeList) { } } - private void deleteItems(final List explorerNodeList, final TaskHandlerFactory taskHandlerFactory) { + private void deleteItems(final List explorerNodeList, final TaskMonitorFactory taskMonitorFactory) { if (explorerNodeList != null && explorerNodeList.size() > 0) { final List docRefs = explorerNodeList .stream() @@ -566,7 +566,7 @@ private void deleteItems(final List explorerNodeList, final TaskHa DocumentPluginEventManager.this, docRefs, true, - taskHandlerFactory); + taskMonitorFactory); } } @@ -624,7 +624,7 @@ public void create(final String docType, final ExplorerNode destinationFolder, final PermissionInheritance permissionInheritance, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory, + final TaskMonitorFactory taskMonitorFactory, final HidePopupRequestEvent hidePopupRequestEvent) { restFactory .create(EXPLORER_RESOURCE) @@ -635,7 +635,7 @@ public void create(final String docType, permissionInheritance))) .onSuccess(consumer) .onFailure(new DefaultErrorHandler(this, hidePopupRequestEvent::reset)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -645,7 +645,7 @@ private void copy(final List explorerNodes, final String newName, final PermissionInheritance permissionInheritance, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory, + final TaskMonitorFactory taskMonitorFactory, final HidePopupRequestEvent hidePopupRequestEvent) { restFactory .create(EXPLORER_RESOURCE) @@ -657,7 +657,7 @@ private void copy(final List explorerNodes, permissionInheritance))) .onSuccess(consumer) .onFailure(new DefaultErrorHandler(this, hidePopupRequestEvent::reset)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -665,7 +665,7 @@ private void move(final List explorerNodes, final ExplorerNode destinationFolder, final PermissionInheritance permissionInheritance, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory, + final TaskMonitorFactory taskMonitorFactory, final HidePopupRequestEvent hidePopupRequestEvent) { restFactory .create(EXPLORER_RESOURCE) @@ -675,51 +675,51 @@ private void move(final List explorerNodes, permissionInheritance))) .onSuccess(consumer) .onFailure(new DefaultErrorHandler(this, hidePopupRequestEvent::reset)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } private void rename(final ExplorerNode explorerNode, final String docName, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory, + final TaskMonitorFactory taskMonitorFactory, final HidePopupRequestEvent hidePopupRequestEvent) { restFactory .create(EXPLORER_RESOURCE) .method(res -> res.rename(new ExplorerServiceRenameRequest(explorerNode, docName))) .onSuccess(consumer) .onFailure(new DefaultErrorHandler(this, hidePopupRequestEvent::reset)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void delete(final List docRefs, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(EXPLORER_RESOURCE) .method(res -> res.delete(new ExplorerServiceDeleteRequest(docRefs))) .onSuccess(consumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } private void setAsFavourite(final DocRef docRef, final boolean setFavourite, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { if (setFavourite) { restFactory .create(EXPLORER_FAV_RESOURCE) .call(res -> res.createUserFavourite(docRef)) .onSuccess(result -> RefreshExplorerTreeEvent.fire(DocumentPluginEventManager.this)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } else { restFactory .create(EXPLORER_FAV_RESOURCE) .call(res -> res.deleteUserFavourite(docRef)) .onSuccess(result -> RefreshExplorerTreeEvent.fire(DocumentPluginEventManager.this)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } @@ -727,7 +727,7 @@ private void setAsFavourite(final DocRef docRef, public void open(final DocRef docRef, final boolean forceOpen, final boolean fullScreen, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { final DocumentPlugin documentPlugin = documentPluginRegistry.get(docRef.getType()); if (documentPlugin != null) { // Decorate the DocRef with its name from the info service (required by the doc presenter) @@ -737,11 +737,11 @@ public void open(final DocRef docRef, .onSuccess(decoratedDocRef -> { if (decoratedDocRef != null) { documentPlugin.open(decoratedDocRef, forceOpen, fullScreen, - new DefaultTaskListener(this)); + new DefaultTaskMonitorFactory(this)); highlight(decoratedDocRef, explorerListener); } }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } else { throw new IllegalArgumentException("Document type '" + docRef.getType() + "' not registered"); @@ -756,13 +756,13 @@ public void highlight(final ExplorerNode explorerNode) { } public void highlight(final DocRef docRef, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { // Obtain the Explorer node for the provided DocRef restFactory .create(EXPLORER_RESOURCE) .method(res -> res.getFromDocRef(docRef)) .onSuccess(this::highlight) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -844,7 +844,7 @@ private Future> getNewMenuItems(final ExplorerNode explorerNode) { private void fetchPermissions(final List explorerNodes, final Consumer> consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(EXPLORER_RESOURCE) .method(res -> res.fetchExplorerPermissions(explorerNodes)) @@ -854,7 +854,7 @@ private void fetchPermissions(final List explorerNodes, Function.identity())); consumer.accept(map); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -966,7 +966,7 @@ private void fireShowCreateDocumentDialogEvent(final DocumentType documentType, // Open the document in the content pane. final DocumentPlugin plugin = documentPluginRegistry.get(docRef.getType()); if (plugin != null) { - plugin.open(docRef, true, false, new DefaultTaskListener(this)); + plugin.open(docRef, true, false, new DefaultTaskMonitorFactory(this)); } }; @@ -1186,7 +1186,7 @@ private DocRef getSelectedDoc(final TabData selectedTab) { private MenuItem createInfoMenuItem(final ExplorerNode explorerNode, final int priority, final boolean enabled, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { final Command command; if (enabled && explorerNode != null) { command = () -> { @@ -1201,7 +1201,7 @@ private MenuItem createInfoMenuItem(final ExplorerNode explorerNode, explorerNodeInfo); }) .onFailure(this::handleFailure) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); }; } else { diff --git a/stroom-core-client/src/main/java/stroom/document/client/event/DeleteDocumentEvent.java b/stroom-core-client/src/main/java/stroom/document/client/event/DeleteDocumentEvent.java index b187aaf9387..68742c2ee65 100644 --- a/stroom-core-client/src/main/java/stroom/document/client/event/DeleteDocumentEvent.java +++ b/stroom-core-client/src/main/java/stroom/document/client/event/DeleteDocumentEvent.java @@ -18,7 +18,7 @@ package stroom.document.client.event; import stroom.docref.DocRef; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.GwtEvent; @@ -32,31 +32,31 @@ public class DeleteDocumentEvent extends GwtEvent { private final List docRefs; private final boolean confirm; private final ResultCallback callback; - private final TaskHandlerFactory taskHandlerFactory; + private final TaskMonitorFactory taskMonitorFactory; private DeleteDocumentEvent(final List docRefs, final boolean confirm, final ResultCallback callback, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { this.docRefs = docRefs; this.confirm = confirm; this.callback = callback; - this.taskHandlerFactory = taskHandlerFactory; + this.taskMonitorFactory = taskMonitorFactory; } public static void fire(final HasHandlers handlers, final List docRefs, final boolean confirm, - final TaskHandlerFactory taskHandlerFactory) { - handlers.fireEvent(new DeleteDocumentEvent(docRefs, confirm, null, taskHandlerFactory)); + final TaskMonitorFactory taskMonitorFactory) { + handlers.fireEvent(new DeleteDocumentEvent(docRefs, confirm, null, taskMonitorFactory)); } public static void fire(final HasHandlers handlers, final List docRefs, final boolean confirm, final ResultCallback callback, - final TaskHandlerFactory taskHandlerFactory) { - handlers.fireEvent(new DeleteDocumentEvent(docRefs, confirm, callback, taskHandlerFactory)); + final TaskMonitorFactory taskMonitorFactory) { + handlers.fireEvent(new DeleteDocumentEvent(docRefs, confirm, callback, taskMonitorFactory)); } public static Type getType() { @@ -88,8 +88,8 @@ public ResultCallback getCallback() { return callback; } - public TaskHandlerFactory getTaskHandlerFactory() { - return taskHandlerFactory; + public TaskMonitorFactory getTaskMonitorFactory() { + return taskMonitorFactory; } public interface Handler extends EventHandler { diff --git a/stroom-core-client/src/main/java/stroom/documentation/client/DocumentationPlugin.java b/stroom-core-client/src/main/java/stroom/documentation/client/DocumentationPlugin.java index 1e3cd742cef..b46422077c1 100644 --- a/stroom-core-client/src/main/java/stroom/documentation/client/DocumentationPlugin.java +++ b/stroom-core-client/src/main/java/stroom/documentation/client/DocumentationPlugin.java @@ -29,7 +29,7 @@ import stroom.documentation.shared.DocumentationResource; import stroom.entity.client.presenter.DocumentEditPresenter; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -68,13 +68,13 @@ public DocumentationPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(DOCUMENTATION_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final DocumentationDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(DOCUMENTATION_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/documentation/client/presenter/DocumentationPresenter.java b/stroom-core-client/src/main/java/stroom/documentation/client/presenter/DocumentationPresenter.java index d73b3c22563..3cf0c460cf4 100644 --- a/stroom-core-client/src/main/java/stroom/documentation/client/presenter/DocumentationPresenter.java +++ b/stroom-core-client/src/main/java/stroom/documentation/client/presenter/DocumentationPresenter.java @@ -94,7 +94,7 @@ protected void onBind() { .create(DOCUMENTATION_RESOURCE) .method(res -> res.download(docRef)) .onSuccess(result -> ExportFileCompleteUtil.onSuccess(locationManager, this, result)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); })); } diff --git a/stroom-core-client/src/main/java/stroom/entity/client/presenter/CopyDocumentPresenter.java b/stroom-core-client/src/main/java/stroom/entity/client/presenter/CopyDocumentPresenter.java index 0cffb3d57db..0d476a283f3 100644 --- a/stroom-core-client/src/main/java/stroom/entity/client/presenter/CopyDocumentPresenter.java +++ b/stroom-core-client/src/main/java/stroom/entity/client/presenter/CopyDocumentPresenter.java @@ -28,7 +28,7 @@ import stroom.explorer.shared.ExplorerNode; import stroom.explorer.shared.PermissionInheritance; import stroom.security.shared.DocumentPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.popup.client.event.ShowPopupEvent; import stroom.widget.popup.client.presenter.PopupSize; import stroom.widget.popup.client.presenter.PopupType; @@ -136,9 +136,9 @@ protected void revealInParent() { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - entityTreePresenter.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + entityTreePresenter.setTaskMonitorFactory(taskMonitorFactory); } public interface CopyDocumentView extends View { diff --git a/stroom-core-client/src/main/java/stroom/entity/client/presenter/CreateDocumentPresenter.java b/stroom-core-client/src/main/java/stroom/entity/client/presenter/CreateDocumentPresenter.java index ec35b2ed1f3..66d7e1f7b74 100644 --- a/stroom-core-client/src/main/java/stroom/entity/client/presenter/CreateDocumentPresenter.java +++ b/stroom-core-client/src/main/java/stroom/entity/client/presenter/CreateDocumentPresenter.java @@ -27,7 +27,7 @@ import stroom.explorer.shared.ExplorerNode; import stroom.explorer.shared.PermissionInheritance; import stroom.security.shared.DocumentPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.popup.client.event.DialogEvent; import stroom.widget.popup.client.event.HidePopupRequestEvent; import stroom.widget.popup.client.event.ShowPopupEvent; @@ -158,9 +158,9 @@ private ExplorerNode getFolder() { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - entityTreePresenter.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + entityTreePresenter.setTaskMonitorFactory(taskMonitorFactory); } // -------------------------------------------------------------------------------- diff --git a/stroom-core-client/src/main/java/stroom/entity/client/presenter/DocumentEditTabPresenter.java b/stroom-core-client/src/main/java/stroom/entity/client/presenter/DocumentEditTabPresenter.java index 24e30d28701..546ae116216 100644 --- a/stroom-core-client/src/main/java/stroom/entity/client/presenter/DocumentEditTabPresenter.java +++ b/stroom-core-client/src/main/java/stroom/entity/client/presenter/DocumentEditTabPresenter.java @@ -31,7 +31,7 @@ import stroom.svg.shared.SvgImage; import stroom.task.client.SimpleTask; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.button.client.ButtonPanel; import stroom.widget.button.client.ButtonView; import stroom.widget.button.client.SvgButton; @@ -121,9 +121,9 @@ private void getContent(TabData tab, ContentCallback callback) { } public void selectTab(final TabData tab) { - final TaskHandler taskHandler = createTaskHandler(); + final TaskMonitor taskMonitor = createTaskMonitor(); final Task task = new SimpleTask("Selecting tab"); - taskHandler.onStart(task); + taskMonitor.onStart(task); Scheduler.get().scheduleDeferred(() -> { if (tab != null) { getContent(tab, content -> { @@ -155,7 +155,7 @@ public void selectTab(final TabData tab) { } }); } - taskHandler.onEnd(task); + taskMonitor.onEnd(task); }); } diff --git a/stroom-core-client/src/main/java/stroom/entity/client/presenter/LinkTabPanelPresenter.java b/stroom-core-client/src/main/java/stroom/entity/client/presenter/LinkTabPanelPresenter.java index adaae139e31..2d30af0b576 100644 --- a/stroom-core-client/src/main/java/stroom/entity/client/presenter/LinkTabPanelPresenter.java +++ b/stroom-core-client/src/main/java/stroom/entity/client/presenter/LinkTabPanelPresenter.java @@ -19,7 +19,7 @@ import stroom.data.table.client.Refreshable; import stroom.task.client.SimpleTask; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.tab.client.presenter.TabData; import com.google.gwt.core.client.Scheduler; @@ -46,9 +46,9 @@ public void addTab(final TabData tab) { protected abstract void getContent(TabData tab, ContentCallback callback); public void selectTab(final TabData tab) { - final TaskHandler taskHandler = createTaskHandler(); + final TaskMonitor taskMonitor = createTaskMonitor(); final Task task = new SimpleTask("Select tab"); - taskHandler.onStart(task); + taskMonitor.onStart(task); Scheduler.get().scheduleDeferred(() -> { if (tab != null) { getContent(tab, content -> { @@ -66,7 +66,7 @@ public void selectTab(final TabData tab) { } }); } - taskHandler.onEnd(task); + taskMonitor.onEnd(task); }); } diff --git a/stroom-core-client/src/main/java/stroom/entity/client/presenter/MoveDocumentPresenter.java b/stroom-core-client/src/main/java/stroom/entity/client/presenter/MoveDocumentPresenter.java index 62f8d0cf86e..03cd5efefa6 100644 --- a/stroom-core-client/src/main/java/stroom/entity/client/presenter/MoveDocumentPresenter.java +++ b/stroom-core-client/src/main/java/stroom/entity/client/presenter/MoveDocumentPresenter.java @@ -27,7 +27,7 @@ import stroom.explorer.shared.ExplorerNode; import stroom.explorer.shared.PermissionInheritance; import stroom.security.shared.DocumentPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.popup.client.event.ShowPopupEvent; import stroom.widget.popup.client.presenter.PopupSize; import stroom.widget.popup.client.presenter.PopupType; @@ -118,9 +118,9 @@ protected void revealInParent() { @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - entityTreePresenter.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + entityTreePresenter.setTaskMonitorFactory(taskMonitorFactory); } diff --git a/stroom-core-client/src/main/java/stroom/entity/client/presenter/TabContentProvider.java b/stroom-core-client/src/main/java/stroom/entity/client/presenter/TabContentProvider.java index 2c44f7c1c71..55a16b63d07 100644 --- a/stroom-core-client/src/main/java/stroom/entity/client/presenter/TabContentProvider.java +++ b/stroom-core-client/src/main/java/stroom/entity/client/presenter/TabContentProvider.java @@ -21,8 +21,8 @@ import stroom.document.client.event.DirtyEvent; import stroom.document.client.event.DirtyEvent.DirtyHandler; import stroom.document.client.event.HasDirtyHandlers; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.tab.client.presenter.TabData; import com.google.gwt.event.shared.GwtEvent; @@ -91,7 +91,7 @@ public void add(final TabData tab, final TabProvider provider) { tabProviders.put(tab, provider); } - public PresenterWidget getPresenter(final TabData tab, final TaskHandlerFactory taskHandlerFactory) { + public PresenterWidget getPresenter(final TabData tab, final TaskMonitorFactory taskMonitorFactory) { currentTabProvider = presenterCache.get(tab); if (currentTabProvider == null) { final TabProvider provider = tabProviders.get(tab); @@ -103,13 +103,13 @@ public PresenterWidget getPresenter(final TabData tab, final TaskHandlerFacto // Handle dirty events. registerHandler(currentTabProvider.addDirtyHandler(this::fireEvent)); - if (currentTabProvider instanceof HasTaskHandlerFactory) { - ((HasTaskHandlerFactory) currentTabProvider) - .setTaskHandlerFactory(taskHandlerFactory); + if (currentTabProvider instanceof HasTaskMonitorFactory) { + ((HasTaskMonitorFactory) currentTabProvider) + .setTaskMonitorFactory(taskMonitorFactory); } - if (currentTabProvider.getPresenter() instanceof HasTaskHandlerFactory) { - ((HasTaskHandlerFactory) currentTabProvider.getPresenter()) - .setTaskHandlerFactory(taskHandlerFactory); + if (currentTabProvider.getPresenter() instanceof HasTaskMonitorFactory) { + ((HasTaskMonitorFactory) currentTabProvider.getPresenter()) + .setTaskMonitorFactory(taskMonitorFactory); } } } diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/event/ExplorerTaskListener.java b/stroom-core-client/src/main/java/stroom/explorer/client/event/ExplorerTaskMonitorFactory.java similarity index 54% rename from stroom-core-client/src/main/java/stroom/explorer/client/event/ExplorerTaskListener.java rename to stroom-core-client/src/main/java/stroom/explorer/client/event/ExplorerTaskMonitorFactory.java index f687fdfdf63..aa4f78d9210 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/event/ExplorerTaskListener.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/event/ExplorerTaskMonitorFactory.java @@ -1,31 +1,31 @@ package stroom.explorer.client.event; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitor; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.HasHandlers; -public class ExplorerTaskListener implements TaskHandlerFactory, HasHandlers { +public class ExplorerTaskMonitorFactory implements TaskMonitorFactory, HasHandlers { private final HasHandlers hasHandlers; - public ExplorerTaskListener(final HasHandlers hasHandlers) { + public ExplorerTaskMonitorFactory(final HasHandlers hasHandlers) { this.hasHandlers = hasHandlers; } @Override - public TaskHandler createTaskHandler() { - return new TaskHandler() { + public TaskMonitor createTaskMonitor() { + return new TaskMonitor() { @Override public void onStart(final Task task) { - ExplorerStartTaskEvent.fire(ExplorerTaskListener.this, task); + ExplorerStartTaskEvent.fire(ExplorerTaskMonitorFactory.this, task); } @Override public void onEnd(final Task task) { - ExplorerEndTaskEvent.fire(ExplorerTaskListener.this, task); + ExplorerEndTaskEvent.fire(ExplorerTaskMonitorFactory.this, task); } }; } diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/AbstractExplorerTree.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/AbstractExplorerTree.java index 123bae9aa00..55a3eb0c352 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/AbstractExplorerTree.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/AbstractExplorerTree.java @@ -23,7 +23,7 @@ import stroom.explorer.shared.ExplorerNode; import stroom.explorer.shared.FetchExplorerNodeResult; import stroom.explorer.shared.NodeFlag; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.EqualsUtil; import stroom.widget.popup.client.presenter.PopupPosition; import stroom.widget.util.client.AbstractSelectionEventManager; @@ -73,7 +73,7 @@ public abstract class AbstractExplorerTree extends Composite implements Focus { private Consumer changeHandler = null; AbstractExplorerTree(final RestFactory restFactory, - final TaskHandlerFactory taskHandlerFactory, + final TaskMonitorFactory taskMonitorFactory, final boolean allowMultiSelect, final boolean showAlerts) { this.allowMultiSelect = allowMultiSelect; @@ -95,7 +95,7 @@ public ExplorerNode getValue(ExplorerNode object) { new ExplorerTreeSelectionEventManager(cellTable); cellTable.setSelectionModel(selectionModel, selectionEventManager); - treeModel = new ExplorerTreeModel(this, restFactory, taskHandlerFactory) { + treeModel = new ExplorerTreeModel(this, restFactory, taskMonitorFactory) { @Override protected void onDataChanged(final FetchExplorerNodeResult result) { onData(result); diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentListPresenter.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentListPresenter.java index aab4fb5cd56..1bbdb1cceef 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentListPresenter.java @@ -117,7 +117,7 @@ protected void exec(final Range range, resetFocus(); }) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } }; diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentPermissionsListPresenter.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentPermissionsListPresenter.java index ae521eabca1..91f4f5214b0 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentPermissionsListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentPermissionsListPresenter.java @@ -258,7 +258,7 @@ protected void exec(final Range range, resetFocus(); }) .onFailure(errorHandler) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }; diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentTypeCache.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentTypeCache.java index c5d3174075c..e3b8cec8685 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentTypeCache.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/DocumentTypeCache.java @@ -19,7 +19,7 @@ import stroom.dispatch.client.RestFactory; import stroom.explorer.shared.DocumentTypes; import stroom.explorer.shared.ExplorerResource; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; @@ -43,7 +43,7 @@ public void clear() { } public void fetch(final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { // Get the document types if they are null. if (documentTypes == null) { restFactory @@ -53,7 +53,7 @@ public void fetch(final Consumer consumer, documentTypes = result; consumer.accept(result); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } else { consumer.accept(documentTypes); diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerNodeEditTagsPresenter.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerNodeEditTagsPresenter.java index 3c0c64c2ba2..49d4f4fe34b 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerNodeEditTagsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerNodeEditTagsPresenter.java @@ -23,7 +23,7 @@ import stroom.dispatch.client.RestFactory; import stroom.docref.DocRef; import stroom.document.client.event.RefreshDocumentEvent; -import stroom.explorer.client.event.ExplorerTaskListener; +import stroom.explorer.client.event.ExplorerTaskMonitorFactory; import stroom.explorer.client.event.ShowEditNodeTagsDialogEvent; import stroom.explorer.client.presenter.ExplorerNodeEditTagsPresenter.ExplorerNodeEditTagsProxy; import stroom.explorer.client.presenter.ExplorerNodeEditTagsPresenter.ExplorerNodeEditTagsView; @@ -105,7 +105,7 @@ public void onCreate(final ShowEditNodeTagsDialogEvent event) { forceReveal(); }) .onFailure(this::handleFailure) - .taskHandlerFactory(new ExplorerTaskListener(this)) + .taskMonitorFactory(new ExplorerTaskMonitorFactory(this)) .exec(); } else { // Adding to multiple so don't need to know what tags the nodes have @@ -114,7 +114,7 @@ public void onCreate(final ShowEditNodeTagsDialogEvent event) { } }) .onFailure(this::handleFailure) - .taskHandlerFactory(new ExplorerTaskListener(this)) + .taskMonitorFactory(new ExplorerTaskMonitorFactory(this)) .exec(); } @@ -184,7 +184,7 @@ private void addTagsToNodes(final HidePopupRequestEvent event, final Set event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -203,7 +203,7 @@ private void updateTagsOnNode(final HidePopupRequestEvent event, final Set res.getFromDocRef(docRef)) .onSuccess(this::setSelectedEntityData) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -273,8 +273,8 @@ private static class ExtendedExplorerTree extends ExplorerTree { public ExtendedExplorerTree(final ExplorerPopupPresenter explorerDropDownTreePresenter, final RestFactory restFactory, - final TaskHandlerFactory taskHandlerFactory) { - super(restFactory, taskHandlerFactory, false, false); + final TaskMonitorFactory taskMonitorFactory) { + super(restFactory, taskMonitorFactory, false, false); this.explorerDropDownTreePresenter = explorerDropDownTreePresenter; this.getTreeModel().setIncludedRootTypes(ExplorerConstants.SYSTEM); } diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTickBoxTree.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTickBoxTree.java index 4da6bf7ac71..4f73530bfcd 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTickBoxTree.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTickBoxTree.java @@ -20,7 +20,7 @@ import stroom.dispatch.client.RestFactory; import stroom.explorer.shared.ExplorerNode; import stroom.explorer.shared.FetchExplorerNodeResult; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.util.client.MultiSelectionModelImpl; import stroom.widget.util.client.SelectionType; @@ -35,8 +35,8 @@ public class ExplorerTickBoxTree extends AbstractExplorerTree { private List rootNodes; public ExplorerTickBoxTree(final RestFactory restFactory, - final TaskHandlerFactory taskHandlerFactory) { - super(restFactory, taskHandlerFactory, false, true); + final TaskMonitorFactory taskMonitorFactory) { + super(restFactory, taskMonitorFactory, false, true); } @Override diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTree.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTree.java index b6e3ed3498c..7bd3692d427 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTree.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTree.java @@ -18,7 +18,7 @@ import stroom.dispatch.client.RestFactory; import stroom.explorer.shared.ExplorerNode; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.util.client.MultiSelectionModelImpl; @@ -27,10 +27,10 @@ public class ExplorerTree extends AbstractExplorerTree { private MultiSelectionModelImpl multiSelectionModel; public ExplorerTree(final RestFactory restFactory, - final TaskHandlerFactory taskHandlerFactory, + final TaskMonitorFactory taskMonitorFactory, final boolean allowMultiSelect, final boolean showAlerts) { - super(restFactory, taskHandlerFactory, allowMultiSelect, showAlerts); + super(restFactory, taskMonitorFactory, allowMultiSelect, showAlerts); } @Override diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTreeModel.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTreeModel.java index 94db49470ae..986949a8f05 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTreeModel.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/ExplorerTreeModel.java @@ -28,7 +28,7 @@ import stroom.explorer.shared.NodeFlag; import stroom.explorer.shared.NodeFlag.NodeFlagGroups; import stroom.security.shared.DocumentPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.GwtNullSafe; import com.google.gwt.core.client.GWT; @@ -56,7 +56,7 @@ public class ExplorerTreeModel { private final ExplorerTreeFilter.Builder explorerTreeFilterBuilder = ExplorerTreeFilter.builder(); private final AbstractExplorerTree explorerTree; private final RestFactory restFactory; - private final TaskHandlerFactory taskHandlerFactory; + private final TaskMonitorFactory taskMonitorFactory; private Integer minDepth = 1; private Set ensureVisible; @@ -72,10 +72,10 @@ public class ExplorerTreeModel { ExplorerTreeModel(final AbstractExplorerTree explorerTree, final RestFactory restFactory, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { this.explorerTree = explorerTree; this.restFactory = restFactory; - this.taskHandlerFactory = taskHandlerFactory; + this.taskMonitorFactory = taskMonitorFactory; } /** @@ -191,7 +191,7 @@ private void fetchData() { .onSuccess(result -> { handleFetchResult(criteria, result); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); }); } diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindDocResultListPresenter.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindDocResultListPresenter.java index ec2eeb03212..51415b2602e 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindDocResultListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindDocResultListPresenter.java @@ -130,7 +130,7 @@ protected void exec(final Range range, resetFocus(); }) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindInContentPresenter.java b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindInContentPresenter.java index 617f3dff2a5..d9e51066f64 100644 --- a/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindInContentPresenter.java +++ b/stroom-core-client/src/main/java/stroom/explorer/client/presenter/FindInContentPresenter.java @@ -15,7 +15,7 @@ import stroom.explorer.shared.FetchHighlightsRequest; import stroom.explorer.shared.FindInContentRequest; import stroom.explorer.shared.FindInContentResult; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.client.TextRangeUtil; import stroom.util.shared.GwtNullSafe; import stroom.util.shared.PageRequest; @@ -158,7 +158,7 @@ protected void exec(final Range range, resetFocus(); }) .onFailure(errorHandler) - .taskHandlerFactory(pagerView) + .taskMonitorFactory(pagerView) .exec(); } } @@ -210,7 +210,7 @@ private void showHighlights(final FindInContentResult selection) { } }) .onFailure(throwable -> editorPresenter.setText(throwable.getMessage())) - .taskHandlerFactory(getView().getTaskListener()) + .taskMonitorFactory(getView().getTaskListener()) .exec(); } } @@ -301,6 +301,6 @@ public interface FindInContentView extends View, Focus, HasUiHandlers - taskHandler.onStart(e.getTask()))); + taskMonitor.onStart(e.getTask()))); registerHandler(getEventBus().addHandler(ExplorerEndTaskEvent.getType(), e -> - taskHandler.onEnd(e.getTask()))); + taskMonitor.onEnd(e.getTask()))); registerHandler(typeFilterPresenter.addDataSelectionHandler(event -> explorerTree.setIncludedTypeSet( typeFilterPresenter.getIncludedTypes().orElse(null)))); @@ -501,6 +501,6 @@ public interface NavigationView extends View, HasUiHandlers resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(FEED_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final FeedDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(FEED_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/feed/client/presenter/FeedSettingsPresenter.java b/stroom-core-client/src/main/java/stroom/feed/client/presenter/FeedSettingsPresenter.java index 0a51db8aa77..1d8fdd93b8b 100644 --- a/stroom-core-client/src/main/java/stroom/feed/client/presenter/FeedSettingsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/feed/client/presenter/FeedSettingsPresenter.java @@ -128,7 +128,7 @@ private void updateEncodings() { getView().getContextEncoding().setValue(ensureEncoding(feed.getContextEncoding())); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -150,7 +150,7 @@ private void updateVolumeGroups() { getView().getVolumeGroup().setValue(feed.getVolumeGroup()); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/folder/client/FolderPlugin.java b/stroom-core-client/src/main/java/stroom/folder/client/FolderPlugin.java index 6cb9d24fbf6..fc1c6847f9c 100644 --- a/stroom-core-client/src/main/java/stroom/folder/client/FolderPlugin.java +++ b/stroom-core-client/src/main/java/stroom/folder/client/FolderPlugin.java @@ -27,7 +27,7 @@ import stroom.explorer.shared.ExplorerConstants; import stroom.security.client.api.ClientSecurityContext; import stroom.security.shared.AppPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.inject.Inject; import com.google.inject.Provider; @@ -70,7 +70,7 @@ protected MyPresenterWidget createEditor() { public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { } @@ -79,7 +79,7 @@ public void save(final DocRef docRef, final DocRef document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { } @@ -89,7 +89,7 @@ protected void showDocument(final DocRef docRef, final Handler closeHandler, final DocumentTabData tabData, final boolean fullScreen, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { if (documentEditPresenter instanceof FolderPresenter) { ((FolderPresenter) documentEditPresenter).read(docRef); } else if (documentEditPresenter instanceof FolderRootPresenter) { diff --git a/stroom-core-client/src/main/java/stroom/folder/client/FolderRootPlugin.java b/stroom-core-client/src/main/java/stroom/folder/client/FolderRootPlugin.java index 36a7bda1d6a..c9301282dc6 100644 --- a/stroom-core-client/src/main/java/stroom/folder/client/FolderRootPlugin.java +++ b/stroom-core-client/src/main/java/stroom/folder/client/FolderRootPlugin.java @@ -28,7 +28,7 @@ import stroom.security.client.api.ClientSecurityContext; import stroom.security.shared.AppPermission; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.tab.client.presenter.TabData; import com.google.inject.Inject; @@ -109,7 +109,7 @@ protected FolderRootPresenter createEditor() { public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { // Root folder is just a constant so no load needed // resultConsumer.accept(ExplorerConstants.SYSTEM_DOC_REF); } @@ -119,7 +119,7 @@ public void save(final DocRef docRef, final DocRef document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { // Nothing to do here, root folder is special } @@ -129,7 +129,7 @@ protected void showDocument(final DocRef docRef, final Handler closeHandler, final DocumentTabData tabData, final boolean fullScreen, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { if (documentEditPresenter instanceof FolderRootPresenter) { ((FolderRootPresenter) documentEditPresenter).read(); } diff --git a/stroom-core-client/src/main/java/stroom/help/client/HelpPlugin.java b/stroom-core-client/src/main/java/stroom/help/client/HelpPlugin.java index b92726877ec..1d431e33b96 100644 --- a/stroom-core-client/src/main/java/stroom/help/client/HelpPlugin.java +++ b/stroom-core-client/src/main/java/stroom/help/client/HelpPlugin.java @@ -20,7 +20,7 @@ import stroom.core.client.presenter.Plugin; import stroom.menubar.client.event.BeforeRevealMenubarEvent; import stroom.svg.shared.SvgImage; -import stroom.task.client.DefaultTaskListener; +import stroom.task.client.DefaultTaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.util.shared.GwtNullSafe; import stroom.widget.menu.client.presenter.IconMenuItem; @@ -67,7 +67,7 @@ public void onReveal(final BeforeRevealMenubarEvent event) { event.getMenuItems().addMenuItem(MenuKeys.HELP_MENU, helpMenuItem); } - }, new DefaultTaskListener(this)); + }, new DefaultTaskMonitorFactory(this)); final IconMenuItem apiMenuItem = new IconMenuItem.Builder() .priority(2) diff --git a/stroom-core-client/src/main/java/stroom/hyperlink/client/HyperlinkEventHandlerImpl.java b/stroom-core-client/src/main/java/stroom/hyperlink/client/HyperlinkEventHandlerImpl.java index 3effb097ebb..d6bd6c1e3f6 100644 --- a/stroom-core-client/src/main/java/stroom/hyperlink/client/HyperlinkEventHandlerImpl.java +++ b/stroom-core-client/src/main/java/stroom/hyperlink/client/HyperlinkEventHandlerImpl.java @@ -16,7 +16,7 @@ import stroom.pipeline.shared.stepping.StepLocation; import stroom.pipeline.shared.stepping.StepType; import stroom.pipeline.stepping.client.event.BeginPipelineSteppingEvent; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.DefaultLocation; import stroom.util.shared.TextRange; import stroom.widget.popup.client.event.RenamePopupEvent; @@ -135,7 +135,7 @@ public void onLink(final HyperlinkEvent event) { break; } case ANNOTATION: { - openAnnotation(href, event.getTaskHandlerFactory()); + openAnnotation(href, event.getTaskMonitorFactory()); break; } default: @@ -146,7 +146,7 @@ public void onLink(final HyperlinkEvent event) { } } - private void openAnnotation(final String href, final TaskHandlerFactory taskHandlerFactory) { + private void openAnnotation(final String href, final TaskMonitorFactory taskMonitorFactory) { final Long annotationId = getLongParam(href, "annotationId"); final Long streamId = getLongParam(href.toLowerCase(Locale.ROOT), "streamId".toLowerCase(Locale.ROOT)); final Long eventId = getLongParam(href.toLowerCase(Locale.ROOT), "eventId".toLowerCase(Locale.ROOT)); diff --git a/stroom-core-client/src/main/java/stroom/importexport/client/presenter/DependenciesPresenter.java b/stroom-core-client/src/main/java/stroom/importexport/client/presenter/DependenciesPresenter.java index d5f698c987e..ce7d5bb5563 100644 --- a/stroom-core-client/src/main/java/stroom/importexport/client/presenter/DependenciesPresenter.java +++ b/stroom-core-client/src/main/java/stroom/importexport/client/presenter/DependenciesPresenter.java @@ -116,7 +116,7 @@ protected void exec(final Range range, .method(res -> res.fetchDependencies(criteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } }; @@ -308,7 +308,7 @@ private void refreshDocTypeIcons() { "ProcessorFilter", SvgImage.FILTER); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/importexport/client/presenter/DependenciesTabPresenter.java b/stroom-core-client/src/main/java/stroom/importexport/client/presenter/DependenciesTabPresenter.java index 28c1d228b97..9008db979bb 100644 --- a/stroom-core-client/src/main/java/stroom/importexport/client/presenter/DependenciesTabPresenter.java +++ b/stroom-core-client/src/main/java/stroom/importexport/client/presenter/DependenciesTabPresenter.java @@ -4,7 +4,7 @@ import stroom.importexport.client.presenter.DependenciesTabPresenter.DependenciesTabView; import stroom.importexport.shared.DependencyCriteria; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.util.shared.GwtNullSafe; import stroom.widget.dropdowntree.client.view.QuickFilterTooltipUtil; @@ -89,9 +89,9 @@ public boolean handleKeyAction(final Action action) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - dependenciesPresenter.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + dependenciesPresenter.setTaskMonitorFactory(taskMonitorFactory); } // -------------------------------------------------------------------------------- diff --git a/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ExportConfigPresenter.java b/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ExportConfigPresenter.java index ff40de17569..93e71d663bb 100644 --- a/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ExportConfigPresenter.java +++ b/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ExportConfigPresenter.java @@ -193,7 +193,7 @@ private void export(final HidePopupRequestEvent event) { event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ImportConfigConfirmPresenter.java b/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ImportConfigConfirmPresenter.java index 482ca421909..e13e8892785 100644 --- a/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ImportConfigConfirmPresenter.java +++ b/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ImportConfigConfirmPresenter.java @@ -184,7 +184,7 @@ public void refresh() { updateList(); }) .onFailure(caught -> error(caught.getMessage())) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -454,7 +454,7 @@ public void abortImport(final HidePopupRequestEvent e) { .onFailure(caught -> AlertEvent.fireError(ImportConfigConfirmPresenter.this, caught.getMessage(), e::hide)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -486,7 +486,7 @@ public void importData(final HidePopupRequestEvent e) { // existing one. clearCaches(); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ImportConfigPresenter.java b/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ImportConfigPresenter.java index 7d4fb718279..ebd07d0b0f7 100644 --- a/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ImportConfigPresenter.java +++ b/stroom-core-client/src/main/java/stroom/importexport/client/presenter/ImportConfigPresenter.java @@ -89,7 +89,7 @@ protected void onSuccess(final ResourceKey resourceKey) { } }) .onFailure(caught -> error(caught.getMessage())) - .taskHandlerFactory(ImportConfigPresenter.this) + .taskMonitorFactory(ImportConfigPresenter.this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/index/client/IndexPlugin.java b/stroom-core-client/src/main/java/stroom/index/client/IndexPlugin.java index bc175293fc0..395344644b0 100644 --- a/stroom-core-client/src/main/java/stroom/index/client/IndexPlugin.java +++ b/stroom-core-client/src/main/java/stroom/index/client/IndexPlugin.java @@ -12,7 +12,7 @@ import stroom.index.shared.IndexResource; import stroom.index.shared.LuceneIndexDoc; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -51,13 +51,13 @@ public IndexPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(INDEX_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -66,13 +66,13 @@ public void save(final DocRef docRef, final LuceneIndexDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(INDEX_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexSettingsPresenter.java b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexSettingsPresenter.java index 316bff8ad41..8e31894e999 100644 --- a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexSettingsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexSettingsPresenter.java @@ -132,7 +132,7 @@ private void updateGroupList(final String selected) { listBox.setValue(selected); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexShardPresenter.java b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexShardPresenter.java index cf2467c2bd1..e7740dcbc8c 100644 --- a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexShardPresenter.java +++ b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexShardPresenter.java @@ -442,7 +442,7 @@ protected void exec(final Range range, .method(res -> res.find(queryCriteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } @@ -552,7 +552,7 @@ private void doFlush() { .create(INDEX_RESOURCE) .method(res -> res.flushIndexShards(nodeName, selectionCriteria)) .onSuccess(result -> delayedUpdate.update()) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); }), throwable -> { }, getView()); @@ -569,7 +569,7 @@ private void doDelete() { .create(INDEX_RESOURCE) .method(res -> res.deleteIndexShards(nodeName, selectionCriteria)) .onSuccess(result -> delayedUpdate.update()) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); }), throwable -> { }, getView()); diff --git a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeEditPresenter.java b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeEditPresenter.java index e2d7cabd54d..458f8a18276 100644 --- a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeEditPresenter.java @@ -27,7 +27,7 @@ import stroom.index.shared.IndexVolumeResource; import stroom.item.client.SelectionBox; import stroom.node.client.NodeManager; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.ModelStringUtil; import stroom.widget.popup.client.event.HidePopupRequestEvent; import stroom.widget.popup.client.event.ShowPopupEvent; @@ -67,7 +67,7 @@ public IndexVolumeEditPresenter(final EventBus eventBus, void show(final IndexVolume volume, final String caption, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { nodeManager.listAllNodes( nodeNames -> { read(nodeNames, volume); @@ -84,12 +84,12 @@ void show(final IndexVolume volume, write(); if (volume.getId() != null) { doWithVolumeValidation(volume, () -> - updateVolume(consumer, volume, e, taskHandlerFactory), - e, taskHandlerFactory); + updateVolume(consumer, volume, e, taskMonitorFactory), + e, taskMonitorFactory); } else { doWithVolumeValidation(volume, () -> - createIndexVolume(consumer, volume, e, taskHandlerFactory), - e, taskHandlerFactory); + createIndexVolume(consumer, volume, e, taskMonitorFactory), + e, taskMonitorFactory); } } catch (final RuntimeException ex) { @@ -104,13 +104,13 @@ void show(final IndexVolume volume, .fire(); }, throwable -> AlertEvent.fireError(IndexVolumeEditPresenter.this, throwable.getMessage(), null), - taskHandlerFactory); + taskMonitorFactory); } private void doWithVolumeValidation(final IndexVolume volume, final Runnable work, final HidePopupRequestEvent event, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(INDEX_VOLUME_RESOURCE) .method(res -> res.validate(volume)) @@ -140,14 +140,14 @@ private void doWithVolumeValidation(final IndexVolume volume, .onFailure(throwable -> { AlertEvent.fireError(IndexVolumeEditPresenter.this, throwable.getMessage(), event::reset); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } private void createIndexVolume(final Consumer savedVolumeConsumer, final IndexVolume volume, final HidePopupRequestEvent event, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(INDEX_VOLUME_RESOURCE) .method(res -> res.create(volume)) @@ -156,14 +156,14 @@ private void createIndexVolume(final Consumer savedVolumeConsumer, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } private void updateVolume(final Consumer consumer, final IndexVolume volume, final HidePopupRequestEvent event, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(INDEX_VOLUME_RESOURCE) .method(res -> res.update(volume.getId(), volume)) @@ -172,7 +172,7 @@ private void updateVolume(final Consumer consumer, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupEditPresenter.java b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupEditPresenter.java index 66d3b7cd3c9..7ab1c0fb07c 100644 --- a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupEditPresenter.java @@ -117,7 +117,7 @@ protected void onBind() { .onSuccess(response -> delayedUpdate.update()) .onFailure(throwable -> { }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec() ), throwable -> { @@ -139,7 +139,7 @@ private void edit() { .create(INDEX_VOLUME_RESOURCE) .method(res -> res.fetch(volume.getId())) .onSuccess(result -> editVolume(result, "Edit Volume")) - .taskHandlerFactory(volumeStatusListPresenter.getTaskListener()) + .taskMonitorFactory(volumeStatusListPresenter.getTaskListener()) .exec(); } } @@ -169,7 +169,7 @@ private void delete() { .create(INDEX_VOLUME_RESOURCE) .method(res -> res.delete(volume.getId())) .onSuccess(response -> volumeStatusListPresenter.refresh()) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -265,7 +265,7 @@ private void doWithGroupNameValidation(final String groupName, } }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -281,7 +281,7 @@ private void createVolumeGroup(final Consumer consumer, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupListPresenter.java b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupListPresenter.java index a66957a61aa..2ded23cd471 100644 --- a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupListPresenter.java @@ -74,7 +74,7 @@ protected void exec(final Range range, .method(res -> res.find(criteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } }; diff --git a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupPresenter.java b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupPresenter.java index c79000570fc..f55e6985835 100644 --- a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupPresenter.java +++ b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeGroupPresenter.java @@ -123,7 +123,7 @@ private void edit() { .create(INDEX_VOLUME_GROUP_RESOURCE) .method(res -> res.fetch(volume.getId())) .onSuccess(this::edit) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -149,7 +149,7 @@ private void delete() { .create(INDEX_VOLUME_GROUP_RESOURCE) .method(res -> res.delete(volume.getId())) .onSuccess(response -> refresh()) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeStatusListPresenter.java b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeStatusListPresenter.java index 64f84f3699b..56bcb69e71d 100644 --- a/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeStatusListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/index/client/presenter/IndexVolumeStatusListPresenter.java @@ -30,7 +30,7 @@ import stroom.index.shared.IndexVolumeFields; import stroom.index.shared.IndexVolumeResource; import stroom.preferences.client.DateTimeFormatter; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.client.DataGridUtil; import stroom.util.shared.GwtNullSafe; import stroom.util.shared.ModelStringUtil; @@ -265,14 +265,14 @@ protected void exec(final Range range, } }) .onFailure(errorHandler) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }; dataProvider.addDataDisplay(dataGrid); } - public TaskHandlerFactory getTaskListener() { + public TaskMonitorFactory getTaskListener() { return getView(); } } diff --git a/stroom-core-client/src/main/java/stroom/index/client/presenter/NewIndexVolumeGroupPresenter.java b/stroom-core-client/src/main/java/stroom/index/client/presenter/NewIndexVolumeGroupPresenter.java index 396a0e319f1..52f5eb78400 100644 --- a/stroom-core-client/src/main/java/stroom/index/client/presenter/NewIndexVolumeGroupPresenter.java +++ b/stroom-core-client/src/main/java/stroom/index/client/presenter/NewIndexVolumeGroupPresenter.java @@ -104,7 +104,7 @@ private void checkVolumeGroupName(final String name, final HidePopupRequestEvent } }) .onFailure(RestErrorHandler.forPopup(this, e)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -117,7 +117,7 @@ private void createVolumeGroup(final String name, final HidePopupRequestEvent e) e.hide(); }) .onFailure(RestErrorHandler.forPopup(this, e)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/job/client/presenter/JobListPresenter.java b/stroom-core-client/src/main/java/stroom/job/client/presenter/JobListPresenter.java index bbb45072d2a..32553e22828 100644 --- a/stroom-core-client/src/main/java/stroom/job/client/presenter/JobListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/job/client/presenter/JobListPresenter.java @@ -90,7 +90,7 @@ protected void exec(final Range range, .method(JobResource::list) .onSuccess(dataConsumer) .onFailure(restErrorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } @@ -134,7 +134,7 @@ private void initColumns(final RestFactory restFactory, // changeHandler.accept(job); // } }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } ) diff --git a/stroom-core-client/src/main/java/stroom/job/client/presenter/JobNodeListPresenter.java b/stroom-core-client/src/main/java/stroom/job/client/presenter/JobNodeListPresenter.java index 5bdb3a110d2..3c96d75eed1 100644 --- a/stroom-core-client/src/main/java/stroom/job/client/presenter/JobNodeListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/job/client/presenter/JobNodeListPresenter.java @@ -216,7 +216,7 @@ protected void exec(final Range range, res.find(findJobNodeCriteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } @@ -239,7 +239,7 @@ protected void changeData(final JobNodeAndInfoListResponse data) { jobNodeAndInfo.clearJobNodeInfo(); scheduleDataGridRedraw(); }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }); @@ -311,7 +311,7 @@ private void initTable() { restFactory .create(JOB_NODE_RESOURCE) .call(res -> res.setTaskLimit(jobNodeAndInfo.getId(), value.intValue())) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }) diff --git a/stroom-core-client/src/main/java/stroom/kafka/client/KafkaConfigPlugin.java b/stroom-core-client/src/main/java/stroom/kafka/client/KafkaConfigPlugin.java index 3301e1e9be1..7f352a1ebb8 100644 --- a/stroom-core-client/src/main/java/stroom/kafka/client/KafkaConfigPlugin.java +++ b/stroom-core-client/src/main/java/stroom/kafka/client/KafkaConfigPlugin.java @@ -29,7 +29,7 @@ import stroom.kafka.shared.KafkaConfigDoc; import stroom.kafka.shared.KafkaConfigResource; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -78,13 +78,13 @@ protected DocRef getDocRef(final KafkaConfigDoc document) { public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(KAFKA_CONFIG_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -93,13 +93,13 @@ public void save(final DocRef docRef, final KafkaConfigDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(KAFKA_CONFIG_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/kafka/client/presenter/KafkaConfigPresenter.java b/stroom-core-client/src/main/java/stroom/kafka/client/presenter/KafkaConfigPresenter.java index 5b9ac1b37ec..763cea35e85 100644 --- a/stroom-core-client/src/main/java/stroom/kafka/client/presenter/KafkaConfigPresenter.java +++ b/stroom-core-client/src/main/java/stroom/kafka/client/presenter/KafkaConfigPresenter.java @@ -125,7 +125,7 @@ protected void onBind() { .create(KAFKA_CONFIG_RESOURCE) .method(res -> res.download(docRef)) .onSuccess(result -> ExportFileCompleteUtil.onSuccess(locationManager, this, result)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); })); } diff --git a/stroom-core-client/src/main/java/stroom/main/client/presenter/GlobalKeyHandlerImpl.java b/stroom-core-client/src/main/java/stroom/main/client/presenter/GlobalKeyHandlerImpl.java new file mode 100644 index 00000000000..e4390b73192 --- /dev/null +++ b/stroom-core-client/src/main/java/stroom/main/client/presenter/GlobalKeyHandlerImpl.java @@ -0,0 +1,55 @@ +package stroom.main.client.presenter; + +import stroom.content.client.event.ContentTabSelectionChangeEvent; +import stroom.widget.tab.client.presenter.TabData; +import stroom.widget.util.client.GlobalKeyHandler; +import stroom.widget.util.client.KeyBinding; +import stroom.widget.util.client.KeyBinding.Action; + +import com.google.gwt.dom.client.NativeEvent; +import com.google.gwt.event.dom.client.KeyDownEvent; +import com.google.gwt.event.dom.client.KeyUpEvent; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import com.google.web.bindery.event.shared.EventBus; + +@Singleton +public class GlobalKeyHandlerImpl implements GlobalKeyHandler { + + private TabData selectedTabData; + + @Inject + GlobalKeyHandlerImpl(final EventBus eventBus) { + // track the currently selected tab + eventBus.addHandler(ContentTabSelectionChangeEvent.getType(), e -> { + selectedTabData = e.getTabData(); +// if (selectedTabData != null) { +// GWT.log("Selected tab - label: '" + tabData.getLabel() +// + "', type: " + tabData.getType() +// + ", class: " + tabData.getClass().getName()); +// } + }); + } + + @Override + public void onKeyDown(final KeyDownEvent event) { + final NativeEvent nativeEvent = event.getNativeEvent(); + // If there is a Command associated with this key bind then this will execute that + // else we pass the action down to the current tab to deal with + final Action action = KeyBinding.test(nativeEvent); + if (action != null && selectedTabData != null) { +// GWT.log("Passing " + action + " to " + selectedTabData.getClass().getName()); + final boolean wasActionConsumed = selectedTabData.handleKeyAction(action); + if (wasActionConsumed) { + // Stop anyone else dealing with this key bind + nativeEvent.stopPropagation(); + nativeEvent.preventDefault(); + } + } + } + + @Override + public void onKeyUp(final KeyUpEvent event) { + KeyBinding.test(event.getNativeEvent()); + } +} diff --git a/stroom-core-client/src/main/java/stroom/main/client/presenter/MainPresenter.java b/stroom-core-client/src/main/java/stroom/main/client/presenter/MainPresenter.java index 7e43d0746e0..f407ee0f8d7 100644 --- a/stroom-core-client/src/main/java/stroom/main/client/presenter/MainPresenter.java +++ b/stroom-core-client/src/main/java/stroom/main/client/presenter/MainPresenter.java @@ -17,7 +17,6 @@ package stroom.main.client.presenter; import stroom.alert.client.event.AlertEvent; -import stroom.content.client.event.ContentTabSelectionChangeEvent; import stroom.content.client.event.RefreshCurrentContentTabEvent; import stroom.core.client.MenuKeys; import stroom.core.client.presenter.CorePresenter; @@ -32,10 +31,8 @@ import stroom.widget.menu.client.presenter.ShowMenuEvent; import stroom.widget.popup.client.presenter.PopupPosition; import stroom.widget.tab.client.event.MaximiseEvent; -import stroom.widget.tab.client.presenter.TabData; import stroom.widget.util.client.DoubleClickTester; -import stroom.widget.util.client.KeyBinding; -import stroom.widget.util.client.KeyBinding.Action; +import stroom.widget.util.client.GlobalKeyHandler; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; @@ -73,7 +70,6 @@ public class MainPresenter private final Timer refreshTimer; private boolean click; private final MenuItems menuItems; - private TabData selectedTabData = null; private int taskCount; @Inject @@ -81,42 +77,17 @@ public MainPresenter(final EventBus eventBus, final MainView view, final MainProxy proxy, final MenuItems menuItems, - final UiConfigCache uiConfigCache) { + final UiConfigCache uiConfigCache, + final GlobalKeyHandler globalKeyHandler) { super(eventBus, view, proxy); this.menuItems = menuItems; view.setUiHandlers(this); // Handle key presses - view.asWidget().addDomHandler(event -> { - final NativeEvent nativeEvent = event.getNativeEvent(); - // If there is a Command associated with this key bind then this will execute that - // else we pass the action down to the current tab to deal with - final Action action = KeyBinding.test(nativeEvent); - if (action != null && selectedTabData != null) { -// GWT.log("Passing " + action + " to " + selectedTabData.getClass().getName()); - final boolean wasActionConsumed = selectedTabData.handleKeyAction(action); - if (wasActionConsumed) { - // Stop anyone else dealing with this key bind - nativeEvent.stopPropagation(); - nativeEvent.preventDefault(); - } - } - }, KeyDownEvent.getType()); + view.asWidget().addDomHandler(globalKeyHandler::onKeyDown, KeyDownEvent.getType()); // Inspect the keyUp so we can catch stuff like 'shift,shift' - view.asWidget().addDomHandler( - event -> KeyBinding.test(event.getNativeEvent()), - KeyUpEvent.getType()); - - // track the currently selected tab - registerHandler(getEventBus().addHandler(ContentTabSelectionChangeEvent.getType(), e -> { - selectedTabData = e.getTabData(); -// if (selectedTabData != null) { -// GWT.log("Selected tab - label: '" + tabData.getLabel() -// + "', type: " + tabData.getType() -// + ", class: " + tabData.getClass().getName()); -// } - })); + view.asWidget().addDomHandler(globalKeyHandler::onKeyUp, KeyUpEvent.getType()); addRegisteredHandler(TaskStartEvent.getType(), event -> { // DebugPane.debug("taskStart:" + event.getTaskCount()); diff --git a/stroom-core-client/src/main/java/stroom/monitoring/client/presenter/DatabaseTablesMonitoringPresenter.java b/stroom-core-client/src/main/java/stroom/monitoring/client/presenter/DatabaseTablesMonitoringPresenter.java index 777df9f3be6..4100acd7faf 100644 --- a/stroom-core-client/src/main/java/stroom/monitoring/client/presenter/DatabaseTablesMonitoringPresenter.java +++ b/stroom-core-client/src/main/java/stroom/monitoring/client/presenter/DatabaseTablesMonitoringPresenter.java @@ -114,7 +114,7 @@ protected void exec(final Range range, .method(res -> res.findSystemTableStatus(criteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } }; diff --git a/stroom-core-client/src/main/java/stroom/node/client/JobNodeListHelper.java b/stroom-core-client/src/main/java/stroom/node/client/JobNodeListHelper.java index b49da575daf..a9244e56085 100644 --- a/stroom-core-client/src/main/java/stroom/node/client/JobNodeListHelper.java +++ b/stroom-core-client/src/main/java/stroom/node/client/JobNodeListHelper.java @@ -25,7 +25,7 @@ import stroom.svg.client.Preset; import stroom.svg.client.SvgPresets; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.task.client.event.OpenTaskManagerEvent; import stroom.util.client.DataGridUtil; import stroom.util.client.DataGridUtil.ColumnBuilder; @@ -66,7 +66,7 @@ public class JobNodeListHelper { private final MenuPresenter menuPresenter; private final MultiSelectionModelImpl selectionModel; - private final TaskHandlerFactory taskHandlerFactory; + private final TaskMonitorFactory taskMonitorFactory; private final HasHandlers hasHandlers; private final Runnable refreshFunc; @@ -77,7 +77,7 @@ public JobNodeListHelper(final DateTimeFormatter dateTimeFormatter, final SchedulePopup schedulePresenter, final MenuPresenter menuPresenter, final MultiSelectionModelImpl selectionModel, - final TaskHandlerFactory taskHandlerFactory, + final TaskMonitorFactory taskMonitorFactory, final HasHandlers hasHandlers, final Runnable refreshFunc) { this.dateTimeFormatter = dateTimeFormatter; @@ -85,7 +85,7 @@ public JobNodeListHelper(final DateTimeFormatter dateTimeFormatter, this.schedulePresenter = schedulePresenter; this.menuPresenter = menuPresenter; this.selectionModel = selectionModel; - this.taskHandlerFactory = taskHandlerFactory; + this.taskMonitorFactory = taskMonitorFactory; this.hasHandlers = hasHandlers; this.refreshFunc = refreshFunc; } @@ -118,7 +118,7 @@ public void executeJobNow(final JobNode jobNode) { ok -> { restFactory.create(JOB_NODE_RESOURCE) .call(resource -> resource.execute(jobNode.getId())) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); }); } @@ -132,13 +132,13 @@ public void showSchedule(final JobNodeAndInfo jobNodeAndInfo) { setSchedule(jobNodeAndInfo, jobNodeInfo)) .onFailure(throwable -> setSchedule(jobNodeAndInfo, null)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public FieldUpdater createEnabledStateFieldUpdater( final HasHandlers handlers, - final TaskHandlerFactory taskHandlerFactory, + final TaskMonitorFactory taskMonitorFactory, final Runnable onSuccessHandler) { return (int rowIndex, JobNodeAndInfo jobNodeAndInfo, TickBoxState value) -> { @@ -153,7 +153,7 @@ public FieldUpdater createEnabledStateFieldUpdater JobNodeChangeEvent.fire(handlers, jobNodeAndInfo.getJobNode()); GwtNullSafe.run(onSuccessHandler); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } }; @@ -218,7 +218,7 @@ private void setSchedule(final JobNodeAndInfo jobNodeAndInfo, JobNodeChangeEvent.fire(hasHandlers, selectedItems); GwtNullSafe.run(refreshFunc); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); }); } @@ -235,7 +235,7 @@ private void setSchedule(final JobNodeAndInfo jobNodeAndInfo, JobNodeChangeEvent.fire(hasHandlers, jobNode); GwtNullSafe.run(refreshFunc); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); }); } @@ -412,7 +412,7 @@ public void addEnabledTickBoxColumn(final MyDataGrid dataGrid, JobNodeAndInfo::isEnabled) .enabledWhen(this::isJobNodeEnabled) .withFieldUpdater(createEnabledStateFieldUpdater( - hasHandlers, taskHandlerFactory, refreshFunc)); + hasHandlers, taskMonitorFactory, refreshFunc)); if (isSortable) { builder.withSorting(FindJobNodeCriteria.FIELD_ID_ENABLED); diff --git a/stroom-core-client/src/main/java/stroom/node/client/NodeManager.java b/stroom-core-client/src/main/java/stroom/node/client/NodeManager.java index 10d1372aab4..6dbc34fdab3 100644 --- a/stroom-core-client/src/main/java/stroom/node/client/NodeManager.java +++ b/stroom-core-client/src/main/java/stroom/node/client/NodeManager.java @@ -6,7 +6,7 @@ import stroom.node.shared.FetchNodeStatusResponse; import stroom.node.shared.FindNodeStatusCriteria; import stroom.node.shared.NodeResource; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; @@ -30,63 +30,63 @@ public class NodeManager { public void fetchNodeStatus(final Consumer dataConsumer, final RestErrorHandler errorHandler, final FindNodeStatusCriteria findNodeStatusCriteria, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(NODE_RESOURCE) .method(res -> res.find(findNodeStatusCriteria)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void ping(final String nodeName, final Consumer pingConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(NODE_RESOURCE) .method(res -> res.ping(nodeName)) .onSuccess(pingConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void info(final String nodeName, final Consumer infoConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(NODE_RESOURCE) .method(res -> res.info(nodeName)) .onSuccess(infoConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void setPriority(final String nodeName, final int priority, final Consumer resultConsumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(NODE_RESOURCE) .method(res -> res.setPriority(nodeName, priority)) .onSuccess(resultConsumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void setEnabled(final String nodeName, final boolean enabled, final Consumer resultConsumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(NODE_RESOURCE) .method(res -> res.setEnabled(nodeName, enabled)) .onSuccess(resultConsumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -97,25 +97,25 @@ public void setEnabled(final String nodeName, public void listAllNodes(final Consumer> nodeListConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(NODE_RESOURCE) .method(NodeResource::listAllNodes) .onSuccess(nodeListConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void listEnabledNodes(final Consumer> nodeListConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(NODE_RESOURCE) .method(NodeResource::listEnabledNodes) .onSuccess(nodeListConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/node/client/presenter/NodeJobListPresenter.java b/stroom-core-client/src/main/java/stroom/node/client/presenter/NodeJobListPresenter.java index 2729c228cf4..3f31631ee79 100644 --- a/stroom-core-client/src/main/java/stroom/node/client/presenter/NodeJobListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/node/client/presenter/NodeJobListPresenter.java @@ -189,7 +189,7 @@ protected void exec(final Range range, // changeData(new JobNodeAndInfoListResponse(Collections.emptyList())); // errorHandler.onError(error); // }) - .taskHandlerFactory(view) + .taskMonitorFactory(view) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/pipeline/client/PipelinePlugin.java b/stroom-core-client/src/main/java/stroom/pipeline/client/PipelinePlugin.java index cbbf61af680..b24d0ed41fe 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/client/PipelinePlugin.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/client/PipelinePlugin.java @@ -31,8 +31,8 @@ import stroom.pipeline.shared.PipelineResource; import stroom.processor.shared.Processor; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -74,7 +74,7 @@ protected void onBind() { final PipelinePresenter pipelinePresenter = (PipelinePresenter) open(docRef, true, false, - new DefaultTaskListener(this)); + new DefaultTaskMonitorFactory(this)); // Highlight the item in the explorer tree. // highlight(docRef); @@ -92,13 +92,13 @@ protected void onBind() { public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(PIPELINE_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -107,13 +107,13 @@ public void save(final DocRef docRef, final PipelineDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(PIPELINE_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/pipeline/client/TextConverterPlugin.java b/stroom-core-client/src/main/java/stroom/pipeline/client/TextConverterPlugin.java index 26d8fe95271..86e8ebac1e0 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/client/TextConverterPlugin.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/client/TextConverterPlugin.java @@ -29,7 +29,7 @@ import stroom.pipeline.shared.TextConverterDoc; import stroom.pipeline.shared.TextConverterResource; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -68,13 +68,13 @@ public TextConverterPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(TEXT_CONVERTER_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final TextConverterDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(TEXT_CONVERTER_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/pipeline/client/XsltPlugin.java b/stroom-core-client/src/main/java/stroom/pipeline/client/XsltPlugin.java index 6a002fb7723..ae2f73b24a0 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/client/XsltPlugin.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/client/XsltPlugin.java @@ -29,7 +29,7 @@ import stroom.pipeline.shared.XsltDoc; import stroom.pipeline.shared.XsltResource; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -68,13 +68,13 @@ public XsltPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(XSLT_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final XsltDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(XSLT_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/PipelineSteppingPlugin.java b/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/PipelineSteppingPlugin.java index c5f2d12746c..aeeb550e106 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/PipelineSteppingPlugin.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/PipelineSteppingPlugin.java @@ -34,7 +34,7 @@ import stroom.pipeline.stepping.client.event.BeginPipelineSteppingEvent; import stroom.pipeline.stepping.client.presenter.SteppingContentTabPresenter; import stroom.security.shared.DocumentPermission; -import stroom.task.client.DefaultTaskListener; +import stroom.task.client.DefaultTaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.web.bindery.event.shared.EventBus; @@ -88,7 +88,7 @@ public void onBegin(final BeginPipelineSteppingEvent event) { event.getStepLocation().getMetaId(), event.getChildStreamId()))) .onSuccess(chooser::setSelectedEntityReference) - .taskHandlerFactory(chooser) + .taskMonitorFactory(chooser) .exec(); } @@ -121,7 +121,7 @@ private void choosePipeline(final DocSelectionPopup chooser, childStreamType); } }) - .taskHandlerFactory(new DefaultTaskListener(this)) + .taskMonitorFactory(new DefaultTaskMonitorFactory(this)) .exec(); } }, onShow); diff --git a/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/ElementPresenter.java b/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/ElementPresenter.java index d19471ceae9..d1f9c0bf52f 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/ElementPresenter.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/ElementPresenter.java @@ -140,7 +140,7 @@ public void load(final Consumer consumer) { clearAllIndicators(); consumer.accept(false); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); loading = true; diff --git a/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/SteppingContentTabPresenter.java b/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/SteppingContentTabPresenter.java index 1461522aa1e..17b1e0a3812 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/SteppingContentTabPresenter.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/SteppingContentTabPresenter.java @@ -60,7 +60,7 @@ public SteppingContentTabPresenter(final EventBus eventBus, hasSaveRegistry.register(this); view.setContent(steppingPresenter.getView()); - steppingPresenter.setTaskHandlerFactory(this); + steppingPresenter.setTaskMonitorFactory(this); } @Override diff --git a/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/SteppingPresenter.java b/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/SteppingPresenter.java index 09eb1f69269..40927c9178d 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/SteppingPresenter.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/stepping/client/presenter/SteppingPresenter.java @@ -49,7 +49,7 @@ import stroom.svg.shared.SvgImage; import stroom.task.client.SimpleTask; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.util.shared.DataRange; import stroom.util.shared.GwtNullSafe; import stroom.util.shared.Indicators; @@ -359,7 +359,7 @@ private PresenterWidget getContent(final PipelineElement element) { final List properties = pipelineModel.getProperties(element); final ElementPresenter presenter = elementPresenterProvider.get(); - presenter.setTaskHandlerFactory(this); + presenter.setTaskMonitorFactory(this); presenter.setElement(element); presenter.setProperties(properties); presenter.setFeedName(meta.getFeedName()); @@ -561,7 +561,7 @@ public void read(final DocRef pipeline, stepLocation.getRecordIndex())); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -610,7 +610,7 @@ private void step(final StepType stepType, final StepLocation stepLocation) { AlertEvent.fireErrorFromException(SteppingPresenter.this, restError.getException(), null); busyTranslating = false; }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -773,9 +773,9 @@ private Optional getFatalErrors(final SteppingResult steppingResult) { private void onSelect(final PipelineElement element) { if (element != null) { - final TaskHandler taskHandler = createTaskHandler(); + final TaskMonitor taskMonitor = createTaskMonitor(); final Task task = new SimpleTask("Stepping"); - taskHandler.onStart(task); + taskMonitor.onStart(task); Scheduler.get().scheduleDeferred(() -> { final PresenterWidget content = getContent(element); if (content != null) { @@ -784,7 +784,7 @@ private void onSelect(final PipelineElement element) { updateElementSeverities(); } - taskHandler.onEnd(task); + taskMonitor.onEnd(task); }); } } diff --git a/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/NewPipelineReferencePresenter.java b/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/NewPipelineReferencePresenter.java index 21c14c018c5..d1352928428 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/NewPipelineReferencePresenter.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/NewPipelineReferencePresenter.java @@ -160,7 +160,7 @@ private void updateDataTypes(final String selectedDataType) { initialised = true; }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/NewPropertyPresenter.java b/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/NewPropertyPresenter.java index 769d60edb5f..ac176b0418a 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/NewPropertyPresenter.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/NewPropertyPresenter.java @@ -297,7 +297,7 @@ private void enterDataTypeMode(final PipelineProperty property) { dataTypePresenterInitialised = true; }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); dataTypeWidget.addValueChangeHandler(event -> { @@ -347,7 +347,7 @@ private void enterVolumeGroupMode(final PipelineProperty property) { dataTypePresenterInitialised = true; }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); dataTypeWidget.addValueChangeHandler(event -> { diff --git a/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PipelineReferenceListPresenter.java b/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PipelineReferenceListPresenter.java index c99f09f1190..a2ee7709265 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PipelineReferenceListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PipelineReferenceListPresenter.java @@ -426,7 +426,7 @@ private void refresh() { setData(references); }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } else { setData(references); diff --git a/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PipelineStructurePresenter.java b/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PipelineStructurePresenter.java index ab878874e96..be9ac908490 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PipelineStructurePresenter.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PipelineStructurePresenter.java @@ -153,7 +153,7 @@ public PipelineStructurePresenter(final EventBus eventBus, Collections.sort(types); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); setAdvancedMode(true); @@ -260,7 +260,7 @@ protected void onRead(final DocRef docRef, final PipelineDoc document, final boo AlertEvent.fireError(PipelineStructurePresenter.this, e.getMessage(), null); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -530,7 +530,7 @@ public void viewSource() { "Unable to display pipeline source", throwable.getMessage() )) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -558,7 +558,7 @@ private void doActualSave(final EditorPresenter xmlEditor, final HidePopupReques RefreshDocumentEvent.fire(PipelineStructurePresenter.this, docRef); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -616,7 +616,7 @@ private void changeParentPipeline(final DocRef parentPipeline) { null); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PropertyListPresenter.java b/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PropertyListPresenter.java index 5da4035cc16..7227f336135 100644 --- a/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PropertyListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/pipeline/structure/client/presenter/PropertyListPresenter.java @@ -433,7 +433,7 @@ private void refresh() { setData(propertyList); }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } else { setData(propertyList); diff --git a/stroom-core-client/src/main/java/stroom/preferences/client/UserPreferencesManager.java b/stroom-core-client/src/main/java/stroom/preferences/client/UserPreferencesManager.java index 054f80a7aae..d10b679da67 100644 --- a/stroom-core-client/src/main/java/stroom/preferences/client/UserPreferencesManager.java +++ b/stroom-core-client/src/main/java/stroom/preferences/client/UserPreferencesManager.java @@ -5,7 +5,7 @@ import stroom.editor.client.presenter.CurrentPreferences; import stroom.expression.api.UserTimeZone; import stroom.expression.api.UserTimeZone.Use; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.shared.ThemeCssUtil; import stroom.ui.config.shared.Themes; import stroom.ui.config.shared.Themes.ThemeType; @@ -42,44 +42,44 @@ public UserPreferencesManager(final RestFactory restFactory, this.currentPreferences = currentPreferences; } - public void fetch(final Consumer consumer, final TaskHandlerFactory taskHandlerFactory) { + public void fetch(final Consumer consumer, final TaskMonitorFactory taskMonitorFactory) { restFactory .create(PREFERENCES_RESOURCE) .method(UserPreferencesResource::fetch) .onSuccess(consumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void update(final UserPreferences userPreferences, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(PREFERENCES_RESOURCE) .method(res -> res.update(userPreferences)) .onSuccess(consumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void setDefaultUserPreferences(final UserPreferences userPreferences, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(PREFERENCES_RESOURCE) .method(res -> res.setDefaultUserPreferences(userPreferences)) .onSuccess(consumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void resetToDefaultUserPreferences(final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(PREFERENCES_RESOURCE) .method(UserPreferencesResource::resetToDefaultUserPreferences) .onSuccess(consumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/processor/client/presenter/BatchProcessorFilterEditPresenter.java b/stroom-core-client/src/main/java/stroom/processor/client/presenter/BatchProcessorFilterEditPresenter.java index f5cb547649d..df7bc76b9c4 100644 --- a/stroom-core-client/src/main/java/stroom/processor/client/presenter/BatchProcessorFilterEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/processor/client/presenter/BatchProcessorFilterEditPresenter.java @@ -27,7 +27,7 @@ import stroom.processor.shared.ProcessorFilterResource; import stroom.query.api.v2.ExpressionOperator; import stroom.security.client.presenter.UserRefSelectionBoxPresenter; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.PageResponse; import stroom.widget.popup.client.event.ShowPopupEvent; import stroom.widget.popup.client.presenter.PopupSize; @@ -146,7 +146,7 @@ private BulkProcessorFilterChangeRequest createRequest() { } @Override - public void apply(final TaskHandlerFactory taskHandlerFactory) { + public void apply(final TaskMonitorFactory taskMonitorFactory) { int docCount = 0; if (currentResultPageResponse != null) { docCount = currentResultPageResponse.getLength(); @@ -166,14 +166,14 @@ public void apply(final TaskHandlerFactory taskHandlerFactory) { message, ok -> { if (ok) { - doApply(taskHandlerFactory); + doApply(taskMonitorFactory); } } ); } } - private void doApply(final TaskHandlerFactory taskHandlerFactory) { + private void doApply(final TaskMonitorFactory taskMonitorFactory) { final BulkProcessorFilterChangeRequest request = createRequest(); restFactory .create(PROCESSOR_FILTER_RESOURCE) @@ -191,7 +191,7 @@ private void doApply(final TaskHandlerFactory taskHandlerFactory) { null); } }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/processor/client/presenter/BatchProcessorFilterEditUiHandlers.java b/stroom-core-client/src/main/java/stroom/processor/client/presenter/BatchProcessorFilterEditUiHandlers.java index 18c0917b408..dbab0de28d5 100644 --- a/stroom-core-client/src/main/java/stroom/processor/client/presenter/BatchProcessorFilterEditUiHandlers.java +++ b/stroom-core-client/src/main/java/stroom/processor/client/presenter/BatchProcessorFilterEditUiHandlers.java @@ -1,6 +1,6 @@ package stroom.processor.client.presenter; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.gwtplatform.mvp.client.UiHandlers; @@ -8,5 +8,5 @@ public interface BatchProcessorFilterEditUiHandlers extends UiHandlers { void validate(); - void apply(TaskHandlerFactory taskHandlerFactory); + void apply(TaskMonitorFactory taskMonitorFactory); } diff --git a/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorEditPresenter.java b/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorEditPresenter.java index d1412c432e7..b07586b225d 100644 --- a/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorEditPresenter.java @@ -206,7 +206,7 @@ private void validateExpression(final List fields, .onFailure(throwable -> { AlertEvent.fireError(ProcessorEditPresenter.this, throwable.getMessage(), null); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -298,7 +298,7 @@ private void createOrUpdateProcessor(final ProcessorFilter filter, .method(res -> res.update(filter.getId(), filter)) .onSuccess(r -> hide(r, event)) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } else { @@ -318,7 +318,7 @@ private void createOrUpdateProcessor(final ProcessorFilter filter, .create(PROCESSOR_FILTER_RESOURCE) .method(res -> res.create(request)) .onSuccess(r -> hide(r, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorListPresenter.java b/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorListPresenter.java index 2a78696c7cf..0efb0d7bd7d 100644 --- a/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorListPresenter.java @@ -128,7 +128,7 @@ protected void doAction(final Integer key, final Boolean value, final Consumer res.find(request)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorPresenter.java b/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorPresenter.java index 66b1cae4dda..19fe551ea51 100644 --- a/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorPresenter.java +++ b/stroom-core-client/src/main/java/stroom/processor/client/presenter/ProcessorPresenter.java @@ -379,7 +379,7 @@ private void editProcessor() { edit(loadedFilter, null); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -440,7 +440,7 @@ private void removeProcessor() { countDownAndRun.countdown()) .onFailure(new DefaultErrorHandler(this, () -> countDownAndRun.countdown())) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/query/client/AsyncSuggestOracle.java b/stroom-core-client/src/main/java/stroom/query/client/AsyncSuggestOracle.java index eb3a7ba385b..e55767a8a49 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/AsyncSuggestOracle.java +++ b/stroom-core-client/src/main/java/stroom/query/client/AsyncSuggestOracle.java @@ -21,7 +21,7 @@ import stroom.docref.DocRef; import stroom.query.shared.FetchSuggestionsRequest; import stroom.query.shared.SuggestionsResource; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.Timer; @@ -44,10 +44,10 @@ public class AsyncSuggestOracle extends SuggestOracle { private DocRef dataSource; private QueryField field; private Timer requestTimer; - private final TaskHandlerFactory taskHandlerFactory; + private final TaskMonitorFactory taskMonitorFactory; - public AsyncSuggestOracle(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public AsyncSuggestOracle(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } public void setRestFactory(final RestFactory restFactory) { @@ -101,7 +101,7 @@ public void run() { returnSuggestions(request, callback, result.getList()); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/query/client/DataSourceClient.java b/stroom-core-client/src/main/java/stroom/query/client/DataSourceClient.java index dc1e621013f..dc16d657201 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/DataSourceClient.java +++ b/stroom-core-client/src/main/java/stroom/query/client/DataSourceClient.java @@ -7,7 +7,7 @@ import stroom.docref.DocRef; import stroom.docref.StringMatch; import stroom.docstore.shared.Documentation; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.GwtNullSafe; import stroom.util.shared.PageRequest; import stroom.util.shared.ResultPage; @@ -31,12 +31,12 @@ public DataSourceClient(final RestFactory restFactory) { public void findFields(final FindFieldCriteria findFieldInfoCriteria, final Consumer> consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(DATA_SOURCE_RESOURCE) .method(res -> res.findFields(findFieldInfoCriteria)) .onSuccess(consumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -44,7 +44,7 @@ public void findFieldByName(final DocRef dataSourceRef, final String fieldName, final Boolean queryable, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { if (dataSourceRef != null) { final FindFieldCriteria findFieldInfoCriteria = new FindFieldCriteria( PageRequest.oneRow(), @@ -60,14 +60,14 @@ public void findFieldByName(final DocRef dataSourceRef, consumer.accept(result.getFirst()); } }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } public void fetchDataSourceDescription(final DocRef dataSourceDocRef, final Consumer> descriptionConsumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { if (dataSourceDocRef != null) { restFactory @@ -80,19 +80,19 @@ public void fetchDataSourceDescription(final DocRef dataSourceDocRef, descriptionConsumer.accept(optMarkDown); } }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } public void fetchDefaultExtractionPipeline(final DocRef dataSourceRef, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(DATA_SOURCE_RESOURCE) .method(res -> res.fetchDefaultExtractionPipeline(dataSourceRef)) .onSuccess(consumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/query/client/QueryPlugin.java b/stroom-core-client/src/main/java/stroom/query/client/QueryPlugin.java index 2463d58d66b..aab621062b1 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/QueryPlugin.java +++ b/stroom-core-client/src/main/java/stroom/query/client/QueryPlugin.java @@ -29,7 +29,7 @@ import stroom.query.shared.QueryDoc; import stroom.query.shared.QueryResource; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -68,13 +68,13 @@ public QueryPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(QUERY_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final QueryDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(QUERY_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicColumnSelectionListModel.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicColumnSelectionListModel.java index 0f3447ea9db..2510006acce 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicColumnSelectionListModel.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicColumnSelectionListModel.java @@ -17,9 +17,9 @@ import stroom.security.client.api.ClientSecurityContext; import stroom.security.shared.AppPermission; import stroom.svg.shared.SvgImage; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.GwtNullSafe; import stroom.util.shared.PageRequest; import stroom.util.shared.PageResponse; @@ -39,7 +39,7 @@ import javax.inject.Inject; public class DynamicColumnSelectionListModel - implements SelectionListModel, HasTaskHandlerFactory, HasHandlers { + implements SelectionListModel, HasTaskMonitorFactory, HasHandlers { private static final String NONE_TITLE = "[ none ]"; @@ -48,7 +48,7 @@ public class DynamicColumnSelectionListModel private final ClientSecurityContext clientSecurityContext; private DocRef dataSourceRef; private FindFieldCriteria lastCriteria; - private TaskHandlerFactory taskHandlerFactory = new DefaultTaskListener(this); + private TaskMonitorFactory taskMonitorFactory = new DefaultTaskMonitorFactory(this); @Inject public DynamicColumnSelectionListModel(final EventBus eventBus, @@ -85,7 +85,7 @@ public void onRangeChange(final ColumnSelectionItem parent, createResults(stringMatch, parentPath, pageRequest, response); consumer.accept(resultPage); } - }, taskHandlerFactory); + }, taskMonitorFactory); } } @@ -249,8 +249,8 @@ public boolean isEmptyItem(final ColumnSelectionItem selectionItem) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } @Override diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicFieldSelectionListModel.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicFieldSelectionListModel.java index 1e46a3068b2..e71984548a0 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicFieldSelectionListModel.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicFieldSelectionListModel.java @@ -5,9 +5,9 @@ import stroom.docref.DocRef; import stroom.docref.StringMatch; import stroom.query.client.DataSourceClient; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.PageRequest; import stroom.util.shared.PageResponse; import stroom.util.shared.ResultPage; @@ -23,14 +23,14 @@ import javax.inject.Inject; public class DynamicFieldSelectionListModel - implements FieldSelectionListModel, HasTaskHandlerFactory, HasHandlers { + implements FieldSelectionListModel, HasTaskMonitorFactory, HasHandlers { private final EventBus eventBus; private final DataSourceClient dataSourceClient; private DocRef dataSourceRef; private Boolean queryable; private FindFieldCriteria lastCriteria; - private TaskHandlerFactory taskHandlerFactory = new DefaultTaskListener(this); + private TaskMonitorFactory taskMonitorFactory = new DefaultTaskMonitorFactory(this); @Inject public DynamicFieldSelectionListModel(final EventBus eventBus, @@ -77,7 +77,7 @@ public void onRangeChange(final FieldInfoSelectionItem parent, consumer.accept(resultPage); } - }, taskHandlerFactory); + }, taskMonitorFactory); } } } @@ -97,7 +97,7 @@ public void reset() { @Override public void findFieldByName(final String fieldName, final Consumer consumer) { - dataSourceClient.findFieldByName(dataSourceRef, fieldName, queryable, consumer, taskHandlerFactory); + dataSourceClient.findFieldByName(dataSourceRef, fieldName, queryable, consumer, taskMonitorFactory); } @Override @@ -134,8 +134,8 @@ public boolean isEmptyItem(final FieldInfoSelectionItem selectionItem) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } @Override diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicQueryHelpSelectionListModel.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicQueryHelpSelectionListModel.java index 76affb5837d..d8c4c766254 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicQueryHelpSelectionListModel.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/DynamicQueryHelpSelectionListModel.java @@ -10,9 +10,9 @@ import stroom.query.shared.QueryHelpRow; import stroom.query.shared.QueryHelpType; import stroom.query.shared.QueryResource; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.CriteriaFieldSort; import stroom.util.shared.PageRequest; import stroom.util.shared.PageResponse; @@ -30,7 +30,7 @@ import javax.inject.Inject; public class DynamicQueryHelpSelectionListModel - implements SelectionListModel, HasTaskHandlerFactory, HasHandlers { + implements SelectionListModel, HasTaskMonitorFactory, HasHandlers { private static final QueryResource QUERY_RESOURCE = GWT.create(QueryResource.class); @@ -38,7 +38,7 @@ public class DynamicQueryHelpSelectionListModel private final EventBus eventBus; private final RestFactory restFactory; - private TaskHandlerFactory taskHandlerFactory = new DefaultTaskListener(this); + private TaskMonitorFactory taskMonitorFactory = new DefaultTaskMonitorFactory(this); private DocRef dataSourceRef; private String query; @@ -117,7 +117,7 @@ public void onRangeChange(final QueryHelpSelectionItem parent, consumer.accept(resultPage); } }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } @@ -173,8 +173,8 @@ public void setShowAll(final boolean showAll) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } @Override diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryDocEditPresenter.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryDocEditPresenter.java index c48de50ff3c..a72cab3d691 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryDocEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryDocEditPresenter.java @@ -40,7 +40,7 @@ import stroom.query.shared.QueryDoc; import stroom.query.shared.QueryResource; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.ui.config.shared.AnalyticUiDefaultConfig; import stroom.util.shared.time.SimpleDuration; @@ -142,7 +142,7 @@ private void createRule() { .onFailure(restError -> { AlertEvent.fireErrorFromException(this, restError.getException(), null); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -173,7 +173,7 @@ private void createRule(final AnalyticUiDefaultConfig analyticUiDefaultConfig, true, newDocumentConsumer); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -198,7 +198,7 @@ private void loadNewRule(final DocRef ruleDocRef, createDefaultStreamingRule(ruleDocRef, doc, analyticUiDefaultConfig, query, timeRange); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -303,7 +303,7 @@ private void updateRule(final DocRef ruleDocRef, ruleDocRef, true, false)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -336,8 +336,8 @@ void stop() { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - queryEditPresenter.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + queryEditPresenter.setTaskMonitorFactory(taskMonitorFactory); } } diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryDocPresenter.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryDocPresenter.java index 90a22a1a9e3..8bfe988fb90 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryDocPresenter.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryDocPresenter.java @@ -49,7 +49,7 @@ public QueryDocPresenter(final EventBus eventBus, final Provider markdownEditPresenterProvider) { super(eventBus, view); - queryDocEditPresenter.setTaskHandlerFactory(this); + queryDocEditPresenter.setTaskMonitorFactory(this); queryDocDocumentEditTabProvider = new DocumentEditTabProvider<>( () -> queryDocEditPresenter); diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryEditPresenter.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryEditPresenter.java index 9a6ec4690c6..b46fe77f420 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryEditPresenter.java @@ -37,7 +37,7 @@ import stroom.query.api.v2.TimeRange; import stroom.query.client.presenter.QueryEditPresenter.QueryEditView; import stroom.query.client.view.QueryResultTabsView; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.DefaultLocation; import stroom.util.shared.GwtNullSafe; import stroom.util.shared.Indicators; @@ -249,7 +249,7 @@ private void createNewVis() { destroyCurrentVis(); currentVisPresenter = visPresenterProvider.get(); currentVisPresenter.setQueryModel(queryModel); - currentVisPresenter.setTaskHandlerFactory(this); + currentVisPresenter.setTaskMonitorFactory(this); if (VISUALISATION.equals(linkTabsLayoutView.getTabBar().getSelectedTab())) { linkTabsLayoutView.getLayerContainer().show(currentVisPresenter); } @@ -413,9 +413,9 @@ public void setSourceType(final SourceType sourceType) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - queryModel.setTaskHandlerFactory(taskHandlerFactory); - queryHelpPresenter.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + queryModel.setTaskMonitorFactory(taskMonitorFactory); + queryHelpPresenter.setTaskMonitorFactory(taskMonitorFactory); } diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpAceCompletionProvider.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpAceCompletionProvider.java index a4e97e9c06c..e35b8a4ca44 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpAceCompletionProvider.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpAceCompletionProvider.java @@ -10,9 +10,9 @@ import stroom.query.shared.CompletionValue; import stroom.query.shared.CompletionsRequest; import stroom.query.shared.QueryResource; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.PageRequest; import com.google.gwt.core.client.GWT; @@ -31,14 +31,14 @@ public class QueryHelpAceCompletionProvider - implements AceCompletionProvider, HasTaskHandlerFactory, HasHandlers { + implements AceCompletionProvider, HasTaskMonitorFactory, HasHandlers { private static final QueryResource QUERY_RESOURCE = GWT.create(QueryResource.class); private final EventBus eventBus; private final RestFactory restFactory; private final MarkdownConverter markdownConverter; - private TaskHandlerFactory taskHandlerFactory = new DefaultTaskListener(this); + private TaskMonitorFactory taskMonitorFactory = new DefaultTaskMonitorFactory(this); private DocRef dataSourceRef; private boolean showAll = true; @@ -79,7 +79,7 @@ public void getProposals(final AceEditor editor, callback.invokeWithCompletions(aceCompletions); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -131,8 +131,8 @@ public void setShowAll(final boolean showAll) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } @Override diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpDetailProvider.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpDetailProvider.java index 909edd6e20c..a48efbb1685 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpDetailProvider.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpDetailProvider.java @@ -4,9 +4,9 @@ import stroom.query.shared.QueryHelpDetail; import stroom.query.shared.QueryHelpRow; import stroom.query.shared.QueryResource; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.event.shared.GwtEvent; @@ -16,13 +16,13 @@ import java.util.function.Consumer; import javax.inject.Inject; -public class QueryHelpDetailProvider implements HasTaskHandlerFactory, HasHandlers { +public class QueryHelpDetailProvider implements HasTaskMonitorFactory, HasHandlers { private static final QueryResource QUERY_RESOURCE = GWT.create(QueryResource.class); private final EventBus eventBus; private final RestFactory restFactory; - private TaskHandlerFactory taskHandlerFactory = new DefaultTaskListener(this); + private TaskMonitorFactory taskMonitorFactory = new DefaultTaskMonitorFactory(this); @Inject public QueryHelpDetailProvider(final EventBus eventBus, @@ -37,13 +37,13 @@ public void getDetail(QueryHelpRow row, .create(QUERY_RESOURCE) .method(res -> res.fetchDetail(row)) .onSuccess(consumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } @Override diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpPresenter.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpPresenter.java index 9ecb3f5e298..07300080cce 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpPresenter.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryHelpPresenter.java @@ -24,7 +24,7 @@ import stroom.query.client.presenter.QueryHelpPresenter.QueryHelpView; import stroom.query.shared.InsertType; import stroom.query.shared.QueryHelpRow; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.client.ClipboardUtil; import stroom.widget.util.client.MultiSelectionModel; @@ -212,10 +212,10 @@ public void setShowAll(final boolean showAll) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - model.setTaskHandlerFactory(taskHandlerFactory); - keyedAceCompletionProvider.setTaskHandlerFactory(taskHandlerFactory); - detailProvider.setTaskHandlerFactory(taskHandlerFactory); + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + model.setTaskMonitorFactory(taskMonitorFactory); + keyedAceCompletionProvider.setTaskMonitorFactory(taskMonitorFactory); + detailProvider.setTaskMonitorFactory(taskMonitorFactory); } public interface QueryHelpView extends View, HasUiHandlers { diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryModel.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryModel.java index 0e5d4408f0a..a89c78166c5 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryModel.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryModel.java @@ -29,9 +29,9 @@ import stroom.query.shared.QueryContext; import stroom.query.shared.QueryResource; import stroom.query.shared.QuerySearchRequest; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.HasTaskHandlerFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.HasTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.TokenError; import com.google.gwt.core.client.GWT; @@ -46,7 +46,7 @@ import java.util.Map; import java.util.function.Consumer; -public class QueryModel implements HasTaskHandlerFactory, HasHandlers { +public class QueryModel implements HasTaskMonitorFactory, HasHandlers { private static final QueryResource QUERY_RESOURCE = GWT.create(QueryResource.class); @@ -59,7 +59,7 @@ public class QueryModel implements HasTaskHandlerFactory, HasHandlers { private DocRef queryDocRef; private final DateTimeSettingsFactory dateTimeSettingsFactory; private final ResultStoreModel resultStoreModel; - private TaskHandlerFactory taskHandlerFactory = new DefaultTaskListener(this); + private TaskMonitorFactory taskMonitorFactory = new DefaultTaskMonitorFactory(this); private String currentNode; private QueryKey currentQueryKey; @@ -251,7 +251,7 @@ public void refresh(final String componentId, } resultConsumer.accept(null); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -264,14 +264,14 @@ public void refresh(final String componentId, private void deleteStore(final String node, final QueryKey queryKey, final DestroyReason destroyReason) { if (queryKey != null) { resultStoreModel.destroy(node, queryKey, destroyReason, (ok) -> - GWT.log("Destroyed store " + queryKey), taskHandlerFactory); + GWT.log("Destroyed store " + queryKey), taskMonitorFactory); } } private void terminate(final String node, final QueryKey queryKey) { if (queryKey != null) { resultStoreModel.terminate(node, queryKey, (ok) -> - GWT.log("Terminate search " + queryKey), taskHandlerFactory); + GWT.log("Terminate search " + queryKey), taskMonitorFactory); } } @@ -326,7 +326,7 @@ private void poll(final boolean storeHistory) { poll(false); } }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } @@ -452,8 +452,8 @@ public void setSourceType(final SourceType sourceType) { } @Override - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } @Override diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryResultTablePresenter.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryResultTablePresenter.java index 6aebdc148e5..3c049dcc1f1 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryResultTablePresenter.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryResultTablePresenter.java @@ -164,7 +164,7 @@ protected void onBind() { private void setPause(final boolean pause, final boolean refresh) { - // If curently paused then refresh if we are allowed. + // If currently paused then refresh if we are allowed. if (refresh && this.pause) { refresh(); } diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryResultVisPresenter.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryResultVisPresenter.java index 213a607e6fd..6ebaed594ab 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryResultVisPresenter.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/QueryResultVisPresenter.java @@ -114,7 +114,7 @@ public QueryResultVisPresenter(final EventBus eventBus, this.currentPreferences = currentPreferences; visFrame = new VisFrame(eventBus); - visFrame.setTaskHandlerFactory(getView().getRefreshButton()); + visFrame.setTaskMonitorFactory(getView().getRefreshButton()); // visFrame.setUiHandlers(this); view.setVisFrame(visFrame); @@ -198,7 +198,7 @@ protected void onBind() { private void setPause(final boolean pause, final boolean refresh) { - // If curently paused then refresh if we are allowed. + // If currently paused then refresh if we are allowed. if (refresh && this.pause) { refresh(); } @@ -471,7 +471,7 @@ private void loadVisualisation(final VisFunction function, final DocRef visualis } }) .onFailure(caught -> failure(function, caught.getMessage())) - .taskHandlerFactory(getView().getRefreshButton()) + .taskMonitorFactory(getView().getRefreshButton()) .exec(); } @@ -482,7 +482,7 @@ private void loadScripts(final VisFunction function, final DocRef scriptRef) { .method(res -> res.fetchLinkedScripts( new FetchLinkedScriptRequest(scriptRef, scriptCache.getLoadedScripts()))) .onSuccess(result -> startInjectingScripts(result, function)) - .taskHandlerFactory(getView().getRefreshButton()) + .taskMonitorFactory(getView().getRefreshButton()) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/ResultStoreModel.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/ResultStoreModel.java index fc104320b42..06217958a30 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/ResultStoreModel.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/ResultStoreModel.java @@ -11,7 +11,7 @@ import stroom.query.shared.DestroyStoreRequest; import stroom.query.shared.ResultStoreResource; import stroom.query.shared.UpdateStoreRequest; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.client.DelayedUpdate; import stroom.util.shared.ResultPage; @@ -49,26 +49,26 @@ public ResultStoreModel(final RestFactory restFactory, public void fetch(final Range range, final Consumer> dataConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { this.range = range; this.dataConsumer = dataConsumer; delayedUpdate.reset(); - fetchNodes(range, dataConsumer, errorHandler, taskHandlerFactory); + fetchNodes(range, dataConsumer, errorHandler, taskMonitorFactory); } private void fetchNodes(final Range range, final Consumer> dataConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { nodeManager.listAllNodes( - nodeNames -> fetchTasksForNodes(range, dataConsumer, nodeNames, taskHandlerFactory), - errorHandler, taskHandlerFactory); + nodeNames -> fetchTasksForNodes(range, dataConsumer, nodeNames, taskMonitorFactory), + errorHandler, taskMonitorFactory); } private void fetchTasksForNodes(final Range range, final Consumer> dataConsumer, final List nodeNames, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { responseMap.clear(); CriteriaUtil.setRange(criteria, range); for (final String nodeName : nodeNames) { @@ -83,7 +83,7 @@ private void fetchTasksForNodes(final Range range, responseMap.remove(nodeName); delayedUpdate.update(); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } @@ -99,13 +99,13 @@ private void update() { public void terminate(final String nodeName, final QueryKey queryKey, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(RESULT_STORE_RESOURCE) .method(res -> res.terminate(nodeName, queryKey)) .onSuccess(consumer) .onFailure(t -> consumer.accept(false)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -113,26 +113,26 @@ public void destroy(final String nodeName, final QueryKey queryKey, final DestroyReason destroyReason, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(RESULT_STORE_RESOURCE) .method(res -> res.destroy(nodeName, new DestroyStoreRequest(queryKey, destroyReason))) .onSuccess(consumer) .onFailure(t -> consumer.accept(false)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void updateSettings(final String nodeName, final UpdateStoreRequest updateStoreRequest, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(RESULT_STORE_RESOURCE) .method(res -> res.update(nodeName, updateStoreRequest)) .onSuccess(consumer) .onFailure(t -> consumer.accept(false)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/TextPresenter.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/TextPresenter.java index cd3b25c25b5..70bdd5dab67 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/TextPresenter.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/TextPresenter.java @@ -28,7 +28,7 @@ import stroom.query.api.v2.Column; import stroom.query.client.presenter.TextPresenter.TextView; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.DefaultLocation; import stroom.util.shared.TextRange; @@ -608,7 +608,7 @@ public void run() { } } }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }; @@ -719,7 +719,7 @@ public void beginStepping() { } - public interface TextView extends View, HasUiHandlers, TaskHandlerFactory { + public interface TextView extends View, HasUiHandlers, TaskMonitorFactory { void setContent(View view); diff --git a/stroom-core-client/src/main/java/stroom/query/client/presenter/TimeZones.java b/stroom-core-client/src/main/java/stroom/query/client/presenter/TimeZones.java index d958971c63d..9a149a54633 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/presenter/TimeZones.java +++ b/stroom-core-client/src/main/java/stroom/query/client/presenter/TimeZones.java @@ -16,7 +16,7 @@ package stroom.query.client.presenter; -import stroom.dispatch.client.QuietTaskListener; +import stroom.dispatch.client.QuietTaskMonitorFactory; import stroom.dispatch.client.RestFactory; import stroom.query.shared.QueryResource; @@ -61,7 +61,7 @@ public void getIds(final Consumer> consumer) { ids = result; consumer.accept(ids); }) - .taskHandlerFactory(new QuietTaskListener()) + .taskMonitorFactory(new QuietTaskMonitorFactory()) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/query/client/view/TextViewImpl.java b/stroom-core-client/src/main/java/stroom/query/client/view/TextViewImpl.java index 1ade1244cc9..ace27f604dd 100644 --- a/stroom-core-client/src/main/java/stroom/query/client/view/TextViewImpl.java +++ b/stroom-core-client/src/main/java/stroom/query/client/view/TextViewImpl.java @@ -20,7 +20,7 @@ import stroom.query.client.presenter.TextPresenter.TextView; import stroom.query.client.presenter.TextUiHandlers; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.button.client.FabButton; import stroom.widget.button.client.InlineSvgButton; import stroom.widget.spinner.client.SpinnerLarge; @@ -86,8 +86,8 @@ public void setSteppingVisible(final boolean visible) { } @Override - public TaskHandler createTaskHandler() { - return spinner.createTaskHandler(); + public TaskMonitor createTaskMonitor() { + return spinner.createTaskMonitor(); } @UiHandler("close") diff --git a/stroom-core-client/src/main/java/stroom/receive/rules/client/RuleSetPlugin.java b/stroom-core-client/src/main/java/stroom/receive/rules/client/RuleSetPlugin.java index 7f7ee6bf919..96e3d4e805d 100644 --- a/stroom-core-client/src/main/java/stroom/receive/rules/client/RuleSetPlugin.java +++ b/stroom-core-client/src/main/java/stroom/receive/rules/client/RuleSetPlugin.java @@ -28,7 +28,7 @@ import stroom.receive.rules.shared.ReceiveDataRuleSetResource; import stroom.receive.rules.shared.ReceiveDataRules; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -70,13 +70,13 @@ public RuleSetPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(RULES_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -85,13 +85,13 @@ public void save(final DocRef docRef, final ReceiveDataRules document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(RULES_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionImpactPresenter.java b/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionImpactPresenter.java index 785325b5517..91dc851823f 100644 --- a/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionImpactPresenter.java +++ b/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionImpactPresenter.java @@ -187,7 +187,7 @@ private void refreshSourceData(final Range range) { updateButtonStates(); AlertEvent.fireErrorFromException(this, error.getException(), null); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -209,7 +209,7 @@ private void cancelQuery() { updateButtonStates(); AlertEvent.fireErrorFromException(this, error.getException(), null); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionPolicyPresenter.java b/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionPolicyPresenter.java index bf0956db555..0a9625cfcfa 100644 --- a/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionPolicyPresenter.java +++ b/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionPolicyPresenter.java @@ -139,7 +139,7 @@ private void initialiseRules(final RestFactory restFactory) { setVisibleRules(policy.getRules()); update(); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -463,7 +463,7 @@ private void addSaveButtonHandler() { update(); setDirty(false); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); })); } diff --git a/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionPresenter.java b/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionPresenter.java index d7f4df8c033..e522f852f5e 100644 --- a/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionPresenter.java +++ b/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionPresenter.java @@ -31,7 +31,7 @@ import stroom.svg.shared.SvgImage; import stroom.task.client.SimpleTask; import stroom.task.client.Task; -import stroom.task.client.TaskHandler; +import stroom.task.client.TaskMonitor; import stroom.widget.tab.client.presenter.LinkTabsLayoutView; import stroom.widget.tab.client.presenter.TabData; import stroom.widget.tab.client.presenter.TabDataImpl; @@ -127,9 +127,9 @@ public void addTab(final TabData tab) { } public void selectTab(final TabData tab) { - final TaskHandler taskHandler = createTaskHandler(); + final TaskMonitor taskMonitor = createTaskMonitor(); final Task task = new SimpleTask("Selecting tab"); - taskHandler.onStart(task); + taskMonitor.onStart(task); Scheduler.get().scheduleDeferred(() -> { if (tab != null) { getContent(tab, content -> { @@ -147,7 +147,7 @@ public void selectTab(final TabData tab) { } }); } - taskHandler.onEnd(task); + taskMonitor.onEnd(task); }); } diff --git a/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionRulePresenter.java b/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionRulePresenter.java index 7b9348d0db4..2cacaff6a39 100644 --- a/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionRulePresenter.java +++ b/stroom-core-client/src/main/java/stroom/receive/rules/client/presenter/DataRetentionRulePresenter.java @@ -24,7 +24,7 @@ import stroom.query.api.v2.ExpressionOperator; import stroom.query.client.presenter.DynamicFieldSelectionListModel; import stroom.receive.rules.client.presenter.DataRetentionRulePresenter.DataRetentionRuleView; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.time.TimeUnit; import com.google.gwt.user.client.ui.Focus; @@ -85,9 +85,9 @@ DataRetentionRule write() { } @Override - public synchronized void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - fieldSelectionBoxModel.setTaskHandlerFactory(taskHandlerFactory); + public synchronized void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + fieldSelectionBoxModel.setTaskMonitorFactory(taskMonitorFactory); } public interface DataRetentionRuleView extends View { diff --git a/stroom-core-client/src/main/java/stroom/schedule/client/ScheduledTimeClient.java b/stroom-core-client/src/main/java/stroom/schedule/client/ScheduledTimeClient.java index 9726f58cd24..76bef7000be 100644 --- a/stroom-core-client/src/main/java/stroom/schedule/client/ScheduledTimeClient.java +++ b/stroom-core-client/src/main/java/stroom/schedule/client/ScheduledTimeClient.java @@ -6,7 +6,7 @@ import stroom.job.shared.ScheduleRestriction; import stroom.job.shared.ScheduledTimeResource; import stroom.job.shared.ScheduledTimes; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.scheduler.Schedule; import com.google.gwt.core.client.GWT; @@ -33,21 +33,21 @@ public ScheduledTimeClient(final EventBus eventBus, final RestFactory restFactor public void validate(final Schedule schedule, final ScheduleRestriction scheduleRestriction, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { final GetScheduledTimesRequest request = new GetScheduledTimesRequest(schedule, null, scheduleRestriction); - getScheduledTimes(request, consumer, taskHandlerFactory); + getScheduledTimes(request, consumer, taskMonitorFactory); } public void getScheduledTimes(final GetScheduledTimesRequest request, final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(SCHEDULED_TIME_RESOURCE) .method(res -> res.get(request)) .onSuccess(consumer) .onFailure(new DefaultErrorHandler(this, () -> consumer.accept(null))) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/script/client/ScriptPlugin.java b/stroom-core-client/src/main/java/stroom/script/client/ScriptPlugin.java index 180aa60b684..0d8d2162ee4 100644 --- a/stroom-core-client/src/main/java/stroom/script/client/ScriptPlugin.java +++ b/stroom-core-client/src/main/java/stroom/script/client/ScriptPlugin.java @@ -29,7 +29,7 @@ import stroom.script.shared.ScriptDoc; import stroom.script.shared.ScriptResource; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -68,13 +68,13 @@ public ScriptPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(SCRIPT_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final ScriptDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(SCRIPT_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/search/elastic/client/ElasticClusterPlugin.java b/stroom-core-client/src/main/java/stroom/search/elastic/client/ElasticClusterPlugin.java index 561186405ab..b3e8cd41f0b 100644 --- a/stroom-core-client/src/main/java/stroom/search/elastic/client/ElasticClusterPlugin.java +++ b/stroom-core-client/src/main/java/stroom/search/elastic/client/ElasticClusterPlugin.java @@ -29,7 +29,7 @@ import stroom.search.elastic.shared.ElasticClusterDoc; import stroom.search.elastic.shared.ElasticClusterResource; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -70,13 +70,13 @@ public ElasticClusterPlugin( public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(ELASTIC_CLUSTER_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -85,13 +85,13 @@ public void save(final DocRef docRef, final ElasticClusterDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(ELASTIC_CLUSTER_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/search/elastic/client/ElasticIndexPlugin.java b/stroom-core-client/src/main/java/stroom/search/elastic/client/ElasticIndexPlugin.java index e42b489ffff..c972d88fab9 100644 --- a/stroom-core-client/src/main/java/stroom/search/elastic/client/ElasticIndexPlugin.java +++ b/stroom-core-client/src/main/java/stroom/search/elastic/client/ElasticIndexPlugin.java @@ -29,7 +29,7 @@ import stroom.search.elastic.shared.ElasticIndexDoc; import stroom.search.elastic.shared.ElasticIndexResource; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -70,13 +70,13 @@ public ElasticIndexPlugin( public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(ELASTIC_INDEX_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -85,13 +85,13 @@ public void save(final DocRef docRef, final ElasticIndexDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(ELASTIC_INDEX_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticClusterSettingsPresenter.java b/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticClusterSettingsPresenter.java index ee8e9ca13bf..00817b63100 100644 --- a/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticClusterSettingsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticClusterSettingsPresenter.java @@ -26,7 +26,7 @@ import stroom.search.elastic.shared.ElasticClusterDoc; import stroom.search.elastic.shared.ElasticClusterResource; import stroom.search.elastic.shared.ElasticConnectionConfig; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -66,7 +66,7 @@ public void onChange() { } @Override - public void onTestConnection(final TaskHandlerFactory taskHandlerFactory) { + public void onTestConnection(final TaskMonitorFactory taskMonitorFactory) { final ElasticClusterDoc cluster = onWrite(new ElasticClusterDoc()); restFactory .create(ELASTIC_CLUSTER_RESOURCE) @@ -78,7 +78,7 @@ public void onTestConnection(final TaskHandlerFactory taskHandlerFactory) { AlertEvent.fireError(this, "Connection Failure", result.getMessage(), null); } }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticClusterSettingsUiHandlers.java b/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticClusterSettingsUiHandlers.java index c50cd141c78..3fdd8e0968e 100644 --- a/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticClusterSettingsUiHandlers.java +++ b/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticClusterSettingsUiHandlers.java @@ -16,12 +16,12 @@ package stroom.search.elastic.client.presenter; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.gwtplatform.mvp.client.UiHandlers; public interface ElasticClusterSettingsUiHandlers extends UiHandlers { void onChange(); - void onTestConnection(TaskHandlerFactory taskHandlerFactory); + void onTestConnection(TaskMonitorFactory taskMonitorFactory); } diff --git a/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticIndexSettingsPresenter.java b/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticIndexSettingsPresenter.java index 14e641a0317..b4f586f1606 100644 --- a/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticIndexSettingsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/search/elastic/client/presenter/ElasticIndexSettingsPresenter.java @@ -33,7 +33,7 @@ import stroom.search.elastic.shared.ElasticIndexDoc; import stroom.search.elastic.shared.ElasticIndexResource; import stroom.security.shared.DocumentPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -107,7 +107,7 @@ public void onTestIndex() { AlertEvent.fireError(this, "Connection Failure", result.getMessage(), null); } }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -150,9 +150,9 @@ protected ElasticIndexDoc onWrite(final ElasticIndexDoc index) { } @Override - public synchronized void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - fieldSelectionBoxModel.setTaskHandlerFactory(taskHandlerFactory); + public synchronized void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + fieldSelectionBoxModel.setTaskMonitorFactory(taskMonitorFactory); } public interface ElasticIndexSettingsView diff --git a/stroom-core-client/src/main/java/stroom/search/solr/client/SolrIndexPlugin.java b/stroom-core-client/src/main/java/stroom/search/solr/client/SolrIndexPlugin.java index 5842e12a626..c08ab140e4c 100644 --- a/stroom-core-client/src/main/java/stroom/search/solr/client/SolrIndexPlugin.java +++ b/stroom-core-client/src/main/java/stroom/search/solr/client/SolrIndexPlugin.java @@ -29,7 +29,7 @@ import stroom.search.solr.shared.SolrIndexDoc; import stroom.search.solr.shared.SolrIndexResource; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -68,13 +68,13 @@ public SolrIndexPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(SOLR_INDEX_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final SolrIndexDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(SOLR_INDEX_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexFieldListPresenter.java b/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexFieldListPresenter.java index 64f3cabb327..62acc19b9c7 100644 --- a/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexFieldListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexFieldListPresenter.java @@ -279,7 +279,7 @@ private void fetchFieldTypes(final Consumer> consumer) { "Unable to connect to Solr please check connection", throwable.getMessage(), null)) - .taskHandlerFactory(pagerView) + .taskMonitorFactory(pagerView) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexSettingsPresenter.java b/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexSettingsPresenter.java index 0ee66b19a93..c3358318eb6 100644 --- a/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexSettingsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexSettingsPresenter.java @@ -34,7 +34,7 @@ import stroom.search.solr.shared.SolrIndexDoc; import stroom.search.solr.shared.SolrIndexResource; import stroom.security.shared.DocumentPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -88,7 +88,7 @@ public void onChange() { } @Override - public void onTestConnection(final TaskHandlerFactory taskHandlerFactory) { + public void onTestConnection(final TaskMonitorFactory taskMonitorFactory) { getView().setTestingConnection(true); final SolrIndexDoc index = onWrite(new SolrIndexDoc()); restFactory @@ -104,7 +104,7 @@ public void onTestConnection(final TaskHandlerFactory taskHandlerFactory) { } }) .onFailure(new DefaultErrorHandler(this, () -> getView().setTestingConnection(false))) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -152,9 +152,9 @@ protected SolrIndexDoc onWrite(final SolrIndexDoc index) { } @Override - public synchronized void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - super.setTaskHandlerFactory(taskHandlerFactory); - fieldSelectionBoxModel.setTaskHandlerFactory(taskHandlerFactory); + public synchronized void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + super.setTaskMonitorFactory(taskMonitorFactory); + fieldSelectionBoxModel.setTaskMonitorFactory(taskMonitorFactory); } public interface SolrIndexSettingsView diff --git a/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexSettingsUiHandlers.java b/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexSettingsUiHandlers.java index ffe75864779..89347c17ef9 100644 --- a/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexSettingsUiHandlers.java +++ b/stroom-core-client/src/main/java/stroom/search/solr/client/presenter/SolrIndexSettingsUiHandlers.java @@ -16,7 +16,7 @@ package stroom.search.solr.client.presenter; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.gwtplatform.mvp.client.UiHandlers; @@ -24,5 +24,5 @@ public interface SolrIndexSettingsUiHandlers extends UiHandlers { void onChange(); - void onTestConnection(TaskHandlerFactory taskHandlerFactory); + void onTestConnection(TaskMonitorFactory taskMonitorFactory); } diff --git a/stroom-core-client/src/main/java/stroom/security/client/CurrentUser.java b/stroom-core-client/src/main/java/stroom/security/client/CurrentUser.java index 630ed92c478..1e3029bf210 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/CurrentUser.java +++ b/stroom-core-client/src/main/java/stroom/security/client/CurrentUser.java @@ -28,7 +28,7 @@ import stroom.security.shared.CheckDocumentPermissionRequest; import stroom.security.shared.DocPermissionResource; import stroom.security.shared.DocumentPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.UserRef; import com.google.gwt.core.client.GWT; @@ -121,14 +121,14 @@ public void hasDocumentPermission(final DocRef docRef, final DocumentPermission permission, final Consumer consumer, final Consumer errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(DOC_PERMISSION_RESOURCE) .method(res -> res.checkDocumentPermission(new CheckDocumentPermissionRequest(docRef, permission))) .onSuccess(consumer) .onFailure(t -> errorHandler.accept(t.getException())) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/security/client/LoginManager.java b/stroom-core-client/src/main/java/stroom/security/client/LoginManager.java index 0a242667788..d8391891afc 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/LoginManager.java +++ b/stroom-core-client/src/main/java/stroom/security/client/LoginManager.java @@ -21,7 +21,7 @@ import stroom.security.client.api.event.LogoutEvent; import stroom.security.shared.AppPermissionResource; import stroom.security.shared.SessionResource; -import stroom.task.client.DefaultTaskListener; +import stroom.task.client.DefaultTaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.event.shared.GwtEvent; @@ -67,7 +67,7 @@ public void fetchUserAndPermissions() { .onFailure(throwable -> { AlertEvent.fireInfo(LoginManager.this, throwable.getMessage(), this::logout); }) - .taskHandlerFactory(new DefaultTaskListener(this), "Fetching permissions...") + .taskMonitorFactory(new DefaultTaskMonitorFactory(this), "Fetching permissions...") .exec(); } @@ -79,7 +79,7 @@ private void logout() { .onSuccess(response -> setLocation(response.getUrl())) .onFailure(restError -> AlertEvent .fireErrorFromException(LoginManager.this, restError.getException(), null)) - .taskHandlerFactory(new DefaultTaskListener(this)) + .taskMonitorFactory(new DefaultTaskMonitorFactory(this)) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/security/client/api/ClientSecurityContext.java b/stroom-core-client/src/main/java/stroom/security/client/api/ClientSecurityContext.java index b0b2224a71f..9d0290d608a 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/api/ClientSecurityContext.java +++ b/stroom-core-client/src/main/java/stroom/security/client/api/ClientSecurityContext.java @@ -19,7 +19,7 @@ import stroom.docref.DocRef; import stroom.security.shared.AppPermission; import stroom.security.shared.DocumentPermission; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.UserRef; import java.util.function.Consumer; @@ -54,8 +54,8 @@ public interface ClientSecurityContext { * Check if the user associated with this security context has the requested * permission on the document specified by the document uuid. * - * @param docRef The ref of the document. - * @param permission The permission we are checking for. + * @param docRef The ref of the document. + * @param permission The permission we are checking for. * @return True if the user associated with the security context has the * requested permission. */ @@ -63,5 +63,5 @@ void hasDocumentPermission(DocRef docRef, DocumentPermission permission, Consumer consumer, Consumer errorHandler, - TaskHandlerFactory taskHandlerFactory); + TaskMonitorFactory taskMonitorFactory); } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/AbstractRestClient.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/AbstractRestClient.java index 28c777f85c1..058b36ed1ac 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/AbstractRestClient.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/AbstractRestClient.java @@ -1,7 +1,7 @@ package stroom.security.client.presenter; import stroom.dispatch.client.RestFactory; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.HasHandlers; @@ -11,7 +11,7 @@ public abstract class AbstractRestClient implements HasHandlers { protected final EventBus eventBus; protected final RestFactory restFactory; - protected TaskHandlerFactory taskHandlerFactory; + protected TaskMonitorFactory taskMonitorFactory; public AbstractRestClient(final EventBus eventBus, final RestFactory restFactory) { @@ -19,8 +19,8 @@ public AbstractRestClient(final EventBus eventBus, this.restFactory = restFactory; } - public void setTaskHandlerFactory(final TaskHandlerFactory taskHandlerFactory) { - this.taskHandlerFactory = taskHandlerFactory; + public void setTaskMonitorFactory(final TaskMonitorFactory taskMonitorFactory) { + this.taskMonitorFactory = taskMonitorFactory; } @Override diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/ApiKeysListPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/ApiKeysListPresenter.java index a84e326bb66..9b06575959f 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/ApiKeysListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/ApiKeysListPresenter.java @@ -25,7 +25,7 @@ import stroom.security.shared.HashAlgorithm; import stroom.security.shared.HashedApiKey; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.client.DataGridUtil; import stroom.util.shared.GwtNullSafe; import stroom.util.shared.Selection; @@ -210,7 +210,7 @@ private void deleteSelectedKeys() { onSuccess.run(); }) .onFailure(onFailure) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }); @@ -227,7 +227,7 @@ private void deleteSelectedKeys() { onSuccess.run(); }) .onFailure(onFailure) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }); @@ -315,7 +315,7 @@ private void initTableColumns() { private void fetchData(final Range range, final Consumer dataConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(API_KEY_RESOURCE) .method(res -> res.find(criteria)) @@ -342,7 +342,7 @@ private void fetchData(final Range range, "Error fetching API Keys: " + throwable.getMessage(), null); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/AppPermissionsEditPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/AppPermissionsEditPresenter.java index e3bd69c9207..8106025d2c1 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/AppPermissionsEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/AppPermissionsEditPresenter.java @@ -237,7 +237,7 @@ private void refresh() { updateAllPermissions(); updateDetails(); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -299,7 +299,7 @@ public TickBoxState getValue(final AppPermission permission) { .create(APP_PERMISSION_RESOURCE) .method(res -> res.changeAppPermission(request)) .onSuccess(result -> refresh()) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); }); } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/AppUserPermissionsListPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/AppUserPermissionsListPresenter.java index 0b9f6c8f222..472a7f4af86 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/AppUserPermissionsListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/AppUserPermissionsListPresenter.java @@ -160,7 +160,7 @@ protected void exec(final Range range, .method(res -> res.fetchAppUserPermissions(builder.build())) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(pagerView) + .taskMonitorFactory(pagerView) .exec(); } }; diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/BatchDocumentPermissionsEditPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/BatchDocumentPermissionsEditPresenter.java index 14158ebd151..db2c43a0d82 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/BatchDocumentPermissionsEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/BatchDocumentPermissionsEditPresenter.java @@ -31,7 +31,7 @@ import stroom.security.shared.BulkDocumentPermissionChangeRequest; import stroom.security.shared.DocumentPermission; import stroom.security.shared.DocumentPermissionChange; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.PageResponse; import stroom.widget.popup.client.event.ShowPopupEvent; import stroom.widget.popup.client.presenter.PopupSize; @@ -207,7 +207,7 @@ private AbstractDocumentPermissionsChange createChange() { } @Override - public void apply(final TaskHandlerFactory taskHandlerFactory) { + public void apply(final TaskMonitorFactory taskMonitorFactory) { int docCount = 0; if (currentResultPageResponse != null) { docCount = currentResultPageResponse.getLength(); @@ -227,14 +227,14 @@ public void apply(final TaskHandlerFactory taskHandlerFactory) { message, ok -> { if (ok) { - doApply(taskHandlerFactory); + doApply(taskMonitorFactory); } } ); } } - private void doApply(final TaskHandlerFactory taskHandlerFactory) { + private void doApply(final TaskMonitorFactory taskMonitorFactory) { final BulkDocumentPermissionChangeRequest request = createRequest(); restFactory .create(EXPLORER_RESOURCE) @@ -252,7 +252,7 @@ private void doApply(final TaskHandlerFactory taskHandlerFactory) { null); } }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/BatchDocumentPermissionsEditUiHandlers.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/BatchDocumentPermissionsEditUiHandlers.java index d98d57113c5..e7412ac04d3 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/BatchDocumentPermissionsEditUiHandlers.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/BatchDocumentPermissionsEditUiHandlers.java @@ -1,6 +1,6 @@ package stroom.security.client.presenter; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.gwtplatform.mvp.client.UiHandlers; @@ -8,5 +8,5 @@ public interface BatchDocumentPermissionsEditUiHandlers extends UiHandlers { void validate(); - void apply(TaskHandlerFactory taskHandlerFactory); + void apply(TaskMonitorFactory taskMonitorFactory); } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateExternalUserPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateExternalUserPresenter.java index 7927dba6c79..9077fd7f9c3 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateExternalUserPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateExternalUserPresenter.java @@ -23,7 +23,7 @@ import stroom.security.client.presenter.CreateExternalUserPresenter.CreateExternalUserView; import stroom.security.shared.User; import stroom.security.shared.UserResource; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.shared.UserDesc; import stroom.widget.popup.client.event.HidePopupRequestEvent; import stroom.widget.popup.client.view.DialogActionUiHandlers; @@ -57,7 +57,7 @@ public void setDialogActionUiHandlers(final DialogActionUiHandlers dialogActionU public void create(final Consumer consumer, final HidePopupRequestEvent event, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { final UserDesc userDesc = new UserDesc( getView().getSubjectId(), getView().getDisplayName(), @@ -67,28 +67,28 @@ public void create(final Consumer consumer, .method(res -> res.createUser(userDesc)) .onSuccess(result -> { if (!result.isEnabled()) { - enable(result, consumer, event, taskHandlerFactory); + enable(result, consumer, event, taskMonitorFactory); } else { consumer.accept(result); event.hide(); } }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } private void enable(final User user, final Consumer consumer, final HidePopupRequestEvent event, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { ConfirmEvent.fire(this, "A deleted user already exists with the same name, " + "would you like to restore the existing user?", ok -> { if (ok) { user.setEnabled(true); - update(user, consumer, event, taskHandlerFactory); + update(user, consumer, event, taskMonitorFactory); } else { consumer.accept(user); event.hide(); @@ -99,7 +99,7 @@ private void enable(final User user, private void update(final User user, final Consumer consumer, final HidePopupRequestEvent event, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(USER_RESOURCE) .method(res -> res.update(user)) @@ -108,7 +108,7 @@ private void update(final User user, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateMultipleUsersPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateMultipleUsersPresenter.java index 4b0a2c47208..014a4a4f927 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateMultipleUsersPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateMultipleUsersPresenter.java @@ -23,7 +23,7 @@ import stroom.security.client.presenter.CreateMultipleUsersPresenter.CreateMultipleUsersView; import stroom.security.shared.User; import stroom.security.shared.UserResource; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.popup.client.event.HidePopupRequestEvent; import com.google.gwt.core.client.GWT; @@ -53,7 +53,7 @@ public CreateMultipleUsersPresenter(final EventBus eventBus, public void create(final Consumer consumer, final HidePopupRequestEvent event, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { final String usersCsvData = getView().getUsersCsvData(); if (usersCsvData != null && !usersCsvData.isEmpty()) { restFactory @@ -72,7 +72,7 @@ public void create(final Consumer consumer, "would you like to restore them?", ok -> { if (ok) { - enable(disabled, consumer, event, nextSelection, taskHandlerFactory); + enable(disabled, consumer, event, nextSelection, taskMonitorFactory); } else { nextSelection.ifPresent(consumer); event.hide(); @@ -87,7 +87,7 @@ public void create(final Consumer consumer, } }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } else { event.hide(); @@ -98,7 +98,7 @@ private void enable(final List disabled, final Consumer consumer, final HidePopupRequestEvent event, final Optional nextSelection, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { if (disabled.size() == 0) { nextSelection.ifPresent(consumer); event.hide(); @@ -109,9 +109,9 @@ private void enable(final List disabled, .create(USER_RESOURCE) .method(res -> res.update(user)) .onSuccess(result -> { - enable(disabled, consumer, event, nextSelection, taskHandlerFactory); + enable(disabled, consumer, event, nextSelection, taskMonitorFactory); }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateNewGroupPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateNewGroupPresenter.java index 0e07e2881b2..db1ee8cc8bb 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateNewGroupPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/CreateNewGroupPresenter.java @@ -23,7 +23,7 @@ import stroom.entity.client.presenter.NameDocumentView; import stroom.security.shared.User; import stroom.security.shared.UserResource; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.widget.popup.client.event.HidePopupRequestEvent; import stroom.widget.popup.client.view.DialogActionUiHandlers; @@ -54,34 +54,34 @@ public void setDialogActionUiHandlers(final DialogActionUiHandlers dialogActionU public void create(final Consumer consumer, final HidePopupRequestEvent event, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(USER_RESOURCE) .method(res -> res.createGroup(getView().getName())) .onSuccess(result -> { if (!result.isEnabled()) { - enable(result, consumer, event, taskHandlerFactory); + enable(result, consumer, event, taskMonitorFactory); } else { consumer.accept(result); event.hide(); } }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } private void enable(final User user, final Consumer consumer, final HidePopupRequestEvent event, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { ConfirmEvent.fire(this, "A deleted group already exists with the same name, " + "would you like to restore the existing group?", ok -> { if (ok) { user.setEnabled(true); - update(user, consumer, event, taskHandlerFactory); + update(user, consumer, event, taskMonitorFactory); } else { consumer.accept(user); event.hide(); @@ -92,7 +92,7 @@ private void enable(final User user, private void update(final User user, final Consumer consumer, final HidePopupRequestEvent event, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(USER_RESOURCE) .method(res -> res.update(user)) @@ -101,7 +101,7 @@ private void update(final User user, event.hide(); }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/DocPermissionRestClient.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/DocPermissionRestClient.java index 6e6d9807ffa..05091241c63 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/DocPermissionRestClient.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/DocPermissionRestClient.java @@ -32,7 +32,7 @@ public void getDocUserPermissionsReport(final DocRef docRef, .create(DOC_PERMISSION_RESOURCE) .method(res -> res.getDocUserPermissionsReport(request)) .onSuccess(consumer) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/DocumentUserPermissionsEditPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/DocumentUserPermissionsEditPresenter.java index a343212e906..b6b30657616 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/DocumentUserPermissionsEditPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/DocumentUserPermissionsEditPresenter.java @@ -72,8 +72,8 @@ public DocumentUserPermissionsEditPresenter(final EventBus eventBus, this.docPermissionClient = docPermissionClient; this.explorerClient = explorerClient; view.setUiHandlers(this); - docPermissionClient.setTaskHandlerFactory(this); - explorerClient.setTaskHandlerFactory(this); + docPermissionClient.setTaskMonitorFactory(this); + explorerClient.setTaskMonitorFactory(this); } public void show(final DocRef docRef, diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/DocumentUserPermissionsListPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/DocumentUserPermissionsListPresenter.java index 94b29a08608..4f2367c79e8 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/DocumentUserPermissionsListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/DocumentUserPermissionsListPresenter.java @@ -160,7 +160,7 @@ protected void exec(final Range range, .method(res -> res.fetchDocumentUserPermissions(request)) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(pagerView) + .taskMonitorFactory(pagerView) .exec(); } }; diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/EditApiKeyPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/EditApiKeyPresenter.java index 5ddc4e3809a..80170666f7a 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/EditApiKeyPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/EditApiKeyPresenter.java @@ -185,7 +185,7 @@ private void handleEditModeHide(final HidePopupRequestEvent e) { .onFailure(throwable -> AlertEvent.fireError(this, "Error updating API key: " + throwable.getMessage(), e::reset)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } else { @@ -223,7 +223,7 @@ private void handlePostCreateModeHide(final HidePopupRequestEvent e) { .onFailure(throwable -> AlertEvent.fireError(this, "Error deleting API key: " + throwable.getMessage(), e::reset)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } else { e.reset(); @@ -280,7 +280,7 @@ private void handlePreCreateModeHide(final HidePopupRequestEvent event, .onFailure(throwable -> AlertEvent.fireError(this, "Error creating API key: " + throwable.getMessage(), event::reset)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/ExplorerClient.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/ExplorerClient.java index fe71d90e80c..5a31f4a79ad 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/ExplorerClient.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/ExplorerClient.java @@ -28,7 +28,7 @@ public void changeDocumentPermssions(final BulkDocumentPermissionChangeRequest r .method(res -> res.changeDocumentPermissions(request)) .onSuccess(consumer) .onFailure(new DefaultErrorHandler(this, () -> consumer.accept(false))) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/UserAndGroupsPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/UserAndGroupsPresenter.java index 9ae42302291..02ddef6c5ce 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/UserAndGroupsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/UserAndGroupsPresenter.java @@ -255,7 +255,7 @@ private void addUserToGroup(final UserRef user, memberOfList.refresh(); membersInList.refresh(); }) - .taskHandlerFactory(userListPresenter.getPagerView()) + .taskMonitorFactory(userListPresenter.getPagerView()) .exec(); } } @@ -281,7 +281,7 @@ private void removeUserFromGroup(final User user, userListPresenter.getSelectionModel().setSelected(nextSelection); } }) - .taskHandlerFactory(userListPresenter.getPagerView()) + .taskMonitorFactory(userListPresenter.getPagerView()) .exec(); } } @@ -329,7 +329,7 @@ private void onDelete() { userList.getSelectionModel().clear(true); userList.refresh(); }) - .taskHandlerFactory(userList.getPagerView()) + .taskMonitorFactory(userList.getPagerView()) .exec(); } }); diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/UserListPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/UserListPresenter.java index 2dba4b25098..66b58ca0b05 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/UserListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/UserListPresenter.java @@ -224,7 +224,7 @@ protected void exec(final Range range, .method(res -> res.find(builder.build())) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(pagerView) + .taskMonitorFactory(pagerView) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/security/client/presenter/UserRefPopupPresenter.java b/stroom-core-client/src/main/java/stroom/security/client/presenter/UserRefPopupPresenter.java index 7cbb5b1929b..625a5255264 100644 --- a/stroom-core-client/src/main/java/stroom/security/client/presenter/UserRefPopupPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/client/presenter/UserRefPopupPresenter.java @@ -286,7 +286,7 @@ protected void exec(final Range range, .method(res -> res.find(builder.build())) .onSuccess(dataConsumer) .onFailure(errorHandler) - .taskHandlerFactory(pagerView) + .taskMonitorFactory(pagerView) .exec(); } }; diff --git a/stroom-core-client/src/main/java/stroom/security/identity/client/ChangePasswordPlugin.java b/stroom-core-client/src/main/java/stroom/security/identity/client/ChangePasswordPlugin.java index 1dffa6ddf3c..2858f3fd05a 100644 --- a/stroom-core-client/src/main/java/stroom/security/identity/client/ChangePasswordPlugin.java +++ b/stroom-core-client/src/main/java/stroom/security/identity/client/ChangePasswordPlugin.java @@ -6,7 +6,7 @@ import stroom.security.identity.client.presenter.CurrentPasswordPresenter; import stroom.svg.client.IconColour; import stroom.svg.shared.SvgImage; -import stroom.task.client.DefaultTaskListener; +import stroom.task.client.DefaultTaskMonitorFactory; import stroom.ui.config.client.UiConfigCache; import stroom.widget.menu.client.presenter.IconMenuItem; @@ -48,6 +48,6 @@ public void onReveal(final BeforeRevealMenubarEvent event) { event.getMenuItems().addMenuItem(MenuKeys.USER_MENU, changePasswordMenuItem); } - }, new DefaultTaskListener(this)); + }, new DefaultTaskMonitorFactory(this)); } } diff --git a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/AccountsListPresenter.java b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/AccountsListPresenter.java index 9647f654def..48438d521ae 100644 --- a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/AccountsListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/AccountsListPresenter.java @@ -21,7 +21,7 @@ import stroom.security.identity.shared.FindAccountRequest; import stroom.security.shared.AppPermission; import stroom.svg.shared.SvgImage; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.util.client.DataGridUtil; import stroom.util.shared.CriteriaFieldSort; import stroom.util.shared.GwtNullSafe; @@ -170,7 +170,7 @@ private void deleteSelectedAccount() { this.refresh(); }) .onFailure(e -> AlertEvent.fireError(this, e.getMessage(), this::refresh)) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }); @@ -230,7 +230,7 @@ private void initTableColumns() { private void fetchData(final Range range, final Consumer dataConsumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { final PageRequest pageRequest = new PageRequest(range.getStart(), range.getLength()); final FindAccountRequest criteria = new FindAccountRequest(pageRequest, sortList, filter); restFactory @@ -242,7 +242,7 @@ private void fetchData(final Range range, this, "Error fetching accounts: " + throwable.getMessage(), null)) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/ChangePasswordPresenter.java b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/ChangePasswordPresenter.java index 84cb8ce9d55..84a2cdc1484 100644 --- a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/ChangePasswordPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/ChangePasswordPresenter.java @@ -78,7 +78,7 @@ public void show(final String caption, final Consumer con .onHideRequest(consumer::accept) .fire(); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/CurrentPasswordPresenter.java b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/CurrentPasswordPresenter.java index 84f1424eeb8..0fae6ba06a4 100644 --- a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/CurrentPasswordPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/CurrentPasswordPresenter.java @@ -114,7 +114,7 @@ private void confirmPassword(final HidePopupRequestEvent event) { } }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } @@ -136,7 +136,7 @@ private void changePassword(final HidePopupRequestEvent event, } }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/EditAccountPresenter.java b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/EditAccountPresenter.java index d226abcb95c..ac5e99362b5 100644 --- a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/EditAccountPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/EditAccountPresenter.java @@ -153,7 +153,7 @@ private void onHideRequest(final HidePopupRequestEvent e) { .onFailure(throwable -> AlertEvent.fireError(this, "Error creating account: " + throwable.getMessage(), e::reset)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } else { @@ -178,7 +178,7 @@ private void onHideRequest(final HidePopupRequestEvent e) { .onFailure(throwable -> AlertEvent.fireError(this, "Error updating account: " + throwable.getMessage(), e::reset)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } diff --git a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/EmailResetPasswordPresenter.java b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/EmailResetPasswordPresenter.java index aad50651521..e68989a83f6 100644 --- a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/EmailResetPasswordPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/EmailResetPasswordPresenter.java @@ -106,7 +106,7 @@ private void resetPassword(final HidePopupRequestEvent event) { } }) .onFailure(RestErrorHandler.forPopup(this, event)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/LoginPresenter.java b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/LoginPresenter.java index f32f8825af1..a960593cad4 100644 --- a/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/LoginPresenter.java +++ b/stroom-core-client/src/main/java/stroom/security/identity/client/presenter/LoginPresenter.java @@ -25,7 +25,7 @@ import stroom.security.identity.shared.AuthenticationResource; import stroom.security.identity.shared.ChangePasswordRequest; import stroom.security.identity.shared.LoginRequest; -import stroom.task.client.DefaultTaskListener; +import stroom.task.client.DefaultTaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; @@ -74,7 +74,7 @@ public LoginPresenter(final EventBus eventBus, .method(AuthenticationResource::fetchPasswordPolicy) .onSuccess(result -> getView().setAllowPasswordResets(result.isAllowPasswordResets())) .onFailure(new DefaultErrorHandler(this, null)) - .taskHandlerFactory(new DefaultTaskListener(this)) + .taskMonitorFactory(new DefaultTaskMonitorFactory(this)) .exec(); } @@ -95,7 +95,7 @@ public void signIn() { } }) .onFailure(new DefaultErrorHandler(this, getView()::reset)) - .taskHandlerFactory(new DefaultTaskListener(this)) + .taskMonitorFactory(new DefaultTaskMonitorFactory(this)) .exec(); } else { getView().reset(); @@ -130,7 +130,7 @@ private void changePassword() { } }) .onFailure(RestErrorHandler.forPopup(this, e)) - .taskHandlerFactory(new DefaultTaskListener(this)) + .taskMonitorFactory(new DefaultTaskMonitorFactory(this)) .exec(); } else { diff --git a/stroom-core-client/src/main/java/stroom/state/client/ScyllaDbPlugin.java b/stroom-core-client/src/main/java/stroom/state/client/ScyllaDbPlugin.java index f20ceba625b..dd7486ee714 100644 --- a/stroom-core-client/src/main/java/stroom/state/client/ScyllaDbPlugin.java +++ b/stroom-core-client/src/main/java/stroom/state/client/ScyllaDbPlugin.java @@ -29,7 +29,7 @@ import stroom.state.client.presenter.ScyllaDbPresenter; import stroom.state.shared.ScyllaDbDoc; import stroom.state.shared.ScyllaDbDocResource; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -70,13 +70,13 @@ public ScyllaDbPlugin( public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(SCYLLA_DB_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -85,13 +85,13 @@ public void save(final DocRef docRef, final ScyllaDbDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(SCYLLA_DB_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/state/client/StateStorePlugin.java b/stroom-core-client/src/main/java/stroom/state/client/StateStorePlugin.java index e5571c68d3d..4403984017e 100644 --- a/stroom-core-client/src/main/java/stroom/state/client/StateStorePlugin.java +++ b/stroom-core-client/src/main/java/stroom/state/client/StateStorePlugin.java @@ -29,7 +29,7 @@ import stroom.state.client.presenter.StateStorePresenter; import stroom.state.shared.StateDoc; import stroom.state.shared.StateDocResource; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -70,13 +70,13 @@ public StateStorePlugin( public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(STATE_STORE_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -85,13 +85,13 @@ public void save(final DocRef docRef, final StateDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(STATE_STORE_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/state/client/presenter/ScyllaDbSettingsPresenter.java b/stroom-core-client/src/main/java/stroom/state/client/presenter/ScyllaDbSettingsPresenter.java index 8f1a33d4a58..cb4759bb7f5 100644 --- a/stroom-core-client/src/main/java/stroom/state/client/presenter/ScyllaDbSettingsPresenter.java +++ b/stroom-core-client/src/main/java/stroom/state/client/presenter/ScyllaDbSettingsPresenter.java @@ -25,7 +25,7 @@ import stroom.state.client.presenter.ScyllaDbSettingsPresenter.ScyllaDbSettingsView; import stroom.state.shared.ScyllaDbDoc; import stroom.state.shared.ScyllaDbDocResource; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.inject.Inject; @@ -63,7 +63,7 @@ public void onChange() { } @Override - public void onTestConnection(TaskHandlerFactory taskHandlerFactory) { + public void onTestConnection(TaskMonitorFactory taskMonitorFactory) { final ScyllaDbDoc cluster = onWrite(new ScyllaDbDoc()); restFactory .create(SCYLLA_DB_RESOURCE) @@ -75,7 +75,7 @@ public void onTestConnection(TaskHandlerFactory taskHandlerFactory) { AlertEvent.fireError(this, "Connection Failure", result.getMessage(), null); } }) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/state/client/presenter/ScyllaDbSettingsUiHandlers.java b/stroom-core-client/src/main/java/stroom/state/client/presenter/ScyllaDbSettingsUiHandlers.java index 94547c4a1ea..f5619f60ff6 100644 --- a/stroom-core-client/src/main/java/stroom/state/client/presenter/ScyllaDbSettingsUiHandlers.java +++ b/stroom-core-client/src/main/java/stroom/state/client/presenter/ScyllaDbSettingsUiHandlers.java @@ -16,12 +16,12 @@ package stroom.state.client.presenter; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.gwtplatform.mvp.client.UiHandlers; public interface ScyllaDbSettingsUiHandlers extends UiHandlers { void onChange(); - void onTestConnection(TaskHandlerFactory taskHandlerFactory); + void onTestConnection(TaskMonitorFactory taskMonitorFactory); } diff --git a/stroom-core-client/src/main/java/stroom/task/client/presenter/TaskManagerListPresenter.java b/stroom-core-client/src/main/java/stroom/task/client/presenter/TaskManagerListPresenter.java index 2b5f6f79bc7..484285c8be5 100644 --- a/stroom-core-client/src/main/java/stroom/task/client/presenter/TaskManagerListPresenter.java +++ b/stroom-core-client/src/main/java/stroom/task/client/presenter/TaskManagerListPresenter.java @@ -502,7 +502,7 @@ private void fetchTasksForNodes(final Range range, } delayedUpdate.update(); }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } } @@ -561,7 +561,7 @@ private void doTerminate(final TaskProgress taskProgress) { restFactory .create(TASK_RESOURCE) .method(res -> res.terminate(taskProgress.getNodeName(), request)) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/task/client/presenter/UserTaskManagerPresenter.java b/stroom-core-client/src/main/java/stroom/task/client/presenter/UserTaskManagerPresenter.java index 21b83eab838..c6655081aa8 100644 --- a/stroom-core-client/src/main/java/stroom/task/client/presenter/UserTaskManagerPresenter.java +++ b/stroom-core-client/src/main/java/stroom/task/client/presenter/UserTaskManagerPresenter.java @@ -147,7 +147,7 @@ private void refresh(final List nodeNames) { delayedUpdate.update(); refreshing.remove(nodeName); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } } @@ -217,7 +217,7 @@ public void onTerminate(final TaskProgress taskProgress) { restFactory .create(TASK_RESOURCE) .method(res -> res.terminate(taskProgress.getNodeName(), request)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); }); } diff --git a/stroom-core-client/src/main/java/stroom/ui/config/client/UiConfigCache.java b/stroom-core-client/src/main/java/stroom/ui/config/client/UiConfigCache.java index 9d040998bc5..35c2ffeb550 100644 --- a/stroom-core-client/src/main/java/stroom/ui/config/client/UiConfigCache.java +++ b/stroom-core-client/src/main/java/stroom/ui/config/client/UiConfigCache.java @@ -18,11 +18,11 @@ import stroom.config.global.shared.GlobalConfigResource; import stroom.dispatch.client.DefaultErrorHandler; -import stroom.dispatch.client.QuietTaskListener; +import stroom.dispatch.client.QuietTaskMonitorFactory; import stroom.dispatch.client.RestFactory; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.DefaultTaskListener; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.DefaultTaskMonitorFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.ui.config.shared.ExtendedUiConfig; import com.google.gwt.core.client.GWT; @@ -61,7 +61,7 @@ public void run() { // alive unnecessarily. if (securityContext.isLoggedIn()) { refreshing = true; - refresh(result -> refreshing = result != null, new QuietTaskListener()); + refresh(result -> refreshing = result != null, new QuietTaskMonitorFactory()); } } } @@ -74,7 +74,7 @@ public void run() { } public void refresh(final Consumer consumer, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(CONFIG_RESOURCE) .method(GlobalConfigResource::fetchExtendedUiConfig) @@ -84,18 +84,18 @@ public void refresh(final Consumer consumer, PropertyChangeEvent.fire(UiConfigCache.this, result); }) .onFailure(error -> new DefaultErrorHandler(this, () -> consumer.accept(null))) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } public void get(final Consumer consumer) { - get(consumer, new DefaultTaskListener(this)); + get(consumer, new DefaultTaskMonitorFactory(this)); } - public void get(final Consumer consumer, final TaskHandlerFactory taskHandlerFactory) { + public void get(final Consumer consumer, final TaskMonitorFactory taskMonitorFactory) { final ExtendedUiConfig props = clientProperties; if (props == null) { - refresh(consumer, taskHandlerFactory); + refresh(consumer, taskMonitorFactory); } consumer.accept(props); } diff --git a/stroom-core-client/src/main/java/stroom/view/client/ViewPlugin.java b/stroom-core-client/src/main/java/stroom/view/client/ViewPlugin.java index 91380248b2c..9b63ca1d2da 100644 --- a/stroom-core-client/src/main/java/stroom/view/client/ViewPlugin.java +++ b/stroom-core-client/src/main/java/stroom/view/client/ViewPlugin.java @@ -26,7 +26,7 @@ import stroom.document.client.DocumentPluginEventManager; import stroom.entity.client.presenter.DocumentEditPresenter; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.view.client.presenter.ViewPresenter; import stroom.view.shared.ViewDoc; import stroom.view.shared.ViewResource; @@ -68,13 +68,13 @@ public ViewPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(VIEW_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final ViewDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(VIEW_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/visualisation/client/VisualisationPlugin.java b/stroom-core-client/src/main/java/stroom/visualisation/client/VisualisationPlugin.java index c44d91cb392..6d01bb695f9 100644 --- a/stroom-core-client/src/main/java/stroom/visualisation/client/VisualisationPlugin.java +++ b/stroom-core-client/src/main/java/stroom/visualisation/client/VisualisationPlugin.java @@ -26,7 +26,7 @@ import stroom.document.client.DocumentPluginEventManager; import stroom.entity.client.presenter.DocumentEditPresenter; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.visualisation.client.presenter.VisualisationPresenter; import stroom.visualisation.shared.VisualisationDoc; import stroom.visualisation.shared.VisualisationResource; @@ -68,13 +68,13 @@ public VisualisationPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(VISUALISATION_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final VisualisationDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(VISUALISATION_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-core-client/src/main/java/stroom/welcome/client/presenter/WelcomePresenter.java b/stroom-core-client/src/main/java/stroom/welcome/client/presenter/WelcomePresenter.java index 51aeea09722..377d41cbb2c 100644 --- a/stroom-core-client/src/main/java/stroom/welcome/client/presenter/WelcomePresenter.java +++ b/stroom-core-client/src/main/java/stroom/welcome/client/presenter/WelcomePresenter.java @@ -64,7 +64,7 @@ public WelcomePresenter(final EventBus eventBus, }) .onFailure(caught -> AlertEvent.fireError(WelcomePresenter.this, caught.getMessage(), null)) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); uiConfigCache.get(result -> { diff --git a/stroom-core-client/src/main/java/stroom/xmlschema/client/XMLSchemaPlugin.java b/stroom-core-client/src/main/java/stroom/xmlschema/client/XMLSchemaPlugin.java index ed2bc0178cd..e8e21dad19d 100644 --- a/stroom-core-client/src/main/java/stroom/xmlschema/client/XMLSchemaPlugin.java +++ b/stroom-core-client/src/main/java/stroom/xmlschema/client/XMLSchemaPlugin.java @@ -26,7 +26,7 @@ import stroom.document.client.DocumentPluginEventManager; import stroom.entity.client.presenter.DocumentEditPresenter; import stroom.security.client.api.ClientSecurityContext; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import stroom.xmlschema.client.presenter.XMLSchemaPresenter; import stroom.xmlschema.shared.XmlSchemaDoc; import stroom.xmlschema.shared.XmlSchemaResource; @@ -68,13 +68,13 @@ public XMLSchemaPlugin(final EventBus eventBus, public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(XML_SCHEMA_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -83,13 +83,13 @@ public void save(final DocRef docRef, final XmlSchemaDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(XML_SCHEMA_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } diff --git a/stroom-dashboard-gwt/src/main/java/stroom/dashboard/client/DashboardApp.java b/stroom-dashboard-gwt/src/main/java/stroom/dashboard/client/DashboardApp.java index 7596e00cd85..812521cbb48 100644 --- a/stroom-dashboard-gwt/src/main/java/stroom/dashboard/client/DashboardApp.java +++ b/stroom-dashboard-gwt/src/main/java/stroom/dashboard/client/DashboardApp.java @@ -17,7 +17,7 @@ package stroom.dashboard.client; import stroom.dashboard.client.gin.DashboardAppGinjectorUser; -import stroom.dispatch.client.QuietTaskListener; +import stroom.dispatch.client.QuietTaskMonitorFactory; import stroom.preferences.client.UserPreferencesManager; import com.google.gwt.core.client.EntryPoint; @@ -52,6 +52,6 @@ public void onModuleLoad() { // Remember how places were used in case we want to use URLs and history // at some point. // ginjector.getPlaceManager().revealCurrentPlace(); - }, new QuietTaskListener()); + }, new QuietTaskMonitorFactory()); } } diff --git a/stroom-dashboard-gwt/src/main/java/stroom/dashboard/client/gin/DashboardAppModule.java b/stroom-dashboard-gwt/src/main/java/stroom/dashboard/client/gin/DashboardAppModule.java index 867fb280a68..50a52d932eb 100644 --- a/stroom-dashboard-gwt/src/main/java/stroom/dashboard/client/gin/DashboardAppModule.java +++ b/stroom-dashboard-gwt/src/main/java/stroom/dashboard/client/gin/DashboardAppModule.java @@ -80,6 +80,7 @@ import stroom.iframe.client.presenter.IFramePresenter.IFrameView; import stroom.iframe.client.view.IFrameContentViewImpl; import stroom.iframe.client.view.IFrameViewImpl; +import stroom.main.client.presenter.GlobalKeyHandlerImpl; import stroom.widget.dropdowntree.client.view.DropDownView; import stroom.widget.dropdowntree.client.view.DropDownViewImpl; import stroom.widget.dropdowntree.client.view.ExplorerPopupView; @@ -87,6 +88,7 @@ import stroom.widget.progress.client.presenter.ProgressPresenter; import stroom.widget.progress.client.presenter.ProgressPresenter.ProgressView; import stroom.widget.progress.client.view.ProgressViewImpl; +import stroom.widget.util.client.GlobalKeyHandler; import com.google.inject.Singleton; import com.google.web.bindery.event.shared.EventBus; @@ -106,6 +108,7 @@ protected void configure() { bind(TokenFormatter.class).to(ParameterTokenFormatter.class).in(Singleton.class); bind(RootPresenter.class).asEagerSingleton(); bind(PlaceManager.class).to(InactivePlaceManager.class).in(Singleton.class); + bind(GlobalKeyHandler.class).to(GlobalKeyHandlerImpl.class).in(Singleton.class); bind(UrlParameters.class).in(Singleton.class); bind(DelegatingAceCompleter.class).asEagerSingleton(); bind(DataDisplaySupport.class).asEagerSingleton(); diff --git a/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/hbase/client/StroomStatsStorePlugin.java b/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/hbase/client/StroomStatsStorePlugin.java index 894c18b44c0..cf9b0578d0b 100644 --- a/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/hbase/client/StroomStatsStorePlugin.java +++ b/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/hbase/client/StroomStatsStorePlugin.java @@ -36,7 +36,7 @@ import stroom.statistics.impl.hbase.shared.StatisticType; import stroom.statistics.impl.hbase.shared.StatsStoreResource; import stroom.statistics.impl.hbase.shared.StroomStatsStoreDoc; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.safehtml.shared.SafeHtmlUtils; @@ -107,7 +107,7 @@ public void save(final DocumentTabData tabData) { private void doConfirmSave(final DocumentEditPresenter presenter, final StroomStatsStoreDoc entity, final StroomStatsStoreDoc entityFromDb, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { // get the persisted versions of the fields we care about final StatisticType prevType = entityFromDb.getStatisticType(); final StatisticRollUpType prevRollUpType = entityFromDb.getRollUpType(); @@ -135,7 +135,7 @@ private void doConfirmSave(final DocumentEditPresenter p "the change.

" + "Do you wish to continue?"), result -> { if (result) { - doSave(presenter, entity, taskHandlerFactory); + doSave(presenter, entity, taskMonitorFactory); } else { // Re-enable popup buttons. } @@ -143,32 +143,32 @@ private void doConfirmSave(final DocumentEditPresenter p } else { // user has changed some attributes we don't care about so just do // the save - doSave(presenter, entity, taskHandlerFactory); + doSave(presenter, entity, taskMonitorFactory); } } private void doSave(final DocumentEditPresenter presenter, final StroomStatsStoreDoc entity, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { save(DocRefUtil.create(entity), entity, doc -> presenter.read(DocRefUtil.create(doc), doc, presenter.isReadOnly()), throwable -> { }, - taskHandlerFactory); + taskMonitorFactory); } @Override public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(STATS_STORE_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -177,13 +177,13 @@ public void save(final DocRef docRef, final StroomStatsStoreDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(STATS_STORE_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/hbase/client/presenter/StroomStatsStoreCustomMaskListPresenter.java b/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/hbase/client/presenter/StroomStatsStoreCustomMaskListPresenter.java index 1b77d9049b0..6c9258dd5d0 100644 --- a/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/hbase/client/presenter/StroomStatsStoreCustomMaskListPresenter.java +++ b/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/hbase/client/presenter/StroomStatsStoreCustomMaskListPresenter.java @@ -203,7 +203,7 @@ private void onAutoGenerate(final ClickEvent event) { updateState(new HashSet<>(res.getValues())); DirtyEvent.fire(thisInstance, true); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } }); @@ -297,7 +297,7 @@ public void reComputeRollUpBitMask(final StroomStatsStoreEntityData oldEntityDat updateState(result.getCustomRollUpMasks()); }) - .taskHandlerFactory(this) + .taskMonitorFactory(this) .exec(); } diff --git a/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/sql/client/StatisticsPlugin.java b/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/sql/client/StatisticsPlugin.java index f2664936950..7482ce06b1a 100644 --- a/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/sql/client/StatisticsPlugin.java +++ b/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/sql/client/StatisticsPlugin.java @@ -35,7 +35,7 @@ import stroom.statistics.impl.sql.shared.StatisticRollUpType; import stroom.statistics.impl.sql.shared.StatisticStoreDoc; import stroom.statistics.impl.sql.shared.StatisticType; -import stroom.task.client.TaskHandlerFactory; +import stroom.task.client.TaskMonitorFactory; import com.google.gwt.core.client.GWT; import com.google.gwt.safehtml.shared.SafeHtmlUtils; @@ -107,7 +107,7 @@ public void save(final DocumentTabData tabData) { private void doConfirmSave(final DocumentEditPresenter presenter, final StatisticStoreDoc entity, final StatisticStoreDoc entityFromDb, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { // get the persisted versions of the fields we care about final StatisticType prevType = entityFromDb.getStatisticType(); final StatisticRollUpType prevRollUpType = entityFromDb.getRollUpType(); @@ -134,7 +134,7 @@ private void doConfirmSave(final DocumentEditPresenter pre "change.

" + "Do you wish to continue?"), result -> { if (result) { - doSave(presenter, writtenEntity, taskHandlerFactory); + doSave(presenter, writtenEntity, taskMonitorFactory); } else { // Re-enable popup buttons. } @@ -142,32 +142,32 @@ private void doConfirmSave(final DocumentEditPresenter pre } else { // user has changed some attributes we don't care about so just do // the save - doSave(presenter, writtenEntity, taskHandlerFactory); + doSave(presenter, writtenEntity, taskMonitorFactory); } } private void doSave(final DocumentEditPresenter presenter, final StatisticStoreDoc entity, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { save(DocRefUtil.create(entity), entity, doc -> presenter.read(DocRefUtil.create(doc), doc, presenter.isReadOnly()), throwable -> { }, - taskHandlerFactory); + taskMonitorFactory); } @Override public void load(final DocRef docRef, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(STATISTIC_RESOURCE) .method(res -> res.fetch(docRef.getUuid())) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } @@ -176,13 +176,13 @@ public void save(final DocRef docRef, final StatisticStoreDoc document, final Consumer resultConsumer, final RestErrorHandler errorHandler, - final TaskHandlerFactory taskHandlerFactory) { + final TaskMonitorFactory taskMonitorFactory) { restFactory .create(STATISTIC_RESOURCE) .method(res -> res.update(document.getUuid(), document)) .onSuccess(resultConsumer) .onFailure(errorHandler) - .taskHandlerFactory(taskHandlerFactory) + .taskMonitorFactory(taskMonitorFactory) .exec(); } } diff --git a/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/sql/client/presenter/StatisticsCustomMaskListPresenter.java b/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/sql/client/presenter/StatisticsCustomMaskListPresenter.java index 4a1a6081e86..dd9662260d8 100644 --- a/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/sql/client/presenter/StatisticsCustomMaskListPresenter.java +++ b/stroom-statistics/stroom-statistics-client/src/main/java/stroom/statistics/impl/sql/client/presenter/StatisticsCustomMaskListPresenter.java @@ -196,7 +196,7 @@ private void onAutoGenerate(final ClickEvent event) { updateState(new HashSet<>(res)); DirtyEvent.fire(thisInstance, true); }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } }); @@ -291,7 +291,7 @@ public void reComputeRollUpBitMask(final StatisticsDataSourceData oldStatisticsD updateState(result.getCustomRollUpMasks()); }) - .taskHandlerFactory(getView()) + .taskMonitorFactory(getView()) .exec(); } diff --git a/unreleased_changes/20240916_123001_393__4448.md b/unreleased_changes/20240916_123001_393__4448.md new file mode 100644 index 00000000000..1e96ce3cde4 --- /dev/null +++ b/unreleased_changes/20240916_123001_393__4448.md @@ -0,0 +1,24 @@ +* Issue **#4448** : Fix query refresh tooltip when not refreshing. + + +```sh +# ******************************************************************************** +# Issue title: Incorrect tooltip when query is not running +# Issue link: https://github.com/gchq/stroom/issues/4448 +# ******************************************************************************** + +# ONLY the top line will be included as a change entry in the CHANGELOG. +# The entry should be in GitHub flavour markdown and should be written on a SINGLE +# line with no hard breaks. You can have multiple change files for a single GitHub issue. +# The entry should be written in the imperative mood, i.e. 'Fix nasty bug' rather than +# 'Fixed nasty bug'. +# +# Examples of acceptable entries are: +# +# +# * Issue **123** : Fix bug with an associated GitHub issue in this repository +# +# * Issue **namespace/other-repo#456** : Fix bug with an associated GitHub issue in another repository +# +# * Fix bug with no associated GitHub issue. +``` diff --git a/unreleased_changes/20240916_151652_868__4457.md b/unreleased_changes/20240916_151652_868__4457.md new file mode 100644 index 00000000000..64d598b35e3 --- /dev/null +++ b/unreleased_changes/20240916_151652_868__4457.md @@ -0,0 +1,24 @@ +* Issue **#4457** : Fix ctrl+enter shortcut for query start. + + +```sh +# ******************************************************************************** +# Issue title: ctrl+enter not starting searches +# Issue link: https://github.com/gchq/stroom/issues/4457 +# ******************************************************************************** + +# ONLY the top line will be included as a change entry in the CHANGELOG. +# The entry should be in GitHub flavour markdown and should be written on a SINGLE +# line with no hard breaks. You can have multiple change files for a single GitHub issue. +# The entry should be written in the imperative mood, i.e. 'Fix nasty bug' rather than +# 'Fixed nasty bug'. +# +# Examples of acceptable entries are: +# +# +# * Issue **123** : Fix bug with an associated GitHub issue in this repository +# +# * Issue **namespace/other-repo#456** : Fix bug with an associated GitHub issue in another repository +# +# * Fix bug with no associated GitHub issue. +```