org.severe.jripples.modules.manager
Class ModuleProxy

java.lang.Object
  extended by org.severe.jripples.modules.manager.ModuleProxy

public class ModuleProxy
extends java.lang.Object

ModuleProxy class is used to manipulate modules, installed in Eclipse environment for JRipples tool.

Author:
Maksym Petrenko

Constructor Summary
ModuleProxy()
          The default constructor.
 
Method Summary
static void addJRipplesModuleSwitchingListener(ModuleSwitchListener listener)
          Registers a listener who wish to receive updates on module switching events.
static void deactivateModule(java.lang.String module, int controllerType)
          Deactivates a module with the given name.
static JRipplesModuleInterface getActiveCategoryModule(java.lang.String Category)
          Returns the active module in the provided category.
static java.lang.String getActiveCategoryModuleName(java.lang.String Category)
          Returns the name of an active module in the provided category.
static java.lang.String getDefaultCategoryModuleName(java.lang.String category)
          Finds the name of a default module for a given category of modules.
static java.util.Set<java.lang.String> getModuleCategoryLoaders(java.lang.String Category)
          Returns module loaders for a specified category of JRipples modules intalled in Eclipse.
static JRipplesModuleLoader getModuleLoader(java.lang.String ModuleName)
          Returns module loader for a module with the specified name.
static java.util.Set<java.lang.String> getModulesCategories()
          Returns a set with the names of all categories of modules, available in JRipples.
static java.util.Set<java.lang.String> getModulesLoaders()
          Returns module loaders for all JRipples modules intalled in Eclipse.
static java.lang.String loadDefaultCategoryModule(java.lang.String category)
          Finds and activates a default module for a given category of modules.
static void removeJRipplesModuleSwitchingListener(ModuleSwitchListener listener)
          Unregisters a listener, previously registered with addJRipplesModuleSwitchingListener(ModuleSwitchListener).
static void setActiveModule(java.lang.String module, int controllerType)
          Activates a module with the given name.
A role of a controller,which triggered this event, should be provided so that clients registered for receiving this kind of events, as well as modules involved in this event, can process activation and deactivation events more appropriately.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleProxy

public ModuleProxy()
The default constructor. As most utilities provided by ModuleProxy are static, this is typically not needed.

Method Detail

getModulesLoaders

public static java.util.Set<java.lang.String> getModulesLoaders()
Returns module loaders for all JRipples modules intalled in Eclipse.

Returns:
a set of module loaders for all JRipples modules intalled in Eclipse

getModuleLoader

public static JRipplesModuleLoader getModuleLoader(java.lang.String ModuleName)
Returns module loader for a module with the specified name.

Parameters:
ModuleName - name of the module to find
Returns:
module loader with the requested name if any,
null otherwise

getModulesCategories

public static java.util.Set<java.lang.String> getModulesCategories()
Returns a set with the names of all categories of modules, available in JRipples.

Returns:
a set with the names of all categories of modules, available in JRipples

getModuleCategoryLoaders

public static java.util.Set<java.lang.String> getModuleCategoryLoaders(java.lang.String Category)
Returns module loaders for a specified category of JRipples modules intalled in Eclipse.

Parameters:
Category - needed category of modules
Returns:
a set of module loaders

getActiveCategoryModuleName

public static java.lang.String getActiveCategoryModuleName(java.lang.String Category)
Returns the name of an active module in the provided category.

Parameters:
Category - category, for which an active module should be returned
Returns:
name of an active module in the given category if any,
empty string otherwise

getActiveCategoryModule

public static JRipplesModuleInterface getActiveCategoryModule(java.lang.String Category)
Returns the active module in the provided category.

Parameters:
Category - category, for which an active module should be returned
Returns:
active module in the given category if any,
null otherwise

setActiveModule

public static void setActiveModule(java.lang.String module,
                                   int controllerType)
Activates a module with the given name.
A role of a controller,which triggered this event, should be provided so that clients registered for receiving this kind of events, as well as modules involved in this event, can process activation and deactivation events more appropriately.

Parameters:
module - name of a module to activate
controllerType - role of a controller that requests module activation

deactivateModule

public static void deactivateModule(java.lang.String module,
                                    int controllerType)
Deactivates a module with the given name.
A role of a controller,which triggered this event, should be provided so that clients registered for receiving this kind of events, as well as modules involved in this event, can process activation and deactivation events more appropriately.

Parameters:
module - name of a module to deactivate
controllerType - role of a controller that requests module deactivation

getDefaultCategoryModuleName

public static java.lang.String getDefaultCategoryModuleName(java.lang.String category)
Finds the name of a default module for a given category of modules.

Parameters:
category - category of modules
Returns:
the name of a default module for a given category of modules

loadDefaultCategoryModule

public static java.lang.String loadDefaultCategoryModule(java.lang.String category)
Finds and activates a default module for a given category of modules.

Parameters:
category - category, for which a default module should be activated
Returns:
name of the activated module

addJRipplesModuleSwitchingListener

public static void addJRipplesModuleSwitchingListener(ModuleSwitchListener listener)
Registers a listener who wish to receive updates on module switching events.

Parameters:
listener - listener to register
See Also:
ModuleSwitchEvent, removeJRipplesModuleSwitchingListener(ModuleSwitchListener)

removeJRipplesModuleSwitchingListener

public static void removeJRipplesModuleSwitchingListener(ModuleSwitchListener listener)
Unregisters a listener, previously registered with addJRipplesModuleSwitchingListener(ModuleSwitchListener).

Parameters:
listener - listener to unregister
See Also:
ModuleSwitchEvent, removeJRipplesModuleSwitchingListener(ModuleSwitchListener)