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 be Void.
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().
See Also:
  • 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 be null.
      dialogProgressBarTitle - Title of infinite progress bar, must not be null.
      failureLogMessage - Log message to instantiate IStatus when an error was occured, must not be null.
      cancelable - Does dialog has "Cancel" button.
  • Method Details

    • createCoreException

      protected abstract E createCoreException(org.eclipse.core.runtime.IStatus status)
      Create specific type instance of CoreException.
      Parameters:
      status - Status instance that will go to exception constructor, must not be null.
      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: IEvalCompletableFutureStrategy
      Evaluate one of the CompletableFuture::get methods with any additional actions that need to be performed before and after.
      Specified by:
      evalCompletableFutureGet in interface IEvalCompletableFutureStrategy<T,E extends org.eclipse.core.runtime.CoreException>
      Parameters:
      completableFuture - Future which result is need, must not be null.
      timeout - Future result wait timeout. Must be greater or equal 0 or IEvalCompletableFutureStrategy.INFINITE_TIMEOUT.
      timeUnit - Units of timeout, can be null if timeout is equal INFINITE_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