public class FormattingProgressTask extends SequentialModalProgressTask implements FormattingProgressCallback
Task.Backgroundable, Task.ConditionalModal, Task.Modal, Task.NotificationInfo, Task.WithResult<T,E extends java.lang.Exception>FormattingProgressCallback.EventType| Modifier and Type | Field and Description |
|---|---|
static java.lang.ThreadLocal<java.lang.Boolean> |
FORMATTING_CANCELLED_FLAG |
EMPTY| Constructor and Description |
|---|
FormattingProgressTask(Project project,
PsiFile file,
Document document) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCallback(FormattingProgressCallback.EventType eventType,
java.lang.Runnable callback)
Allows to register callback for the target event type.
|
void |
afterApplyingChange(LeafBlockWrapper block)
Notifies current indicator that change from the given
wrapped code block is successfully flushed
to the underlying document. |
void |
afterProcessingBlock(LeafBlockWrapper block)
Notifies current indicator that given
wrapped code block is processed, i.e. |
void |
afterWrappingBlock(LeafBlockWrapper wrapped)
Notifies current indicator that particular
code block is wrapped. |
void |
beforeApplyingFormatChanges(java.util.Collection<LeafBlockWrapper> modifiedBlocks)
Notifies current indicator that changes from the given
wrapped code blocks are about to be flushed
to the underlying document. |
void |
onCancel()
This callback will be invoked on AWT dispatch thread.
|
void |
onSuccess()
This callback will be invoked on AWT dispatch thread.
|
void |
onThrowable(java.lang.Throwable error)
This callback will be invoked on AWT dispatch thread.
|
protected void |
prepare(SequentialTask task)
Executes preliminary jobs prior to the target sequential task processing (
SequentialTask.prepare() by default). |
doRun, getIndicator, run, setMinIterationTime, setTaskisModalasBackgroundable, asModal, getCancelText, getCancelTooltipText, getNotificationInfo, getProject, getTitle, isCancellable, isHeadless, notifyFinished, onError, onFinished, queue, setCancelText, setCancelTooltipText, setTitle, whereToRunCallbacksclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetTaskpublic static final java.lang.ThreadLocal<java.lang.Boolean> FORMATTING_CANCELLED_FLAG
protected void prepare(SequentialTask task)
SequentialModalProgressTaskSequentialTask.prepare() by default).prepare in class SequentialModalProgressTasktask - task to be executedpublic boolean addCallback(FormattingProgressCallback.EventType eventType, java.lang.Runnable callback)
FormattingProgressCallbackaddCallback in interface FormattingProgressCallbackeventType - target event typecallback - callback to register for the given event typetrue if given callback is successfully registered for the given event type;
false otherwisepublic void onSuccess()
Taskpublic void onCancel()
TaskProcessCanceledException or if its ProgressIndicator was canceled.public void onThrowable(java.lang.Throwable error)
Task
Callback executed when Progressive.run(ProgressIndicator) throws an exception (except ProcessCanceledException).
onThrowable in class Taskpublic void afterWrappingBlock(LeafBlockWrapper wrapped)
FormattingProgressCallbackcode block is wrapped.afterWrappingBlock in interface FormattingProgressCallbackwrapped - wrapped code blockFormattingStateId.WRAPPING_BLOCKSpublic void afterProcessingBlock(LeafBlockWrapper block)
FormattingProgressCallbackwrapped code block is processed, i.e. its
white space is adjusted as necessary.afterProcessingBlock in interface FormattingProgressCallbackblock - processed wrapped block which white space if adjustedFormattingStateId.PROCESSING_BLOCKSpublic void beforeApplyingFormatChanges(java.util.Collection<LeafBlockWrapper> modifiedBlocks)
FormattingProgressCallbackwrapped code blocks are about to be flushed
to the underlying document.beforeApplyingFormatChanges in interface FormattingProgressCallbackmodifiedBlocks - blocks with modified white spaces which are about
to be flushed to the underlying documentFormattingStateId.APPLYING_CHANGESpublic void afterApplyingChange(LeafBlockWrapper block)
FormattingProgressCallbackwrapped code block is successfully flushed
to the underlying document.afterApplyingChange in interface FormattingProgressCallbackblock - wrapped code block which change is successfully flushed to the underlying documentFormattingStateId.APPLYING_CHANGES