Revision: 1613 http://svn.sourceforge.net/spring-rich-c/?rev=1613&view=rev Author: kevinstembridge Date: 2006-12-27 14:36:48 -0800 (Wed, 27 Dec 2006)
Log Message: ----------- Added javadoc Modified Paths: -------------- trunk/spring-richclient/support/src/main/java/org/springframework/richclient/factory/LabelInfoFactory.java Modified: trunk/spring-richclient/support/src/main/java/org/springframework/richclient/factory/LabelInfoFactory.java =================================================================== --- trunk/spring-richclient/support/src/main/java/org/springframework/richclient/factory/LabelInfoFactory.java 2006-12-20 23:42:31 UTC (rev 1612) +++ trunk/spring-richclient/support/src/main/java/org/springframework/richclient/factory/LabelInfoFactory.java 2006-12-27 22:36:48 UTC (rev 1613) @@ -23,41 +23,51 @@ import org.springframework.util.StringUtils; /** - * A factory for creating a LabelInfo parameter object from a string descriptor. + * A factory for creating a [EMAIL PROTECTED] LabelInfo} parameter object from a given string descriptor. * The string is formatted as follows: * * <pre> - * - * * - * - * te&[EMAIL PROTECTED] - * - * + * te&[EMAIL PROTECTED] * - * * </pre> * - * Where "&" represents the label's mnemonic and implied mnemonic index, and @<accelerator> - * represents a key stroke accelerator to be set when this labelinfo is applied + * Where "&" represents the label's mnemonic and implied mnemonic index, and @<accelerator> + * represents a key stroke accelerator to be set when the [EMAIL PROTECTED] LabelInfo} is applied * to clickable buttons. * * @author Keith Donald */ public class LabelInfoFactory { + private static final Log logger = LogFactory.getLog(LabelInfoFactory.class); public String encodedLabel; public static final CommandButtonLabelInfo BLANK_BUTTON_LABEL = new CommandButtonLabelInfo("commandLabel"); + /** + * Creates a new uninitialized [EMAIL PROTECTED] LabelInfoFactory}. + */ public LabelInfoFactory() { + //do nothing } + /** + * Creates a new [EMAIL PROTECTED] LabelInfoFactory} that will create [EMAIL PROTECTED] LabelInfo} instances based + * on the given string. + * + * @param encodedLabel The string that represents the label info parameters. + */ public LabelInfoFactory(String encodedLabel) { setLabel(encodedLabel); } + /** + * Sets the string that uses an encoded syntax to represent label info parameters. + * + * @param encodedLabel The encoded representation of a [EMAIL PROTECTED] LabelInfo}. May be null. + */ public void setLabel(String encodedLabel) { this.encodedLabel = encodedLabel; } @@ -72,6 +82,11 @@ return parseLabelInfo(this.encodedLabel); } + /** + * Creates a new [EMAIL PROTECTED] CommandButtonLabelInfo} based on this instance's encoded label string. + * + * @return A new CommandButtonLabelInfo. + */ public CommandButtonLabelInfo createButtonLabelInfo() { return parseButtonLabelInfo(this.encodedLabel); } @@ -151,7 +166,7 @@ } String keyStrokeString = text.substring(i + 1); accelerator = KeyStroke.getKeyStroke(keyStrokeString); - if (accelerator == null) { + if (accelerator == null && logger.isWarnEnabled()) { logger.warn("Specified action accelerator string '" + keyStrokeString + "' did not translate to a valid KeyStroke."); } @@ -160,4 +175,5 @@ info = new LabelInfo(text, info.getMnemonic(), info.getMnemonicIndex()); return new CommandButtonLabelInfo(info, accelerator); } -} \ No newline at end of file + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ spring-rich-c-cvs mailing list spring-rich-c-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs