本文整理了Java中org.netbeans.editor.Utilities.getNextWord()
方法的一些代码示例,展示了Utilities.getNextWord()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.getNextWord()
方法的具体详情如下:
包路径:org.netbeans.editor.Utilities
类名称:Utilities
方法名:getNextWord
暂无
代码示例来源:origin: net.java.abeille/abeille
public static int getNextWord(JTextComponent c, int offset) throws BadLocationException {
return getNextWord((BaseDocument) c.getDocument(), offset);
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib
public static int getNextWord(JTextComponent c, int offset)
throws BadLocationException {
int nextWordOffset = getNextWord((BaseDocument)c.getDocument(), offset);
int nextVisualPosition = c.getUI().getNextVisualPositionFrom(c,
nextWordOffset, null, javax.swing.SwingConstants.EAST, null);
return (nextVisualPosition - 1 == nextWordOffset) ? nextWordOffset : nextVisualPosition - 1;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf
static int nextCamelCasePosition(JTextComponent textComponent) {
int offset = textComponent.getCaretPosition();
Document doc = textComponent.getDocument();
// Are we at the end of the document?
if (offset == doc.getLength()) {
return -1;
}
KeystrokeHandler bc = GsfEditorKitFactory.getBracketCompletion(doc, offset);
if (bc != null) {
int nextOffset = bc.getNextWordOffset(doc, offset, false);
if (nextOffset != -1) {
return nextOffset;
}
}
try {
return Utilities.getNextWord(textComponent, offset);
} catch (BadLocationException ble) {
// something went wrong :(
ErrorManager.getDefault().notify(ble);
}
return -1;
}
代码示例来源:origin: net.java.abeille/abeille
public void actionPerformed(ActionEvent evt, JTextComponent target) {
if (target != null) {
Caret caret = target.getCaret();
try {
int dotPos = caret.getDot();
dotPos = Utilities.getNextWord(target, dotPos);
if (select) {
caret.moveDot(dotPos);
}
else {
caret.setDot(dotPos);
}
} catch (BadLocationException ex) {
target.getToolkit().beep();
}
}
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-editor
return Utilities.getNextWord(textComponent, offset);
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib
public void actionPerformed(ActionEvent evt, JTextComponent target) {
if (target != null) {
Caret caret = target.getCaret();
try {
int dotPos = caret.getDot();
dotPos = Utilities.getNextWord(target, dotPos);
if (caret instanceof BaseCaret){
BaseCaret bCaret = (BaseCaret) caret;
if (select) {
bCaret.moveDot(dotPos);
} else {
bCaret.setDot(dotPos, false);
}
}else {
if (select) {
caret.moveDot(dotPos);
} else {
caret.setDot(dotPos);
}
}
} catch (BadLocationException ex) {
target.getToolkit().beep();
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!