本文整理了Java中org.openide.util.Utilities.addModifiers()
方法的一些代码示例,展示了Utilities.addModifiers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.addModifiers()
方法的具体详情如下:
包路径:org.openide.util.Utilities
类名称:Utilities
方法名:addModifiers
[英]Adds characters for modifiers to the buffer.
[中]
代码示例来源:origin: org.netbeans.api/org-openide-util
/** Converts a Swing key stroke descriptor to a familiar Emacs-like name.
* @param stroke key description
* @return name of the key (e.g. <code>CS-F1</code> for control-shift-function key one)
* @see #stringToKey
*/
public static String keyToString(KeyStroke stroke) {
StringBuilder sb = new StringBuilder();
// add modifiers that must be pressed
if (addModifiers(sb, stroke.getModifiers())) {
sb.append('-');
}
appendRest(sb, stroke);
return sb.toString();
}
代码示例来源:origin: org.netbeans.api/org-openide-util-ui
/** Converts a Swing key stroke descriptor to a familiar Emacs-like name.
* @param stroke key description
* @return name of the key (e.g. <code>CS-F1</code> for control-shift-function key one)
* @see #stringToKey
*/
public static String keyToString(KeyStroke stroke) {
StringBuilder sb = new StringBuilder();
// add modifiers that must be pressed
if (addModifiers(sb, stroke.getModifiers())) {
sb.append('-');
}
appendRest(sb, stroke);
return sb.toString();
}
代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/org-openide-util
/** Converts a Swing key stroke descriptor to a familiar Emacs-like name.
* @param stroke key description
* @return name of the key (e.g. <code>CS-F1</code> for control-shift-function key one)
* @see #stringToKey
*/
public static String keyToString(KeyStroke stroke) {
StringBuilder sb = new StringBuilder();
// add modifiers that must be pressed
if (addModifiers(sb, stroke.getModifiers())) {
sb.append('-');
}
appendRest(sb, stroke);
return sb.toString();
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
/** Converts a Swing key stroke descriptor to a familiar Emacs-like name.
* @param stroke key description
* @return name of the key (e.g. <code>CS-F1</code> for control-shift-function key one)
* @see #stringToKey
*/
public static String keyToString (KeyStroke stroke) {
StringBuffer sb = new StringBuffer ();
// add modifiers that must be pressed
if (addModifiers (sb, stroke.getModifiers ())) {
sb.append ('-');
}
HashMap[] namesAndValues = initNameAndValues ();
String c = (String)namesAndValues[1].get (new Integer (stroke.getKeyCode ()));
if (c == null) {
sb.append (stroke.getKeyChar ());
} else {
sb.append (c);
}
return sb.toString ();
}
代码示例来源:origin: in.jlibs/org-openide-util
/** Converts a Swing key stroke descriptor to a familiar Emacs-like name.
* @param stroke key description
* @return name of the key (e.g. <code>CS-F1</code> for control-shift-function key one)
* @see #stringToKey
*/
public static String keyToString(KeyStroke stroke) {
StringBuilder sb = new StringBuilder();
// add modifiers that must be pressed
if (addModifiers(sb, stroke.getModifiers())) {
sb.append('-');
}
String c = initNameAndValues().keyToString.get(Integer.valueOf(stroke.getKeyCode()));
if (c == null) {
sb.append(stroke.getKeyChar());
} else {
sb.append(c);
}
return sb.toString();
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
/** Converts a Swing key stroke descriptor to a familiar Emacs-like name.
* @param stroke key description
* @return name of the key (e.g. <code>CS-F1</code> for control-shift-function key one)
* @see #stringToKey
*/
public static String keyToString (KeyStroke stroke) {
StringBuffer sb = new StringBuffer ();
// add modifiers that must be pressed
if (addModifiers (sb, stroke.getModifiers ())) {
sb.append ('-');
}
HashMap[] namesAndValues = initNameAndValues ();
String c = (String)namesAndValues[1].get (new Integer (stroke.getKeyCode ()));
if (c == null) {
sb.append (stroke.getKeyChar ());
} else {
sb.append (c);
}
return sb.toString ();
}
内容来源于网络,如有侵权,请联系作者删除!