org.openide.io 1.23.1

org.openide.windows
Class IOContainer

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

public final class IOContainer
extends Object

IOContainer is accessor class to parent container of IO tabs for IOProvider implementations. Default IOContainer (corresponding to Output window) can be obtained via getDefault().

If you want to add IO components (tabs) to your own component you need to:

New IO tab will be added to provided IOContainer.

Since:
1.15

Nested Class Summary
static interface IOContainer.CallBacks
          Callbacks from IOContainer to child component corresponding to IO
static interface IOContainer.Provider
          SPI for providers of parent container for IO components (tabs)
 
Method Summary
 void add(JComponent comp, IOContainer.CallBacks cb)
          Adds component to parent container
static IOContainer create(IOContainer.Provider provider)
          Factory method for IOContainer instances
static IOContainer getDefault()
          Gets the default container according to a generic IOContainer.Provider.
 JComponent getSelected()
          Gets currently selected component in parent container
 boolean isActivated()
          Checks if parent container is activated
 boolean isCloseable(JComponent comp)
          Checks whether comp can be closed (e.g.
 void open()
          Opens parent container
 void remove(JComponent comp)
          Removes component from parent container
 void requestActive()
          Activates parent container
 void requestVisible()
          Selects parent container (if it is opened), but does not activate it
 void select(JComponent comp)
          Selects component in parent container
 void setIcon(JComponent comp, Icon icon)
          Sets icon for provided component
 void setTitle(JComponent comp, String name)
          Sets title for provided component
 void setToolbarActions(JComponent comp, Action[] toolbarActions)
          Sets toolbar actions for provided component
 void setToolTipText(JComponent comp, String text)
          Sets tool tip text for provided component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static IOContainer create(IOContainer.Provider provider)
Factory method for IOContainer instances

Parameters:
provider - Provider implemantation
Returns:
IOContainer instance

getDefault

public static IOContainer getDefault()
Gets the default container according to a generic IOContainer.Provider.

Normally this is taken from Lookup.getDefault() but if there is no instance in lookup, a fallback instance is created which can be useful for unit tests and perhaps for standalone usage of various libraries.

Returns:
a generic container

open

public void open()
Opens parent container


requestActive

public void requestActive()
Activates parent container


requestVisible

public void requestVisible()
Selects parent container (if it is opened), but does not activate it


isActivated

public boolean isActivated()
Checks if parent container is activated

Returns:
true if parent container is activated

add

public void add(JComponent comp,
                IOContainer.CallBacks cb)
Adds component to parent container

Parameters:
comp - component to be added
cb - callbacks for added component or null if not interested in notifications
See Also:
IOContainer.CallBacks

remove

public void remove(JComponent comp)
Removes component from parent container

Parameters:
comp - component that should be removed

select

public void select(JComponent comp)
Selects component in parent container

Parameters:
comp - component that should be selected

getSelected

public JComponent getSelected()
Gets currently selected component in parent container

Returns:
selected tab

setTitle

public void setTitle(JComponent comp,
                     String name)
Sets title for provided component

Parameters:
comp - component for which title should be set
name - component title

setToolTipText

public void setToolTipText(JComponent comp,
                           String text)
Sets tool tip text for provided component

Parameters:
comp - component for which title should be set
text - component title

setIcon

public void setIcon(JComponent comp,
                    Icon icon)
Sets icon for provided component

Parameters:
comp - component for which icon should be set
icon - component icon

setToolbarActions

public void setToolbarActions(JComponent comp,
                              Action[] toolbarActions)
Sets toolbar actions for provided component

Parameters:
comp - component for which actions should be set
toolbarActions - toolbar actions for component

isCloseable

public boolean isCloseable(JComponent comp)
Checks whether comp can be closed (e.g. if Close action should be present in component popup menu)

Parameters:
comp - component which should be closeable
Returns:
true if component can be closed

org.openide.io 1.23.1

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