public abstract class IOProvider extends Object
IOProvider.getDefault().getIO("MyTab", false)
(pass true if
there may be an existing tab with the same name and you want to write to a
new tab).
Methods of this class can be called in any thread.
Modifier and Type | Method and Description |
---|---|
static IOProvider |
get(String id)
Gets IOProvider of selected name or delegates to getDefault() if none was
found.
|
static IOProvider |
getDefault()
Get the default I/O provider.
|
abstract String |
getId()
Gets identifier of this provider.
|
abstract InputOutput |
getIO(String name,
boolean newIO)
Get a named instance of InputOutput, which represents an output tab in
the output window.
|
abstract InputOutput |
getIO(String name,
boolean newIO,
Lookup lookup)
Get a named instance of InputOutput, which represents an output tab in
the output window.
|
@NonNull public static IOProvider getDefault()
Normally this is taken from Lookup.getDefault()
but if there is no
instance in lookup, a fallback instance is created which just uses the
standard system I/O streams. This is useful for unit tests and perhaps
for standalone usage of various libraries.
@NonNull public static IOProvider get(@NonNull String id)
id
- ID of provider.@NonNull public abstract String getId()
@NonNull public abstract InputOutput getIO(@NonNull String name, boolean newIO)
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.InputOutput
@NonNull public abstract InputOutput getIO(@NonNull String name, boolean newIO, @NonNull Lookup lookup)
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.InputOutput