com.jbbres.lib.actions.tools.elements
Class ResourceBundleActionDescription
java.lang.Object
com.jbbres.lib.actions.tools.elements.ResourceBundleElementDescription<Action>
com.jbbres.lib.actions.tools.elements.ResourceBundleActionDescription
- All Implemented Interfaces:
- ActionDescription, ElementDescription<Action>, com.jbbres.lib.search.Searchable, java.lang.Comparable<ElementDescription<?>>
public class ResourceBundleActionDescription
- extends ResourceBundleElementDescription<Action>
- implements ActionDescription
Provides information regarding the action, such as its name, a short
description, its version number etc.
This class provides the description of an action by extracting the content of
an element properties file (.properties).
A properties file is a simple text file. You can create and maintain a
properties file with just about any text editor.
The name of this file begins with the base name of your action, but start
with a lower case, and ends with the .properties suffix. For example, if your
action class base name is MyAction
, Therefore the properties
file is called myAction.properties
. This file contains the
following lines:
# This is the default myAction.properties file
type=action
service=com.acme.MyActionService
description.title=Add Text To File Name
description.summary=This action add a text before or after\
the names of the files or folders passed into it.
description.icon=icon.png
description.categories=#FilesCategory
description.input=Files/Folders
description.output=Files/Folders
description.company.name=Acme
description.company.website=http://www.acme.com/
description.company.support=http://www.acme.com/
description.version=1.0
description.copyright=© 2009-2010 Acme
Amoung other usages, The properties are used by Action(s) to displays
the description in its lower-left view whenever the user selects the action.
The description briefly describes what the action does and tells users
anything else they should know about the action.
Because the description fits into a relatively small area of the
Action(s) window, you should make it as concise and brief as possible.
Ideally the user should not have to scroll the description view to see all of
the text.
A description has several parts:
- description.icon: a 32 x 32 pixel image displayed in the upper-left
corner of the description. In the properties file you should provide the
relative path of the image within the package. Accepted format are PNG, JPEG,
GIF and BMP.
- description.title: the name of the action.
- description.summary: a sentence or two directly under the title that
succinctly states what the action does.
- description.input and description.output: states respectively the type of
data that the action accepts as an input and the type of data that the action
produce as a result.
A description’s icon, title, summary, input and ouput are required or
strongly recommended.
- Since:
- 1.0.0
- Version:
- 1.0.0
- Author:
- Jean-Baptiste Bres
Field Summary |
static java.lang.String |
TYPE_ACTION
The value iddentifying the element as an action in the description. |
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 |
Method Summary |
javax.swing.ImageIcon |
defaultIcon()
Returns the element default icon. |
Methods inherited from class com.jbbres.lib.actions.tools.elements.ResourceBundleElementDescription |
addElementDescriptionChangeListener, compareTo, fireElementDesccriptionChange, getCategories, getDescription, getElementClass, getElementDescription, getIcon, getSearchableValue, newElementInstance, removeElementDescriptionChangeListener |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jbbres.lib.search.Searchable |
getSearchableValue |
Methods inherited from interface java.lang.Comparable |
compareTo |
TYPE_ACTION
public static final java.lang.String TYPE_ACTION
- The value iddentifying the element as an action in the description. This
value should be associated to the
TYPE
key to iddentify the
element describe in the ressource bundle as an action.
- See Also:
- Constant Field Values
ResourceBundleActionDescription
public ResourceBundleActionDescription(java.lang.Class<? extends Action> actionClass)
throws java.io.IOException
- Extracts the action description object associated to a given
Action
class.
- Parameters:
actionClass
- the action class
- Throws:
java.io.IOException
- Signals that an I/O exception has occurred.
defaultIcon
public javax.swing.ImageIcon defaultIcon()
- Description copied from class:
ResourceBundleElementDescription
- Returns the element default icon.
- Specified by:
defaultIcon
in class ResourceBundleElementDescription<Action>
- Returns:
- the image icon
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.