com.intellij.openapi.components
Interface ComponentManager

All Superinterfaces:
UserDataHolder
All Known Subinterfaces:
Application, Module, Project

public interface ComponentManager
extends UserDataHolder

Provides access to components. Servers as a base interface for Application and Project.

See Also:
ApplicationComponent, ProjectComponent, Application, Project

Method Summary
<T> T
getComponent(java.lang.Class<T> interfaceClass)
          Gets the component by its interface class.
<T> T
getComponent(java.lang.Class<T> interfaceClass, T defaultImplementationIfAbsent)
          Gets the component by its interface class but returns a specified default implementation if the actualt component doesn't exist in the container.
 BaseComponent getComponent(java.lang.String name)
          Gets the component by its name
 java.lang.Class[] getComponentInterfaces()
          Gets interface classes for all available components.
<T> T[]
getComponents(java.lang.Class<T> baseInterfaceClass)
          Gets all components whose interface class is derived from baseInterfaceClass.
 org.picocontainer.PicoContainer getPicoContainer()
           
 boolean hasComponent(java.lang.Class interfaceClass)
          Checks whether there is a component with the specified interface class.
 
Methods inherited from interface com.intellij.openapi.util.UserDataHolder
getUserData, putUserData
 

Method Detail

getComponent

BaseComponent getComponent(java.lang.String name)
Gets the component by its name

Parameters:
name - the name of the component
Returns:
component that matches interface class or null if there is no such component

getComponent

<T> T getComponent(java.lang.Class<T> interfaceClass)
Gets the component by its interface class.

Parameters:
interfaceClass - the interface class of the component
Returns:
component that matches interface class or null if there is no such component

getComponent

<T> T getComponent(java.lang.Class<T> interfaceClass,
                   T defaultImplementationIfAbsent)
Gets the component by its interface class but returns a specified default implementation if the actualt component doesn't exist in the container.

Parameters:
interfaceClass - the interface class of the component
defaultImplementationIfAbsent - the default implementation
Returns:
component that matches interface class or default if there is no such component

getComponentInterfaces

java.lang.Class[] getComponentInterfaces()
Gets interface classes for all available components.

Returns:
array of interface classes

hasComponent

boolean hasComponent(java.lang.Class interfaceClass)
Checks whether there is a component with the specified interface class.

Parameters:
interfaceClass - interface class of component to be checked
Returns:
true if there is a component with the specified interface class; false otherwise

getComponents

<T> T[] getComponents(java.lang.Class<T> baseInterfaceClass)
Gets all components whose interface class is derived from baseInterfaceClass.

Parameters:
baseInterfaceClass - base class
Returns:
array of components

getPicoContainer

org.picocontainer.PicoContainer getPicoContainer()