[
https://issues.apache.org/jira/browse/TRINIDAD-2215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andy Schwartz resolved TRINIDAD-2215.
-------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.2-core
Added Accessibility.displayName() and Accessibility.valueOfDisplayName() APIs
in r1244522.
> String -> Accessibility enum API
> --------------------------------
>
> Key: TRINIDAD-2215
> URL: https://issues.apache.org/jira/browse/TRINIDAD-2215
> Project: MyFaces Trinidad
> Issue Type: Improvement
> Affects Versions: 2.0.0-core
> Reporter: Andy Schwartz
> Assignee: Andy Schwartz
> Priority: Minor
> Fix For: 2.0.2-core
>
> Attachments: trinidad-2215-take2.patch, trinidad-2215.patch
>
>
> The RequestContext.Accessibility enum defines aliases/pretty names for the
> enum constants:
> public enum Accessibility
> {
> /**
> * Output supports accessibility features
> */
> DEFAULT("default"),
> /**
> * Accessibility-specific constructs are stripped out to optimize output
> size
> */
> INACCESSIBLE("inaccessible"),
> /**
> * Accessibility-specific constructs are added to improve behavior under
> a screen reader
> * (but may affect other users negatively)
> */
> SCREEN_READER("screenReader");
> Accessibility(String name)
> {
> _name = name;
> }
> @Override
> public String toString()
> {
> return _name;
> }
> private final String _name;
> };
> I have several places in my code where I need to translate from the pretty
> name/alias (eg. "screenReader"), back to the corresponding enum constant.
> Enum.valueOf() is useless for this, since this only honors the canonical enum
> constant names (eg. "SCREEN_READER").
> I would like an API that performs the equivalent functionality of
> Enum.valueOf(), but for the pretty names/aliases.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira