Class AbstractWaitingWithInfiniteProgressDialog<T,E extends org.eclipse.core.runtime.CoreException>
java.lang.Object
com._1c.g5.v8.dt.common.ui.dialogs.AbstractWaitingWithInfiniteProgressDialog<T,E>
- Type Parameters:
T- Type of result that waiting action should return, can beVoid.E- Subtype of CoreException that should be returned if an error occures.
- All Implemented Interfaces:
IEvalCompletableFutureStrategy<T,E>
- Direct Known Subclasses:
WaitForDebugProcessesTerminationStrategy
public abstract class AbstractWaitingWithInfiniteProgressDialog<T,E extends org.eclipse.core.runtime.CoreException>
extends Object
implements IEvalCompletableFutureStrategy<T,E>
Abstract class that implemented
IEvalCompletableFutureStrategy and shows
modal dialog with infinite progress bar as top window while processing evalCompletableFutureGet(java.util.concurrent.CompletableFuture<T>, long, java.util.concurrent.TimeUnit).
This class may be used with any blocking action with unknown amount of work that user should wait.
The class itself doesn't do any work besides showing window and returning result of action completion
event as result of CompletableFuture.get().-
Field Summary
Fields inherited from interface com._1c.g5.v8.dt.common.IEvalCompletableFutureStrategy
INFINITE_TIMEOUT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractWaitingWithInfiniteProgressDialog(String dialogTitle, String dialogProgressBarTitle, String failureLogMessage, boolean cancelable) Constructs an instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract EcreateCoreException(org.eclipse.core.runtime.IStatus status) Create specific type instance of CoreException.evalCompletableFutureGet(CompletableFuture<T> completableFuture, long timeout, TimeUnit timeUnit) Evaluate one of the CompletableFuture::get methods with any additional actions that need to be performed before and after.
-
Constructor Details
-
AbstractWaitingWithInfiniteProgressDialog
protected AbstractWaitingWithInfiniteProgressDialog(String dialogTitle, String dialogProgressBarTitle, String failureLogMessage, boolean cancelable) Constructs an instance.- Parameters:
dialogTitle- Title of the dialog window, must not benull.dialogProgressBarTitle- Title of infinite progress bar, must not benull.failureLogMessage- Log message to instantiate IStatus when an error was occured, must not benull.cancelable- Does dialog has "Cancel" button.
-
-
Method Details
-
createCoreException
Create specific type instance of CoreException.- Parameters:
status- Status instance that will go to exception constructor, must not benull.- Returns:
- created exception.
-
evalCompletableFutureGet
public T evalCompletableFutureGet(CompletableFuture<T> completableFuture, long timeout, TimeUnit timeUnit) throws E, TimeoutException, org.eclipse.core.runtime.OperationCanceledException Description copied from interface:IEvalCompletableFutureStrategyEvaluate one of the CompletableFuture::get methods with any additional actions that need to be performed before and after. - Specified by:
evalCompletableFutureGetin interfaceIEvalCompletableFutureStrategy<T,E extends org.eclipse.core.runtime.CoreException> - Parameters:
completableFuture- Future which result is need, must not benull.timeout- Future result wait timeout. Must be greater or equal 0 orIEvalCompletableFutureStrategy.INFINITE_TIMEOUT.timeUnit- Units oftimeout, can benulliftimeoutis equalINFINITE_TIMEOUT.- Returns:
- result of Completable Future, can be
null. - Throws:
TimeoutException- if there was waiting timeout.org.eclipse.core.runtime.OperationCanceledException- if user cancels operation (where applicable).E extends org.eclipse.core.runtime.CoreException
-