org.eclipse.swt.widgets.Button.getListeners()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中org.eclipse.swt.widgets.Button.getListeners()方法的一些代码示例,展示了Button.getListeners()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.getListeners()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Button
类名称:Button
方法名:getListeners

Button.getListeners介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

selectedConnectionType = JmsProvider.ConnectionType.valueOf( delegate.connectionType );
for ( Listener l : wCheckBox.getListeners( SWT.Selection ) ) {
 if ( l instanceof SelectionListener ) {
  wCheckBox.removeSelectionListener( (SelectionListener) l );

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

/**
 * A launch configuration dialog overrides this method
 * to create a custom set of buttons in the button bar.
 * This dialog has 'Launch' and 'Cancel'
 * buttons.
 *
 * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
  Button button = createButton(parent, ID_LAUNCH_BUTTON, getLaunchButtonText(), true);
  button.setEnabled(false);
  Listener[] listeners = button.getListeners(SWT.Selection);
  for (Listener listener : listeners) {
    button.removeListener(SWT.Selection, listener);
  }
  listeners = button.getListeners(SWT.DefaultSelection);
  for (Listener listener : listeners) {
    button.removeListener(SWT.DefaultSelection, listener);
  }
  button.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent event) {
      setShift(((event.stateMask & SWT.SHIFT) > 0) ? true : false);
      handleLaunchPressed();
    }
  });
  createButton(parent, ID_CLOSE_BUTTON, LaunchConfigurationsMessages.LaunchConfigurationDialog_Close_1, false);
}

相关文章

Button类方法