com.jbbres.lib.actions.tools.elements
Class SimpleElementDescription<T extends Element>

java.lang.Object
  extended by com.jbbres.lib.actions.tools.elements.SimpleElementDescription<T>
All Implemented Interfaces:
ElementDescription<T>, com.jbbres.lib.search.Searchable, java.lang.Comparable<ElementDescription<?>>
Direct Known Subclasses:
SimpleActionDescription, SimpleVariableDescription

public class SimpleElementDescription<T extends Element>
extends java.lang.Object
implements ElementDescription<T>

Provides information regarding the element, such as its name, a short description, its version number etc.

Since:
1.0.0
Version:
1.0.0
Author:
Jean-Baptiste Bres

Field Summary
 
Fields inherited from interface com.jbbres.lib.actions.elements.ElementDescription
CATEGORY_SEPARATOR, DESCRIPTION_CATEGORIES, DESCRIPTION_COMPANY_NAME, DESCRIPTION_COMPANY_SUPPORT, DESCRIPTION_COMPANY_WEBSITE, DESCRIPTION_COPYRIGHT, DESCRIPTION_ICON, DESCRIPTION_SUMMARY, DESCRIPTION_TITLE, DESCRIPTION_VERSION, TYPE
 
Constructor Summary
SimpleElementDescription()
          Instantiates a new simple element description.
SimpleElementDescription(java.lang.String title)
          Instantiates a new simple element description.
SimpleElementDescription(java.lang.String title, javax.swing.ImageIcon icon)
          Instantiates a new simple element description.
 
Method Summary
 void addElementDescriptionChangeListener(ElementDescriptionChangeListener listener)
          Adds a element description change listener.
 void addToCategory(Category c)
          Adds the element into the given category.
 int compareTo(ElementDescription<?> properties)
           
 void fireElementDescriptionChanges(java.lang.String key, java.lang.String oldValue)
          Calls the elementDescriptionChange(ElementDescriptionChangeEvent) of all the listeners.
 Category[] getCategories()
          Returns the categories associated to the element.
 java.lang.String getDescription(java.lang.String key)
          Returns the information associated to the given key.
 javax.swing.ImageIcon getIcon()
          Returns the icon associated to the element.
 java.lang.Object getSearchableValue(com.jbbres.lib.search.SearchField<?> field)
           
 Element newElementInstance(Workflow workflow)
          Creates and returns a new instance of the element described.
 void removeCategory(Category c)
          Removes the element into from the given category.
 void removeElementDescriptionChangeListener(ElementDescriptionChangeListener listener)
          Removes a element description change listener.
 void setDescription(java.lang.String key, java.lang.String value)
          Sets a description value.
 void setIcon(javax.swing.ImageIcon icon)
          Sets the element icon.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleElementDescription

public SimpleElementDescription()
Instantiates a new simple element description.


SimpleElementDescription

public SimpleElementDescription(java.lang.String title)
Instantiates a new simple element description.

Parameters:
title - - the element title

SimpleElementDescription

public SimpleElementDescription(java.lang.String title,
                                javax.swing.ImageIcon icon)
Instantiates a new simple element description.

Parameters:
title - - the element title
icon - - the element icon
Method Detail

getCategories

public Category[] getCategories()
Description copied from interface: ElementDescription
Returns the categories associated to the element.

Specified by:
getCategories in interface ElementDescription<T extends Element>
Returns:
the categories associated to the element

addToCategory

public void addToCategory(Category c)
Adds the element into the given category.

Parameters:
c - - the category

removeCategory

public void removeCategory(Category c)
Removes the element into from the given category.

Parameters:
c - - the category

getDescription

public java.lang.String getDescription(java.lang.String key)
Description copied from interface: ElementDescription
Returns the information associated to the given key.

Specified by:
getDescription in interface ElementDescription<T extends Element>
Parameters:
key - - the key
Returns:
the information associated to the given key.

setDescription

public void setDescription(java.lang.String key,
                           java.lang.String value)
Sets a description value.

Parameters:
key - - the description key
value - - the description value

getIcon

public javax.swing.ImageIcon getIcon()
Description copied from interface: ElementDescription
Returns the icon associated to the element.

Specified by:
getIcon in interface ElementDescription<T extends Element>
Returns:
the icon associated to the element

setIcon

public void setIcon(javax.swing.ImageIcon icon)
Sets the element icon.

Parameters:
icon - - the new icon

newElementInstance

public Element newElementInstance(Workflow workflow)
Description copied from interface: ElementDescription
Creates and returns a new instance of the element described.

This methods should not add the new element to the given workflow. Action(s) takes care of calling the appropried Workflow.add(Element) method.

Specified by:
newElementInstance in interface ElementDescription<T extends Element>
Parameters:
workflow - - the workflow that will own the element
Returns:
a new instance of the element described.

addElementDescriptionChangeListener

public void addElementDescriptionChangeListener(ElementDescriptionChangeListener listener)
Description copied from interface: ElementDescription
Adds a element description change listener.

Specified by:
addElementDescriptionChangeListener in interface ElementDescription<T extends Element>
Parameters:
listener - - the listener
See Also:
ElementDescriptionChangeListener

removeElementDescriptionChangeListener

public void removeElementDescriptionChangeListener(ElementDescriptionChangeListener listener)
Description copied from interface: ElementDescription
Removes a element description change listener.

Specified by:
removeElementDescriptionChangeListener in interface ElementDescription<T extends Element>
Parameters:
listener - - the listener
See Also:
ElementDescriptionChangeListener

fireElementDescriptionChanges

public void fireElementDescriptionChanges(java.lang.String key,
                                          java.lang.String oldValue)
Calls the elementDescriptionChange(ElementDescriptionChangeEvent) of all the listeners.

Parameters:
key - - the key of the description that changed
oldValue - the old value of the changed description

getSearchableValue

public java.lang.Object getSearchableValue(com.jbbres.lib.search.SearchField<?> field)
Specified by:
getSearchableValue in interface com.jbbres.lib.search.Searchable

compareTo

public int compareTo(ElementDescription<?> properties)
Specified by:
compareTo in interface java.lang.Comparable<ElementDescription<?>>


To file bugs or suggest feature enhancements, visit the app.jbbres.com Bug Reporter website.

Additional documentation available online at http://app.jbbres.com/actions/developers.

Copyright � 2009-2011 app.jbbres.com. All Rights Reserved.