org.jtheque.core.managers.feature
Class FeatureManager

java.lang.Object
  extended by org.jtheque.core.managers.feature.FeatureManager
All Implemented Interfaces:
IFeatureManager, IManager

public final class FeatureManager
extends java.lang.Object
implements IFeatureManager, IManager

A Feature manager.

Author:
Baptiste Wicht

Nested Class Summary
protected  class FeatureManager.ManagedFeature
          A managed feature.
 
Nested classes/interfaces inherited from interface org.jtheque.core.managers.feature.IFeatureManager
IFeatureManager.CoreFeature
 
Constructor Summary
FeatureManager()
          Construct a new FeatureManager.
 
Method Summary
 void addFeature(Feature feature)
          Add a feature.
 void addFeatureListener(FeatureListener listener)
          Add a feature listener.
 Feature addSubFeature(Feature parent, JThequeAction action, Feature.FeatureType type, int position)
          Add a sub feature to a parent feature.
 Feature addSubFeature(Feature parent, java.lang.String action, Feature.FeatureType type, int position)
          Add a sub feature to a parent feature.
 Feature addSubFeature(Feature parent, java.lang.String actionName, Feature.FeatureType type, int position, java.lang.String icon)
          Add a sub feature to a parent feature.
 Feature addSubFeature(Feature parent, java.lang.String actionName, Feature.FeatureType type, int position, java.lang.String basename, java.lang.String icon)
          Add a sub feature to a parent feature.
 void close()
          Close the manager.
 Feature createFeature(int position, Feature.FeatureType type, java.lang.String key)
          Create a feature.
 Feature getFeature(IFeatureManager.CoreFeature feature)
          Return the core feature.
 java.util.List<Feature> getFeatures()
          Return all the features of the application.
 void init()
          Init the manager.
 void preInit()
          Pre-init the manager.
 void removeFeature(Feature feature)
          Remove a feature.
 void removeFeatureListener(FeatureListener listener)
          Remove a feature listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureManager

public FeatureManager()
Construct a new FeatureManager.

Method Detail

preInit

public void preInit()
Description copied from interface: IManager
Pre-init the manager. This operation is called before modules preplug.

Specified by:
preInit in interface IManager

close

public void close()
           throws ManagerException
Description copied from interface: IManager
Close the manager.

Specified by:
close in interface IManager
Throws:
ManagerException - If an error occurs during the close process.

init

public void init()
          throws ManagerException
Description copied from interface: IManager
Init the manager. This operation is called after modules preplug but before module plug.

Specified by:
init in interface IManager
Throws:
ManagerException - If an error occurs during the init process.

createFeature

public Feature createFeature(int position,
                             Feature.FeatureType type,
                             java.lang.String key)
Description copied from interface: IFeatureManager
Create a feature.

Specified by:
createFeature in interface IFeatureManager
Parameters:
position - The position of the feature.
type - The type of the feature.
key - The internationalization key.
Returns:
The created feature.

addSubFeature

public Feature addSubFeature(Feature parent,
                             java.lang.String actionName,
                             Feature.FeatureType type,
                             int position,
                             java.lang.String basename,
                             java.lang.String icon)
Description copied from interface: IFeatureManager
Add a sub feature to a parent feature.

Specified by:
addSubFeature in interface IFeatureManager
Parameters:
parent - The parent feature.
actionName - The bean name of the action.
type - The type of the subfeature.
position - The position of the subfeature.
basename - The images basename.
icon - The icon of the action.
Returns:
The subfeature.

addSubFeature

public Feature addSubFeature(Feature parent,
                             java.lang.String actionName,
                             Feature.FeatureType type,
                             int position,
                             java.lang.String icon)
Description copied from interface: IFeatureManager
Add a sub feature to a parent feature.

Specified by:
addSubFeature in interface IFeatureManager
Parameters:
parent - The parent feature.
actionName - The bean name of the action.
type - The type of the subfeature.
position - The position of the subfeature.
icon - The icon of the action. The manager will search using the images basename of the core.
Returns:
The subfeature.

addSubFeature

public Feature addSubFeature(Feature parent,
                             java.lang.String action,
                             Feature.FeatureType type,
                             int position)
Description copied from interface: IFeatureManager
Add a sub feature to a parent feature.

Specified by:
addSubFeature in interface IFeatureManager
Parameters:
parent - The parent feature.
action - The bean name of the action.
type - The type of the subfeature.
position - The position of the subfeature.
Returns:
The subfeature.

addSubFeature

public Feature addSubFeature(Feature parent,
                             JThequeAction action,
                             Feature.FeatureType type,
                             int position)
Description copied from interface: IFeatureManager
Add a sub feature to a parent feature.

Specified by:
addSubFeature in interface IFeatureManager
Parameters:
parent - The parent feature.
action - The action.
type - The type of the subfeature.
position - The position of the subfeature.
Returns:
The subfeature.

addFeature

public void addFeature(Feature feature)
Description copied from interface: IFeatureManager
Add a feature.

Specified by:
addFeature in interface IFeatureManager
Parameters:
feature - The feature to add.

removeFeature

public void removeFeature(Feature feature)
Description copied from interface: IFeatureManager
Remove a feature.

Specified by:
removeFeature in interface IFeatureManager
Parameters:
feature - The feature to remove.

getFeatures

public java.util.List<Feature> getFeatures()
Description copied from interface: IFeatureManager
Return all the features of the application.

Specified by:
getFeatures in interface IFeatureManager
Returns:
A List containing all the features.

getFeature

public Feature getFeature(IFeatureManager.CoreFeature feature)
Description copied from interface: IFeatureManager
Return the core feature.

Specified by:
getFeature in interface IFeatureManager
Parameters:
feature - The feature type.
Returns:
The searched feature.

addFeatureListener

public void addFeatureListener(FeatureListener listener)
Description copied from interface: IFeatureManager
Add a feature listener.

Specified by:
addFeatureListener in interface IFeatureManager
Parameters:
listener - The feature listener to add.

removeFeatureListener

public void removeFeatureListener(FeatureListener listener)
Description copied from interface: IFeatureManager
Remove a feature listener.

Specified by:
removeFeatureListener in interface IFeatureManager
Parameters:
listener - The feature listener to remove.


Copyright © 2009 JTheque. All Rights Reserved.