Package org.eclipse.ui.console

# Interface IConsoleManager

public interface IConsoleManager
The console manager manages registered consoles.

Since:
  3.0
Restriction:
  This interface is not intended to be implemented by clients.
Restriction:
  This interface is not intended to be extended by clients.

## Method Summary

Modifier and Type
Method
Description
`void`
`addConsoleListener(IConsoleListener listener)`
Registers the given listener for console notifications.
`void`
`addConsoles(IConsole[] consoles)`
Adds the given consoles to the console manager.
`default void`
`consoleHidden(IConsole console)`
Notifies that given console that was on top of at least one view has been hidden in the UI (either the console is not the top page in the view or the view with given console on top has been hidden).
`default void`
`consoleShown(IConsole console)`
Notifies that given console has been shown in the UI (either the view with given console on top has been shown or the console has been switched to the top console in at least one view).
`IPatternMatchListener[]`
`createPatternMatchListeners(IConsole console)`
Creates and returns a collection of new pattern match listeners enabled for the given console.
`IConsole[]`
`getConsoles()`
Returns a collection of consoles registered with the console manager.
`void`
`refresh(IConsole console)`
Requests a redraw of any visible console page containing the specified console.
`void`
`removeConsoleListener(IConsoleListener listener)`
Unregisters the given listener for console notifications.
`void`
`removeConsoles(IConsole[] consoles)`
Removes the given consoles from the console manager.
`void`
`showConsoleView(IConsole console)`
Opens the console view and displays given the console.
`void`
`warnOfContentChange(IConsole console)`
Warns that the content of the given console has changed in all console views.

## Method Details

### addConsoleListener

void addConsoleListener(IConsoleListener listener)
Registers the given listener for console notifications. Has no effect if an identical listener is already registered.

Parameters:
  `listener` - listener to register

### removeConsoleListener

void removeConsoleListener(IConsoleListener listener)
Unregisters the given listener for console notifications. Has no effect if an identical listener is not already registered.

Parameters:
  `listener` - listener to unregister

### addConsoles

void addConsoles(IConsole[] consoles)
Adds the given consoles to the console manager. Has no effect for equivalent consoles already registered. The consoles will be added to any existing console views.

Parameters:
  `consoles` - consoles to add

### removeConsoles

void removeConsoles(IConsole[] consoles)
Removes the given consoles from the console manager. If the consoles are being displayed in any console views, the associated pages will be removed and disposed.

Parameters:
  `consoles` - consoles to remove

### getConsoles

IConsole[] getConsoles()
Returns a collection of consoles registered with the console manager.

Returns:
  a collection of consoles registered with the console manager

### showConsoleView

void showConsoleView(IConsole console)
Opens the console view and displays given the console. If the view is already open, it is brought to the front unless the view is pinned on a console other than the given console. Has no effect if the given console is not currently registered.

Parameters:
  `console` - console to display

### warnOfContentChange

void warnOfContentChange(IConsole console)
Warns that the content of the given console has changed in all console views. Has no effect if the given console is not currently registered.

Parameters:
  `console` - the console that has changed

### createPatternMatchListeners

IPatternMatchListener[] createPatternMatchListeners(IConsole console)
Creates and returns a collection of new pattern match listeners enabled for the given console. The pattern match listeners are new instances, intended to be used in a new console. No methods on the participants have been called. Clients are responsible for connecting to and disconnecting from the pattern match listeners.

Console pattern match listeners are contributed via the `org.eclipse.ui.console.consolePatternMatchListeners` extension point.

Parameters:
  `console` - the console for which pattern match listeners are requested
Returns:
  a collection of new pattern match listeners
Since:
  3.1
See Also:
  - `IPatternMatchListener`

### refresh

void refresh(IConsole console)
Requests a redraw of any visible console page containing the specified console.

Parameters:
  `console` - the console to be refreshed
Since:
  3.1

### consoleShown

default void consoleShown(IConsole console)
Notifies that given console has been shown in the UI (either the view with given console on top has been shown or the console has been switched to the top console in at least one view).

Note, there could be multiple views showing the same console, so the page with given console can be still hidden in some views.

Parameters:
  `console` - the top console from view that has been shown
Since:
  3.17

### consoleHidden

default void consoleHidden(IConsole console)
Notifies that given console that was on top of at least one view has been hidden in the UI (either the console is not the top page in the view or the view with given console on top has been hidden).

Note, there could be multiple views showing the same console, so the page with given console can be still shown in some views.

Parameters:
  `console` - the console that has been hidden
Since:
  3.17