org.openide.io 1.16.1

org.openide.windows
Class IOProvider

java.lang.Object
  extended by org.openide.windows.IOProvider

public abstract class IOProvider
extends Object

A factory for IO tabs shown in the output window. To create a new tab to write to, call e.g. 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).

Since:
3.14

Constructor Summary
protected IOProvider()
          Subclass constructor.
 
Method Summary
static IOProvider get(String name)
          Gets IOProvider of selected name or delegates to getDefault() if none was found.
static IOProvider getDefault()
          Get the default I/O provider.
 InputOutput getIO(String name, Action[] actions)
          Gets a named instance of InputOutput with actions displayed in the toolbar.
 InputOutput getIO(String name, Action[] actions, IOContainer ioContainer)
          Gets a named instance of InputOutput.
abstract  InputOutput getIO(String name, boolean newIO)
          Get a named instance of InputOutput, which represents an output tab in the output window.
 String getName()
          Gets name (ID) of provider
abstract  OutputWriter getStdOut()
          Support writing to the Output Window on the main tab or a similar output device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOProvider

protected IOProvider()
Subclass constructor.

Method Detail

getDefault

public static IOProvider getDefault()
Get the default I/O provider.

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.

Returns:
the default instance (never null)

get

public static IOProvider get(String name)
Gets IOProvider of selected name or delegates to getDefault() if none was found.

Parameters:
name - ID of provider
Returns:
the instance corresponding to provided name or default instance if not found
Since:
1.15

getIO

public abstract InputOutput getIO(String name,
                                  boolean newIO)
Get a named instance of InputOutput, which represents an output tab in the output window. Streams for reading/writing can be accessed via getters on the returned instance.

Parameters:
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
Returns:
an InputOutput instance for accessing the new tab
See Also:
InputOutput

getIO

public InputOutput getIO(String name,
                         Action[] actions)
Gets a named instance of InputOutput with actions displayed in the toolbar. Streams for reading/writing can be accessed via getters on the returned instance.

Parameters:
name - A localized display name for the tab
actions - array of actions that are added to the toolbar, Can be empty array, but not null. The number of actions should not exceed 5 and each should have the Action.SMALL_ICON property defined.
Returns:
an InputOutput instance for accessing the new tab
Since:
1.6
Note: The method is non-abstract for backward compatibility reasons only. If you are extending IOProvider and implementing its abstract classes, you are encouraged to override this method as well. The default implementation falls back to the getIO(name, newIO) method, ignoring the actions passed.
See Also:
InputOutput

getIO

public InputOutput getIO(String name,
                         Action[] actions,
                         IOContainer ioContainer)
Gets a named instance of InputOutput. Corresponding IO tab will be placed in parent container corresponding to provided IOContainer.

Parameters:
name - A localized display name for the tab
actions - array of actions that are added to the toolbar, Can be empty array, but not null. The number of actions should not exceed 5 and each should have the Action.SMALL_ICON property defined.
ioContainer - parent container accessor
Returns:
an InputOutput instance for accessing the new tab
Since:
1.15
Note: The method is non-abstract for backward compatibility reasons only. If you are extending IOProvider and implementing its abstract classes, you are encouraged to override this method as well. The default implementation falls back to the getIO(name, actions) method, ignoring the ioContainer passed.
See Also:
InputOutput

getName

public String getName()
Gets name (ID) of provider

Returns:
name of provider
Since:
1.15
Note: The method is non-abstract for backward compatibility reasons only. If you are extending IOProvider you should override this method. The default implementation returns ""

getStdOut

public abstract OutputWriter getStdOut()
Support writing to the Output Window on the main tab or a similar output device.

Returns:
a writer for the standard NetBeans output area

org.openide.io 1.16.1

Built on September 27 2009.  |  Portions Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.