anmolbabu has uploaded a new change for review. Change subject: webadmin: add showErrorDialog property to runMultipleAction ......................................................................
webadmin: add showErrorDialog property to runMultipleAction The property will alow to controll whether to show a pop-up dialog with the error or not. Change-Id: I703c95dd2c8bfc2ff3cc997019dcd15fd671d234 Signed-off-by: Alona Kaplan <alkap...@redhat.com> --- M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java 1 file changed, 49 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/86/42186/1 diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java index 1edfbb2..077d82c 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java @@ -436,6 +436,20 @@ */ public void runAction(final VdcActionType actionType, final VdcActionParametersBase parameters) { runAction(actionType, parameters, Frontend.NULLABLE_ASYNC_CALLBACK); + } + + /** + * Run an action of the specified action type using the passed in parameters. No object state. + * @param actionType The action type of the action to perform. + * @param parameters The parameters of the action. + * @param callback The callback to call when the action is completed. + * @param showErrorDialog Whether to show a pop-up dialog with the error or not. + */ + public void runAction(final VdcActionType actionType, + final VdcActionParametersBase parameters, + final IFrontendActionAsyncCallback callback, + final boolean showErrorDialog) { + runAction(actionType, parameters, callback, null, showErrorDialog); } /** @@ -492,7 +506,7 @@ final ArrayList<VdcActionParametersBase> parameters, final IFrontendMultipleActionAsyncCallback callback, final Object state) { - runMultipleAction(actionType, parameters, false, callback, state); + runMultipleAction(actionType, parameters, false, callback, state, true); } /** @@ -517,7 +531,21 @@ } /** - * Run multiple actions using the same {@code VdcActionType}. + * RunMultipleActions without passing state. + * @param actionType The type of action to perform. + * @param parameters The parameters of the action. + * @param callback The callback to call after the operation happens. + * @param showErrorDialog Should we show an error dialog? + */ + public void runMultipleAction(final VdcActionType actionType, + final List<VdcActionParametersBase> parameters, + final IFrontendMultipleActionAsyncCallback callback, + final boolean showErrorDialog) { + runMultipleAction(actionType, parameters, false, callback, null, showErrorDialog); + } + + /** + * Run multiple without passing <code>showErrorDialog</code> * @param actionType The action type. * @param parameters The list of parameters. * @param isRunOnlyIfAllCanDoPass A flag to only run the actions if all can be completed. @@ -529,6 +557,24 @@ final boolean isRunOnlyIfAllCanDoPass, final IFrontendMultipleActionAsyncCallback callback, final Object state) { + runMultipleAction(actionType, parameters, isRunOnlyIfAllCanDoPass, callback, state, true); + } + + /** + * Run multiple actions using the same {@code VdcActionType}. + * @param actionType The action type. + * @param parameters The list of parameters. + * @param isRunOnlyIfAllCanDoPass A flag to only run the actions if all can be completed. + * @param callback The callback to call when the operation completes. + * @param state The state. + * @param showErrorDialog Should we show an error dialog? + */ + public void runMultipleAction(final VdcActionType actionType, + final List<VdcActionParametersBase> parameters, + final boolean isRunOnlyIfAllCanDoPass, + final IFrontendMultipleActionAsyncCallback callback, + final Object state, + final boolean showErrorDialog) { VdcOperationCallbackList<VdcOperation<VdcActionType, VdcActionParametersBase>, List<VdcReturnValueBase>> multiCallback = new VdcOperationCallbackList<VdcOperation<VdcActionType, VdcActionParametersBase>, List<VdcReturnValueBase>>() { @@ -545,7 +591,7 @@ } } - if (!failed.isEmpty()) { + if (showErrorDialog && !failed.isEmpty()) { translateErrors(failed); getEventsHandler().runMultipleActionFailed(actionType, failed); } -- To view, visit https://gerrit.ovirt.org/42186 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I703c95dd2c8bfc2ff3cc997019dcd15fd671d234 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5-gluster Gerrit-Owner: anmolbabu <anb...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches