Example #1
1
 /**
  * Adds human readable shortcuts to the specified string.
  *
  * @param str text of tooltip
  * @param sc shortcut
  * @return tooltip
  */
 public static String addShortcut(final String str, final String sc) {
   if (sc == null || str == null) return str;
   final StringBuilder sb = new StringBuilder();
   for (final String s : sc.split(" ")) {
     String t = "%".equals(s) ? Prop.MAC ? "meta" : "control" : s;
     if (t.length() != 1) t = Toolkit.getProperty("AWT." + t.toLowerCase(Locale.ENGLISH), t);
     sb.append('+').append(t);
   }
   return str + " (" + sb.substring(1) + ')';
 }