com.atlassian.jira.issue.customfields.manager
Class DefaultOptionsManager

java.lang.Object
  extended by com.atlassian.jira.issue.customfields.manager.DefaultOptionsManager
All Implemented Interfaces:
OptionsManager
Direct Known Subclasses:
CachedOptionsManager

public class DefaultOptionsManager
extends Object
implements OptionsManager


Field Summary
static String ENTITY_CONFIG_ID
           
protected  FieldConfigManager fieldConfigManager
           
 
Constructor Summary
DefaultOptionsManager(OfBizDelegator delegator, CollectionReorderer<Option> reorderer, FieldConfigManager fieldConfigManager)
           
 
Method Summary
 Option createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value)
           
 void deleteOptionAndChildren(Option option)
           
 void disableOption(Option option)
          Set an option to disabled.
 void enableOption(Option option)
          Set an option to enabled.
 Option findByOptionId(Long optionId)
           
 List<Option> findByOptionValue(String value)
          Finds all options with the given value.
 List<Option> findByParentId(Long parentOptionId)
           
 List<Option> getAllOptions()
          Retreives all Option in the system.
 Options getOptions(FieldConfig fieldConfig)
          Get options for this particular custom field type.
 void removeCustomFieldConfigOptions(FieldConfig fieldConfig)
           
 void removeCustomFieldOptions(CustomField customField)
           
 void setRootOptions(FieldConfig fieldConfig, Options options)
           
 void setValue(Option option, String value)
           
 void updateOptions(Collection<Option> options)
          Update a set of options.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTITY_CONFIG_ID

public static final String ENTITY_CONFIG_ID
See Also:
Constant Field Values

fieldConfigManager

protected final FieldConfigManager fieldConfigManager
Constructor Detail

DefaultOptionsManager

public DefaultOptionsManager(OfBizDelegator delegator,
                             CollectionReorderer<Option> reorderer,
                             FieldConfigManager fieldConfigManager)
Method Detail

getOptions

public Options getOptions(FieldConfig fieldConfig)
Description copied from interface: OptionsManager
Get options for this particular custom field type. As a custom field may have multiple types of options (eg cascading drop downs), the type can be used to signify this

Specified by:
getOptions in interface OptionsManager
Parameters:
fieldConfig - For example, retrieved from CustomField.getRelevantConfig(com.atlassian.jira.issue.Issue)
Returns:
An option Object of Options

setRootOptions

public void setRootOptions(FieldConfig fieldConfig,
                           Options options)
Specified by:
setRootOptions in interface OptionsManager

removeCustomFieldOptions

public void removeCustomFieldOptions(CustomField customField)
Specified by:
removeCustomFieldOptions in interface OptionsManager

removeCustomFieldConfigOptions

public void removeCustomFieldConfigOptions(FieldConfig fieldConfig)
Specified by:
removeCustomFieldConfigOptions in interface OptionsManager

updateOptions

public void updateOptions(Collection<Option> options)
Description copied from interface: OptionsManager
Update a set of options. After doing this, any existing Options objects may be stale, and should be re-fetched with OptionsManager.getOptions(com.atlassian.jira.issue.fields.config.FieldConfig).

Specified by:
updateOptions in interface OptionsManager
Parameters:
options - Usually an Options implementation.

createOption

public Option createOption(FieldConfig fieldConfig,
                           Long parentOptionId,
                           Long sequence,
                           String value)
Specified by:
createOption in interface OptionsManager

deleteOptionAndChildren

public void deleteOptionAndChildren(Option option)
Specified by:
deleteOptionAndChildren in interface OptionsManager

getAllOptions

public List<Option> getAllOptions()
Description copied from interface: OptionsManager
Retreives all Option in the system.

Specified by:
getAllOptions in interface OptionsManager
Returns:
a list of all options in the system

disableOption

public void disableOption(Option option)
Description copied from interface: OptionsManager
Set an option to disabled. A disabled option will is not available to be assigned to this associated custom field, It remains valid historically and for searching with.

Specified by:
disableOption in interface OptionsManager
Parameters:
option - The option to be disabled.

enableOption

public void enableOption(Option option)
Description copied from interface: OptionsManager
Set an option to enabled.

Specified by:
enableOption in interface OptionsManager
Parameters:
option - The Option to enable.

setValue

public void setValue(Option option,
                     String value)
Specified by:
setValue in interface OptionsManager

findByOptionValue

public List<Option> findByOptionValue(String value)
Description copied from interface: OptionsManager
Finds all options with the given value. Returns and empty list if no options are found.

Specified by:
findByOptionValue in interface OptionsManager
Parameters:
value - the value of the options to find (case insensitive). Must not be null.
Returns:
the list of found options, empty if non found.

findByOptionId

public Option findByOptionId(Long optionId)
Specified by:
findByOptionId in interface OptionsManager

findByParentId

public List<Option> findByParentId(Long parentOptionId)
Specified by:
findByParentId in interface OptionsManager


Copyright © 2002-2014 Atlassian. All Rights Reserved.