public class ColoredProcessHandler extends KillableProcessHandler implements AnsiEscapeDecoder.ColoredTextAcceptor
This process handler supports ANSI coloring.
Although it supports the feature, it is turned off by default for compatibility reasons.
To turn it on either call KillableProcessHandler.setShouldKillProcessSoftly(boolean), or extend from KillableColoredProcessHandler.
OSProcessHandler.SilentBaseOSProcessHandler.SimpleOutputReadermyCharset, myCommandLine, myPresentableName, myProcess, myWaitForSILENTLY_DESTROY_ON_CLOSE, TERMINATION_REQUESTED| Constructor and Description |
|---|
ColoredProcessHandler(GeneralCommandLine commandLine) |
ColoredProcessHandler(java.lang.Process process,
java.lang.String commandLine)
commandLine must not be not empty (for correct thread attribution in the stacktrace) |
ColoredProcessHandler(java.lang.Process process,
java.lang.String commandLine,
java.nio.charset.Charset charset)
commandLine must not be not empty (for correct thread attribution in the stacktrace) |
ColoredProcessHandler(java.lang.Process process,
java.lang.String commandLine,
java.nio.charset.Charset charset,
java.util.Set<? extends java.io.File> filesToDelete)
commandLine must not be not empty (for correct thread attribution in the stacktrace) |
| Modifier and Type | Method and Description |
|---|---|
void |
addColoredTextListener(AnsiEscapeDecoder.ColoredTextAcceptor listener)
Deprecated.
use
ProcessHandler.addProcessListener(ProcessListener) instead and
listen for ProcessListener.onTextAvailable(ProcessEvent, Key) events |
void |
coloredTextAvailable(java.lang.String text,
Key attributes)
Override this method to handle colored text lines.
|
protected void |
notifyColoredListeners(java.lang.String text,
Key attributes)
Deprecated.
the method is kept for backward compatibility only
|
void |
notifyTextAvailable(java.lang.String text,
Key outputType) |
canKillProcess, destroyProcessGracefully, destroyProcessImpl, doDestroyProcess, killProcess, mediate, notifyProcessTerminated, setShouldKillProcessSoftly, setShouldKillProcessSoftlyWithWinP, shouldKillProcessSoftlycheckEdtAndReadAction, deleteFileOnTermination, getDefaultModality, killProcessTree, onOSProcessTerminated, processCanBeKilledByOS, processHasSeparateErrorStream, readerOptions, setHasPty, setShouldDestroyProcessRecursively, shouldDestroyProcessRecursively, waitFor, waitForcreateErrorDataReader, createOutputDataReader, createProcessErrReader, createProcessOutReader, executeOnPooledThread, executeTask, startNotify, toStringcloseStreams, detachIsDefault, detachProcessImpl, getCharset, getCommandLine, getProcess, getProcessInputaddProcessListener, addProcessListener, destroyProcess, detachProcess, getExitCode, isProcessTerminated, isProcessTerminating, isSilentlyDestroyOnClose, isStartNotified, notifyProcessDetached, removeProcessListenerchangeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMappublic ColoredProcessHandler(GeneralCommandLine commandLine) throws ExecutionException
ExecutionExceptionpublic ColoredProcessHandler(java.lang.Process process,
java.lang.String commandLine)
commandLine must not be not empty (for correct thread attribution in the stacktrace)public ColoredProcessHandler(java.lang.Process process,
java.lang.String commandLine,
java.nio.charset.Charset charset)
commandLine must not be not empty (for correct thread attribution in the stacktrace)public ColoredProcessHandler(java.lang.Process process,
java.lang.String commandLine,
java.nio.charset.Charset charset,
java.util.Set<? extends java.io.File> filesToDelete)
commandLine must not be not empty (for correct thread attribution in the stacktrace)public final void notifyTextAvailable(java.lang.String text,
Key outputType)
notifyTextAvailable in class ProcessHandlerpublic void coloredTextAvailable(java.lang.String text,
Key attributes)
coloredTextAvailable in interface AnsiEscapeDecoder.ColoredTextAcceptor@Deprecated
protected void notifyColoredListeners(java.lang.String text,
Key attributes)
@Deprecated public void addColoredTextListener(AnsiEscapeDecoder.ColoredTextAcceptor listener)
ProcessHandler.addProcessListener(ProcessListener) instead and
listen for ProcessListener.onTextAvailable(ProcessEvent, Key) events