com.jbbres.lib.actions.tools.elements
Class DefaultActionDescription

java.lang.Object
  extended by com.jbbres.lib.actions.tools.elements.ResourceBundleElementDescription<T>
      extended by com.jbbres.lib.actions.tools.elements.AbstractElementDescription<Action>
          extended by com.jbbres.lib.actions.tools.elements.DefaultActionDescription
All Implemented Interfaces:
ActionDescription, ElementDescription<Action>, com.jbbres.lib.search.Searchable, java.lang.Comparable<ElementDescription<?>>

public class DefaultActionDescription
extends AbstractElementDescription<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
action.ui=com.acme.MyActionUI
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:

A description icon, title, summary, input and ouput are required or strongly recommended. Release Notes:

v1.1.0:

  • Added compatibility with module library v1.1
  • Since:
    1.0.0
    Version:
    1.1.0
    Author:
    Jean-Baptiste Bres

    Field Summary
    static java.lang.String CAN_SHOW_WHEN_RUN
              The property key associated to a boolean value that define if "show when run" is on
    static java.lang.String PROMPT
              The property key associated to the default "Show when run" prompt text
    static java.lang.String SHOW_WHEN_RUN
              The property key associated to a boolean value that define the default state of the "Show when run" option
    static java.lang.String UI
              The property key associated to the User Interface class.
     
    Fields inherited from class com.jbbres.lib.actions.tools.elements.AbstractElementDescription
    SERVICE
     
    Fields inherited from interface com.jbbres.lib.actions.elements.ActionDescription
    DEFAULT_INPUT_PROVIDER, DESCRIPTION_INPUT, DESCRIPTION_OUTPUT, WARNING_CANCEL_BUTTON, WARNING_CONTINUE_BUTTON, WARNING_MESSAGE, WARNING_SUGGESTED_ACTION
     
    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
    DefaultActionDescription(java.lang.Class<? extends AbstractAction> actionClass)
              Instantiates a new action description.
     
    Method Summary
     javax.swing.ImageIcon defaultIcon()
              Returns the element default icon.
    static java.lang.String defaultShowDuringExecutionPrompt(ActionDescription actionDescription)
              A convenience method that returns the default prompt value of the action.
    static boolean defaultShowDuringExecutionStatus(ActionDescription actionDescription)
              A convenience method that returns true if the "show when running the workflow" checkbox is selected by default.
    static java.lang.Class<AbstractActionUI> getUIClass(ActionDescription actionDescription)
              A convenience method that returns the UI class associated to the action.
    static boolean isShowDuringExecutionAvailable(ActionDescription actionDescription)
              A convenience method that returns true if the "show when run" functionalitity is available for the action.
     
    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.actions.elements.ElementDescription
    addElementDescriptionChangeListener, getCategories, getDescription, getIcon, newElementInstance, removeElementDescriptionChangeListener
     
    Methods inherited from interface com.jbbres.lib.search.Searchable
    getSearchableValue
     
    Methods inherited from interface java.lang.Comparable
    compareTo
     

    Field Detail

    UI

    public static final java.lang.String UI
    The property key associated to the User Interface class. The class should be an instance of AbstractActionUI.

    The value associated to this key should be the User Interface class full name

    See Also:
    Constant Field Values

    CAN_SHOW_WHEN_RUN

    public static final java.lang.String CAN_SHOW_WHEN_RUN
    The property key associated to a boolean value that define if "show when run" is on

    See Also:
    Constant Field Values

    SHOW_WHEN_RUN

    public static final java.lang.String SHOW_WHEN_RUN
    The property key associated to a boolean value that define the default state of the "Show when run" option

    See Also:
    Constant Field Values

    PROMPT

    public static final java.lang.String PROMPT
    The property key associated to the default "Show when run" prompt text

    See Also:
    Constant Field Values
    Constructor Detail

    DefaultActionDescription

    public DefaultActionDescription(java.lang.Class<? extends AbstractAction> actionClass)
                             throws java.io.IOException
    Instantiates a new action description.

    Parameters:
    actionClass - - the action class
    Throws:
    java.io.IOException - Signals that an I/O exception has occurred.
    Method Detail

    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

    isShowDuringExecutionAvailable

    public static boolean isShowDuringExecutionAvailable(ActionDescription actionDescription)
    A convenience method that returns true if the "show when run" functionalitity is available for the action.

    Parameters:
    actionDescription - - the action description
    Returns:
    true if the "show when run" functionalitity is available for the action

    defaultShowDuringExecutionStatus

    public static boolean defaultShowDuringExecutionStatus(ActionDescription actionDescription)
    A convenience method that returns true if the "show when running the workflow" checkbox is selected by default.

    Parameters:
    actionDescription - - the action description
    Returns:
    trueif the "show when running the workflow" checkbox is selected by default

    defaultShowDuringExecutionPrompt

    public static java.lang.String defaultShowDuringExecutionPrompt(ActionDescription actionDescription)
    A convenience method that returns the default prompt value of the action.

    Parameters:
    actionDescription - - the action description
    Returns:
    the default prompt value of the action

    getUIClass

    public static java.lang.Class<AbstractActionUI> getUIClass(ActionDescription actionDescription)
    A convenience method that returns the UI class associated to the action.

    Parameters:
    actionDescription - - the action description
    Returns:
    the UI class associated to the action.


    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.