Eclipse Action在文本中带有“@”符号

时间:2015-01-07 14:54:27

标签: eclipse-plugin escaping swt special-characters jface

我试图用' @'来试图在日食中做一个动作。文本中的符号。但是当菜单呈现@缺失的时候,而且#' @'应该。

' @'符号在Eclipse / JFace / SWT中有特殊含义吗?我可以以某种方式逃脱吗?使用@@,会导致' @'被展示但是巨大的空间仍在那里。

1 个答案:

答案 0 :(得分:1)

答案在Action类的setText的注释中找到:

    /**
 * Sets the text for this action.
 * <p>
 * Fires a property change event for the <code>TEXT</code> property if the
 * text actually changes as a consequence.
 * </p>
 * <p>
 * The accelerator is identified by the last index of a tab character. If
 * there are no tab characters, then it is identified by the last index of a
 * '@' character. If neither, then there is no accelerator text. Note that
 * if you want to insert a '@' character into the text (but no accelerator,
 * you can simply insert a '@' or a tab at the end of the text.
 * </p>
 * 
 * @param text
 *            the text, or <code>null</code> if none
 */