Package org.pushingpixels.substance.internal.utils

# Class TabCloseListenerManager

java.lang.Object
org.pushingpixels.substance.internal.utils.TabCloseListenerManager

public class TabCloseListenerManager extends Object
Manages the listeners registered on tab-close events. This class is for internal use only.

## Constructor Summary

Constructors
Constructor
Description
`TabCloseListenerManager()`
Simple constructor.

## Method Summary

Modifier and Type
Method
Description
`static TabCloseListenerManager`
`getInstance()`
Returns the single instance of `this` class.
`Set<BaseTabCloseListener>`
`getListeners()`
Returns the set of all listeners registered on tab-close events on all tabbed panes.
`Set<BaseTabCloseListener>`
`getListeners(JTabbedPane tabbedPane)`
Returns the set of all listeners registered on tab-close events on the specified tabbed pane.
`void`
`registerListener(JTabbedPane tabbedPane, BaseTabCloseListener listener)`
Registers the specified listener on tab-close events on the specified tabbed pane.
`void`
`registerListener(BaseTabCloseListener listener)`
Registers the specified listener on tab-close events on all tabbed panes.
`void`
`unregisterListener(JTabbedPane tabbedPane, BaseTabCloseListener listener)`
Unregisters the specified listener on tab-close events on the specified tabbed pane.
`void`
`unregisterListener(BaseTabCloseListener listener)`
Unregisters the specified listener on tab-close events on all tabbed panes.
`void`
`unregisterTabbedPane(JTabbedPane tabbedPane)`
Unregisters the specified tabbed pane.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TabCloseListenerManager

public TabCloseListenerManager()
Simple constructor.

## Method Details

### getInstance

public static TabCloseListenerManager getInstance()
Returns the single instance of `this` class.

Returns:
  The single instance of `this` class.

### unregisterTabbedPane

public void unregisterTabbedPane(JTabbedPane tabbedPane)
Unregisters the specified tabbed pane.

Parameters:
  `tabbedPane` - Tabbed pane to unregister.

### registerListener

public void registerListener(BaseTabCloseListener listener)
Registers the specified listener on tab-close events on all tabbed panes.

Parameters:
  `listener` - Listener to register.

### unregisterListener

public void unregisterListener(BaseTabCloseListener listener)
Unregisters the specified listener on tab-close events on all tabbed panes.

Parameters:
  `listener` - Listener to unregister.

### getListeners

public Set<BaseTabCloseListener> getListeners()
Returns the set of all listeners registered on tab-close events on all tabbed panes.

Returns:
  Set of all listeners registered on tab-close events on all tabbed panes.

### registerListener

public void registerListener(JTabbedPane tabbedPane, BaseTabCloseListener listener)
Registers the specified listener on tab-close events on the specified tabbed pane.

Parameters:
  `tabbedPane` - Tabbed pane. If `null`, the tab close listener is registered globally (for all tabbed panes).
  `listener` - Listener to register.

### unregisterListener

public void unregisterListener(JTabbedPane tabbedPane, BaseTabCloseListener listener)
Unregisters the specified listener on tab-close events on the specified tabbed pane.

Parameters:
  `tabbedPane` - Tabbed pane. If `null`, the tab close listener is unregistered globally (for all tabbed panes).
  `listener` - Listener to unregister.

### getListeners

public Set<BaseTabCloseListener> getListeners(JTabbedPane tabbedPane)
Returns the set of all listeners registered on tab-close events on the specified tabbed pane.

Parameters:
  `tabbedPane` - Tabbed pane. If `null`, all globally registered tab close listeners are returned.
Returns:
  The set of all listeners registered on tab-close events on the specified tabbed pane.