本文整理了Java中org.eclipse.swt.widgets.Canvas.setFocus()
方法的一些代码示例,展示了Canvas.setFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.setFocus()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Canvas
类名称:Canvas
方法名:setFocus
暂无
代码示例来源:origin: pentaho/pentaho-kettle
public boolean setFocus() {
return ( canvas != null && !canvas.isDisposed() ) ? canvas.setFocus() : false;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Called when we must grab focus.
*/
public void setFocus() {
paintCanvas.setFocus();
}
代码示例来源:origin: org.xworker/xworker_swt
public void handleEvent(Event e) {
Canvas sc = (Canvas) e.widget;
sc.setFocus();
}
});
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
@Override
public boolean setFocus() {
mouseFocus = true;
FormUtil.setFocusScrollingEnabled(this, false);
boolean result = super.setFocus();
mouseFocus = false;
FormUtil.setFocusScrollingEnabled(this, true);
return result;
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
@Override
public boolean setFocus() {
mouseFocus = true;
FormUtil.setFocusScrollingEnabled(this, false);
boolean result = super.setFocus();
mouseFocus = false;
FormUtil.setFocusScrollingEnabled(this, true);
return result;
}
}
代码示例来源:origin: be.yildiz-games/module-window-swt
@Override
public void registerInput(final WindowInputListener listener) {
new SwtGameWindowMouseListener(this.gameWindow.getCanvas(), listener);
SwtGameWindowKeyListener kl = SwtGameWindowKeyListener.create(listener);
this.gameWindow.getCanvas().addKeyListener(kl);
this.gameWindow.getCanvas().setFocus();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Sets or clears the caret in the "Example" widget.
*/
void setCaret () {
Caret oldCaret = canvas.getCaret ();
if (caretButton.getSelection ()) {
Caret newCaret = new Caret(canvas, SWT.NONE);
Font font = canvas.getFont();
newCaret.setFont(font);
GC gc = new GC(canvas);
gc.setFont(font);
newCaret.setBounds(1, 1, 1, gc.getFontMetrics().getHeight());
gc.dispose();
canvas.setCaret (newCaret);
canvas.setFocus();
} else {
canvas.setCaret (null);
}
if (oldCaret != null) oldCaret.dispose ();
}
内容来源于网络,如有侵权,请联系作者删除!