站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.0.0

IOProvider (NetBeans Input/Output API) - NetBeans API Javadoc 5.0.0

 

org.openide.windows
Class IOProvider

java.lang.Object
  extended byorg.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 getDefault()
          Get the default I/O provider.
 InputOutput getIO(String name, Action[] additionalActions)
          Gets a named instance of InputOutput with additional actions displayed in the toolbar.
abstract  InputOutput getIO(String name, boolean newIO)
          Get a named instance of InputOutput, which represents an output tab in the output window.
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.

Assuming you want to ensure that a real output window implementation is actually installed and enabled, you must require the token org.openide.windows.IOProvider from the module calling this method.

Returns:
the default instance (never null)

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 localized 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[] additionalActions)
Gets a named instance of InputOutput with additional actions displayed in the toolbar. Streams for reading/writing can be accessed via getters on the returned instance. Additional actions are displayed on the output's toolbar.

Parameters:
name - A localized display name for the tab
additionalActions - 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

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

 

Built on May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.