public abstract class InputOutput extends Object implements Lookup.Provider
IOProvider.getDefault().getInputOutput("someName", false)
. To
get actual streams to write to, call getOut()
or
getErr()
on the returned instance.
Generally it is preferable not to hold a reference to an instance of
InputOutput
, but rather to fetch it by name from
IOProvider
as needed.
Methods of this class can be called in any thread.
OutputWriter
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Closes this tab.
|
static InputOutput |
get(String name,
boolean newIO)
Get a named instance of InputOutput from the default
IOProvider ,
which represents an output tab in the output window. |
static InputOutput |
get(String name,
boolean newIO,
Lookup lookup)
Get a named instance of InputOutput from the default
IOProvider ,
which represents an output tab in the output window. |
abstract String |
getDescription()
Get description of this I/O instance.
|
abstract OutputWriter |
getErr()
Get an output writer to write to the tab in error mode.
|
abstract Reader |
getIn()
Get a reader to read from the tab.
|
abstract Lookup |
getLookup()
Get lookup which may contain extensions provided by implementation of
output window.
|
abstract OutputWriter |
getOut()
Acquire an output writer to write to the tab.
|
abstract boolean |
isClosed()
Test whether this tab has been closed, either by a call to
InputOutput.close() or by the user closing the tab in the UI. |
abstract void |
reset()
Clear the output pane.
|
abstract void |
setDescription(String description)
Set description of this I/O instance.
|
void |
show()
Show this I/O if possible (e.g.
|
abstract void |
show(Set<ShowOperation> operations)
Show this I/O if possible (e.g.
|
@NonNull public static InputOutput get(@NonNull String name, boolean newIO)
IOProvider
,
which represents an output tab in the output window. Streams for
reading/writing can be accessed via getters on the returned instance.
This is a shorthand for IOProvider.getDefault().getIO(...)
.
name
- A localised display name for the tab.newIO
- If true, a new InputOutput
is
returned, else an existing InputOutput
of the same name may
be returned.InputOutput
instance for accessing the new tab.IOProvider
@NonNull public static InputOutput get(@NonNull String name, boolean newIO, @NonNull Lookup lookup)
IOProvider
,
which represents an output tab in the output window. Streams for
reading/writing can be accessed via getters on the returned instance.
This is a shorthand for IOProvider.getDefault().getIO(...)
.
name
- A localised display name for the tab.newIO
- If true, a new InputOutput
is
returned, else an existing InputOutput
of the same name may
be returned.lookup
- Lookup which may contain additional information for various
implementations of output window.InputOutput
instance for accessing the new tab.IOProvider
@NonNull public abstract Reader getIn()
@NonNull public abstract OutputWriter getOut()
@NonNull public abstract OutputWriter getErr()
public abstract void reset()
@NonNull public abstract Lookup getLookup()
getLookup
in interface Lookup.Provider
public abstract void close()
close()
on it is
undefined.public abstract boolean isClosed()
InputOutput.close()
or by the user closing the tab in the UI.true
if it is closed.@CheckForNull public abstract String getDescription()
public abstract void setDescription(@NullAllowed String description)
description
- The description, can be null.public final void show()
Calling this method is the same as calling:
show(EnumSet.of(ShowOperation.OPEN, ShowOperation.MAKE_VISIBLE));
InputOutput.show(java.util.Set)
public abstract void show(@NullAllowed Set<ShowOperation> operations)
operations
- Set of operations that should be invoked to show the
output. If the set is empty or null, pane for this I/O will be only
selected, but its component will not be opened or made visible. So it
will stay closed or hidden if it is not opened or not visible.ShowOperation