本文整理了Java中org.netbeans.editor.Utilities.requestFocus()
方法的一些代码示例,展示了Utilities.requestFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.requestFocus()
方法的具体详情如下:
包路径:org.netbeans.editor.Utilities
类名称:Utilities
方法名:requestFocus
暂无
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib
public static void returnFocus() {
JTextComponent c = getLastActiveComponent();
if (c != null) {
requestFocus(c);
}
}
代码示例来源:origin: net.java.abeille/abeille
public static void returnFocus() {
JTextComponent c = getLastActiveComponent();
if (c != null) {
requestFocus(c);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
@Override
public void actionPerformed(ActionEvent event) {
ActiveEditorDrop drop = (ActiveEditorDrop) item.lookup(ActiveEditorDrop.class);
JTextComponent target = Utilities.getFocusedComponent();
if (target == null) {
String msg = NbBundle.getMessage(PHPPaletteActions.class, "MSG_ErrorNoFocusedDocument");
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(msg, NotifyDescriptor.ERROR_MESSAGE));
return;
}
if (drop == null) {
Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.INFO, "{0} doesn''t provide {1}", new Object[]{item.getClass(), ActiveEditorDrop.class}); //NOI18N
return;
}
try {
drop.handleTransfer(target);
} finally {
Utilities.requestFocus(target);
}
try {
PaletteController paletteController = PHPPaletteFactory.getPalette();
paletteController.clearSelection();
} catch (IOException ioe) {
Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.INFO, null, ioe);
}
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib
/** Set the dot to the component and position
* stored in the mark.
* @return true if the caret was successfully moved
*/
public boolean setDot() {
JTextComponent c = getComponent();
if (c != null) {
if (Utilities.getLastActiveComponent() != c) {
Utilities.requestFocus(c); // possibly request for the component
}
int pos = getPosition();
if (pos >= 0 && pos <= c.getDocument().getLength()) {
c.getCaret().setDot(pos); // set the dot
return true;
}
}
return false;
}
代码示例来源:origin: net.java.abeille/abeille
/**
* Set the dot to the component and position stored in the mark.
*
* @return true if the caret was successfully moved
*/
public boolean setDot() {
JTextComponent c = getComponent();
if (c != null) {
if (Utilities.getLastActiveComponent() != c) {
Utilities.requestFocus(c); // possibly request for the
// component
}
int pos = getPosition();
if (pos >= 0 && pos <= c.getDocument().getLength()) {
c.getCaret().setDot(pos); // set the dot
return true;
}
}
return false;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-core
public void actionPerformed(ActionEvent e) {
ActiveEditorDrop drop = (ActiveEditorDrop) item.lookup(ActiveEditorDrop.class);
JTextComponent target = Utilities.getFocusedComponent();
if (target == null) {
String msg = NbBundle.getMessage(JspPaletteActions.class, "MSG_ErrorNoFocusedDocument");
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(msg, NotifyDescriptor.ERROR_MESSAGE));
return;
}
try {
drop.handleTransfer(target);
}
finally {
Utilities.requestFocus(target);
}
try {
PaletteController pc = JspPaletteFactory.getPalette();
pc.clearSelection();
}
catch (IOException ioe) {
//should not occur
}
}
}
内容来源于网络,如有侵权,请联系作者删除!