简体   繁体   English

如何使用messages.properties文件向SWT对话框添加键盘快捷键?

[英]How to add keyboard shortcuts to SWT dialog using messages.properties file?

I need to add keyboard shortcuts to an SWT dialog in an Eclipse RCP application. 我需要在Eclipse RCP应用程序中向SWT对话框添加键盘快捷键。

Is it possible to add shortcut using the messages.properties file, without any coding/programming needed? 是否可以使用messages.properties文件添加快捷方式,而无需进行任何编码/编程?

If you place an ampersand character in the messassages.properties entry then you can use ALT+character to select the field after the Label that uses the property. 如果将“&”字符放在messassages.properties条目中,则可以使用ALT +字符选择使用该属性的Label之后的字段。

For example, if you have a username Text box and a Label that uses: 例如,如果您有一个用户名文本框和一个使用以下内容的标签:

MyDialog_username=&Username

Then pressing ALT+u will select the username field. 然后按ALT + u将选择用户名字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM