org.jtheque.core.managers.feature
Class Feature

java.lang.Object
  extended by org.jtheque.core.managers.feature.Feature
Direct Known Subclasses:
FeatureManager.ManagedFeature

public class Feature
extends Object

A Feature of JTheque.

Author:
Baptiste Wicht

Nested Class Summary
static class Feature.FeatureType
          The Feature Type.
 
Constructor Summary
Feature()
          Construct a new Feature.
Feature(Feature.FeatureType type, Integer position, Action action)
          Construct a new Feature for an action.
Feature(Feature.FeatureType type, String titleKey, Integer position)
          Construct a new Feature for a menu.
 
Method Summary
 void addSubFeature(Feature feature)
          Add a sub feature to the feature.
 Action getAction()
          Return the action of the feature.
 String getBaseName()
          Return the base name for getting the icon.
 String getIcon()
          Return the icon of the feature.
 Integer getPosition()
          Return the position of the feature.
 Collection<Feature> getSubFeatures()
          Return the sub features of the feature.
 String getTitleKey()
          Return the internationalization key of the title of the feature.
 Feature.FeatureType getType()
          Return the type of the feature.
 void removeSubFeature(Feature feature)
          Remove a sub feature to the feature.
 void setAction(Action action)
          Set the action of the feature.
 void setBaseName(String baseName)
          Set the base name for the resources.
 void setIcon(String icon)
          Set the icon of the feature.
 void setPosition(Integer position)
          Set the position of the feature.
 void setTitleKey(String titleKey)
          Set the internationalization key of the title of the feature.
 void setType(Feature.FeatureType type)
          Set the type of the feature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Feature

public Feature()
Construct a new Feature.


Feature

public Feature(Feature.FeatureType type,
               Integer position,
               Action action)
Construct a new Feature for an action.

Parameters:
type - The type of feature.
position - The position of the feature in the parent.
action - The action to execute when the feature is pressed.

Feature

public Feature(Feature.FeatureType type,
               String titleKey,
               Integer position)
Construct a new Feature for a menu.

Parameters:
type - The type of feature.
titleKey - The i18n key of the title of the feature.
position - The position of the feature in the parent.
Method Detail

getType

public final Feature.FeatureType getType()
Return the type of the feature.

Returns:
The type of the feature.

setType

public final void setType(Feature.FeatureType type)
Set the type of the feature.

Parameters:
type - The type of the feature.

getTitleKey

public final String getTitleKey()
Return the internationalization key of the title of the feature.

Returns:
The internationalisation key of the feature.

setTitleKey

public final void setTitleKey(String titleKey)
Set the internationalization key of the title of the feature.

Parameters:
titleKey - The title key.

getAction

public final Action getAction()
Return the action of the feature.

Returns:
The action.

setAction

public final void setAction(Action action)
Set the action of the feature.

Parameters:
action - The action.

getSubFeatures

public final Collection<Feature> getSubFeatures()
Return the sub features of the feature.

Returns:
A List containing all the sub feature of the feature.

addSubFeature

public void addSubFeature(Feature feature)
Add a sub feature to the feature.

Parameters:
feature - The feature to add.

removeSubFeature

public void removeSubFeature(Feature feature)
Remove a sub feature to the feature.

Parameters:
feature - The feature to remove.

getPosition

public final Integer getPosition()
Return the position of the feature.

Returns:
The position of the feature.

setPosition

public final void setPosition(Integer position)
Set the position of the feature.

Parameters:
position - The position of the feature.

getIcon

public final String getIcon()
Return the icon of the feature.

Returns:
The icon of the feature.

setIcon

public final void setIcon(String icon)
Set the icon of the feature.

Parameters:
icon - The icon of the feature.

getBaseName

public final String getBaseName()
Return the base name for getting the icon.

Returns:
The base name.

setBaseName

public final void setBaseName(String baseName)
Set the base name for the resources.

Parameters:
baseName - The base name.


Copyright © 2010 JTheque. All Rights Reserved.