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

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

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

Button.removeListener介绍

暂无

代码示例

代码示例来源:origin: atdl4j/atdl4j

public void removeListener(Listener listener)
{
  for ( Button b : buttons )
  {
    b.removeListener( SWT.Selection, listener );
  }
}

代码示例来源:origin: atdl4j/atdl4j

public void removeListener(Listener listener)
{
  for ( Button b : multiCheckBox )
  {
    b.removeListener( SWT.Selection, listener );
  }
}

代码示例来源:origin: atdl4j/atdl4j

public void removeListener(Listener listener)
{
  button.removeListener( SWT.Selection, listener );
}

代码示例来源:origin: atdl4j/atdl4j

public void removeListener(Listener listener)
{
  spinner.removeListener( listener );
  if ( control instanceof DoubleSpinnerT )
  {
    buttonUp.removeListener( SWT.Selection, listener );
    buttonDown.removeListener( SWT.Selection, listener );
  }
}

代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.converter

@Override
public void dispose()
{
 if (uriText != null)
 {
  uriText.removeListener(SWT.Modify, this);
  uriText = null;
 }
 if (browseFileSystemButton != null)
 {
  browseFileSystemButton.removeListener(SWT.Selection, this);
  browseFileSystemButton = null;
 }
 if (browseWorkspaceButton != null)
 {
  browseWorkspaceButton.removeListener(SWT.Selection, this);
  browseWorkspaceButton = null;
 }
 super.dispose();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

/**
 * Removes the listener from the collection of listeners who will
 * be notified when the control is selected.
 *
 * @param listener the listener which should no longer be notified
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @see SelectionListener
 * @see #addSelectionListener
 */
public void removeSelectionListener( SelectionListener listener ) {
 checkWidget();
 if( listener == null ) {
  SWT.error( SWT.ERROR_NULL_ARGUMENT );
 }
 removeListener( SWT.Selection, listener );
 removeListener( SWT.DefaultSelection, listener );
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void handleEvent(Event event) {
    action.removeListener(SWT.Selection,this);
    COConfigurationManager.setParameter("subscriptions.autocheck",true);
    startChecking();
    mainComposite.layout();
  }
});

代码示例来源:origin: org.eclipse/org.eclipse.emf.importer

@Override
public void dispose()
{
 if (loadButton != null)
 {
  loadButton.removeListener(SWT.Selection, this);
  loadButton = null;
 }    
 if (genModelNameText != null)
 {
  genModelNameText.removeListener(SWT.Modify, this);
  genModelNameText = null;
 }
 super.dispose();
}

代码示例来源:origin: com.eclipsesource.tabris/tabris

private void updatePageNavigationBar( PageDescriptor pageDescriptor ) {
 if( pageDescriptor.isTopLevel() ) {
  backButton.removeListener( SWT.Selection, backButtonSelectionListener );
  backButton.setEnabled( false );
  notifyMenuItemSelected( pageDescriptor );
 } else {
  if( !backButton.isListening( SWT.Selection ) ) {
   backButton.addListener( SWT.Selection, backButtonSelectionListener );
  }
  backButton.setEnabled( true );
 }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

@Override
  public void run () {
    if (shell.isDisposed () || status == DOWNLOAD_FINISHED || status == DOWNLOAD_CANCELLED) {
      shell.dispose ();
      return;
    }
    if (status == DOWNLOAD_ERROR) {
      statusLabel.setText (Compatibility.getMessage ("SWT_Download_Error")); //$NON-NLS-1$
      cancel.removeListener (SWT.Selection, cancelListener);
      cancel.addListener (SWT.Selection, new Listener () {
        @Override
        public void handleEvent (Event event) {
          shell.dispose ();
        }
      });
      return;
    }
    long current = size / 1024L;
    long total = totalSize / 1024L;
    String message = Compatibility.getMessage ("SWT_Download_Status", new Object[] {new Long(current), new Long(total)}); //$NON-NLS-1$
    statusLabel.setText (message);
    display.timerExec (INTERVAL, this);
  }
});

代码示例来源: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);
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private void updateDefaultButtonFocusListener( Button defaultButton, boolean set ) {
 if( !defaultButton.isDisposed() ) {
  if( set ) {
   defaultButton.addListener( SWT.FocusOut, getDefaultButtonFocusListener() );
  } else {
   defaultButton.removeListener( SWT.FocusOut, getDefaultButtonFocusListener() );
  }
 }
}

代码示例来源:origin: BiglySoftware/BiglyBT

btnOk.removeListener(SWT.Selection,lOk);
btnOk.setEnabled(true);
btnOk.addListener(SWT.Selection,new Listener() {
if(restartRequired) {
 Messages.setLanguageText(btnOk,"UpdateWindow.restart");
 btnCancel.removeListener(SWT.Selection,lCancel);
 Messages.setLanguageText(btnCancel,"UpdateWindow.restartLater");
 btnCancel.addListener(SWT.Selection, new Listener() {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
  public void run () {
    int status = WebKitGTK.webkit_download_get_status (webkitDownload);
    if (shell.isDisposed () || status == WebKitGTK.WEBKIT_DOWNLOAD_STATUS_FINISHED || status == WebKitGTK.WEBKIT_DOWNLOAD_STATUS_CANCELLED) {
      shell.dispose ();
      display.timerExec (-1, this);
      OS.g_object_unref (webkitDownload);
      return;
    }
    if (status == WebKitGTK.WEBKIT_DOWNLOAD_STATUS_ERROR) {
      statusLabel.setText (Compatibility.getMessage ("SWT_Download_Error")); //$NON-NLS-1$
      display.timerExec (-1, this);
      OS.g_object_unref (webkitDownload);
      cancel.removeListener (SWT.Selection, cancelListener);
      cancel.addListener (SWT.Selection, new Listener () {
        @Override
        public void handleEvent (Event event) {
          shell.dispose ();
        }
      });
      return;
    }
    long current = WebKitGTK.webkit_download_get_current_size (webkitDownload) / 1024L;
    long total = WebKitGTK.webkit_download_get_total_size (webkitDownload) / 1024L;
    String message = Compatibility.getMessage ("SWT_Download_Status", new Object[] {new Long(current), new Long(total)}); //$NON-NLS-1$
    statusLabel.setText (message);
    display.timerExec (INTERVAL, this);
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
  public void run () {
    int status = WebKitGTK.webkit_download_get_status (webkitDownload);
    if (shell.isDisposed () || status == WebKitGTK.WEBKIT_DOWNLOAD_STATUS_FINISHED || status == WebKitGTK.WEBKIT_DOWNLOAD_STATUS_CANCELLED) {
      shell.dispose ();
      display.timerExec (-1, this);
      OS.g_object_unref (webkitDownload);
      return;
    }
    if (status == WebKitGTK.WEBKIT_DOWNLOAD_STATUS_ERROR) {
      statusLabel.setText (Compatibility.getMessage ("SWT_Download_Error")); //$NON-NLS-1$
      display.timerExec (-1, this);
      OS.g_object_unref (webkitDownload);
      cancel.removeListener (SWT.Selection, cancelListener);
      cancel.addListener (SWT.Selection, new Listener () {
        @Override
        public void handleEvent (Event event) {
          shell.dispose ();
        }
      });
      return;
    }
    long current = WebKitGTK.webkit_download_get_current_size (webkitDownload) / 1024L;
    long total = WebKitGTK.webkit_download_get_total_size (webkitDownload) / 1024L;
    String message = Compatibility.getMessage ("SWT_Download_Status", new Object[] {new Long(current), new Long(total)}); //$NON-NLS-1$
    statusLabel.setText (message);
    display.timerExec (INTERVAL, this);
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
  public void run () {
    int status = WebKitGTK.webkit_download_get_status (webkitDownload);
    if (shell.isDisposed () || status == WebKitGTK.WEBKIT_DOWNLOAD_STATUS_FINISHED || status == WebKitGTK.WEBKIT_DOWNLOAD_STATUS_CANCELLED) {
      shell.dispose ();
      display.timerExec (-1, this);
      OS.g_object_unref (webkitDownload);
      return;
    }
    if (status == WebKitGTK.WEBKIT_DOWNLOAD_STATUS_ERROR) {
      statusLabel.setText (Compatibility.getMessage ("SWT_Download_Error")); //$NON-NLS-1$
      display.timerExec (-1, this);
      OS.g_object_unref (webkitDownload);
      cancel.removeListener (SWT.Selection, cancelListener);
      cancel.addListener (SWT.Selection, new Listener () {
        @Override
        public void handleEvent (Event event) {
          shell.dispose ();
        }
      });
      return;
    }
    long current = WebKitGTK.webkit_download_get_current_size (webkitDownload) / 1024L;
    long total = WebKitGTK.webkit_download_get_total_size (webkitDownload) / 1024L;
    String message = Compatibility.getMessage ("SWT_Download_Status", new Object[] {new Long(current), new Long(total)}); //$NON-NLS-1$
    statusLabel.setText (message);
    display.timerExec (INTERVAL, this);
  }
});

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

browseButton.removeListener(SWT.Selection, this);
final AbstractSection finalSection = aSection;
browseButton.addListener(SWT.Selection, new Listener() {

相关文章

微信公众号

最新文章

更多

Button类方法