本文整理了Java中org.eclipse.swt.widgets.Tree.addFocusListener()
方法的一些代码示例,展示了Tree.addFocusListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.addFocusListener()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:addFocusListener
暂无
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui
tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
tree.setData("name", "searchResultTree"); //$NON-NLS-1$ //$NON-NLS-2$
tree.addFocusListener(new FocusListener() {
代码示例来源:origin: inspectIT/inspectIT
/**
* {@inheritDoc}
*/
@Override
public void createPartControl(Composite parent, FormToolkit toolkit) {
subComposite = toolkit.createComposite(parent);
GridLayout layout = new GridLayout(1, true);
layout.marginWidth = 0;
layout.marginHeight = 0;
subComposite.setLayout(layout);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
subComposite.setLayoutData(gd);
super.createPartControl(subComposite, toolkit);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
getTreeViewer().getTree().setLayoutData(gd);
if (steppingControl == null) {
steppingControl = new SteppingControl(subComposite, toolkit, steppingTreeInputController.getSteppingObjectList());
}
if (steppingTreeInputController.initSteppingControlVisible() && (null != steppingTreeInputController.getSteppingObjectList())
&& !steppingTreeInputController.getSteppingObjectList().isEmpty()) {
steppingControl.showControl();
}
// the focus has to be passed to the subComposite, because it can not register it
getTreeViewer().getTree().addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
subComposite.notifyListeners(SWT.FocusIn, null);
}
});
}
内容来源于网络,如有侵权,请联系作者删除!