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

x33g5p2x  于2022-01-30 转载在 其他  
字(12.5k)|赞(0)|评价(0)|浏览(145)

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

Spinner.addListener介绍

暂无

代码示例

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

if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Selection,typedListener);
addListener(SWT.DefaultSelection,typedListener);

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

if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Selection,typedListener);
addListener(SWT.DefaultSelection,typedListener);

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

if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Selection,typedListener);
addListener(SWT.DefaultSelection,typedListener);

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

if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection,typedListener);
addListener (SWT.DefaultSelection,typedListener);

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener (SWT.Selection,typedListener);
addListener (SWT.DefaultSelection,typedListener);

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

addListener( SWT.Selection, typedListener );
addListener( SWT.DefaultSelection, typedListener );

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

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is modified, by sending
 * it one of the messages defined in the <code>ModifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 ModifyListener
 * @see #removeModifyListener
 */
public void addModifyListener (ModifyListener listener) {
  checkWidget ();
  if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
  TypedListener typedListener = new TypedListener (listener);
  addListener (SWT.Modify, typedListener);
}

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

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is verified, by sending
 * it one of the messages defined in the <code>VerifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 VerifyListener
 * @see #removeVerifyListener
 */
void addVerifyListener (VerifyListener listener) {
  checkWidget();
  if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
  TypedListener typedListener = new TypedListener (listener);
  addListener (SWT.Verify, typedListener);
}

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

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is modified, by sending
 * it one of the messages defined in the <code>ModifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 ModifyListener
 * @see #removeModifyListener
 */
public void addModifyListener( ModifyListener listener ) {
 checkWidget();
 if( listener == null ) {
  SWT.error( SWT.ERROR_NULL_ARGUMENT );
 }
 TypedListener typedListener = new TypedListener( listener );
 addListener( SWT.Modify, typedListener );
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is verified, by sending
 * it one of the messages defined in the <code>VerifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 VerifyListener
 * @see #removeVerifyListener
 */
void addVerifyListener (VerifyListener listener) {
  checkWidget();
  if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
  TypedListener typedListener = new TypedListener (listener);
  addListener (SWT.Verify, typedListener);
}

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

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is verified, by sending
 * it one of the messages defined in the <code>VerifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 VerifyListener
 * @see #removeVerifyListener
 */
void addVerifyListener (VerifyListener listener) {
  checkWidget();
  if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
  TypedListener typedListener = new TypedListener (listener);
  addListener (SWT.Verify, typedListener);
}

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

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is modified, by sending
 * it one of the messages defined in the <code>ModifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 ModifyListener
 * @see #removeModifyListener
 */
public void addModifyListener (ModifyListener listener) {
  checkWidget ();
  if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
  TypedListener typedListener = new TypedListener (listener);
  addListener (SWT.Modify, typedListener);
}

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

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is modified, by sending
 * it one of the messages defined in the <code>ModifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 ModifyListener
 * @see #removeModifyListener
 */
public void addModifyListener (ModifyListener listener) {
  checkWidget ();
  if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
  TypedListener typedListener = new TypedListener (listener);
  addListener (SWT.Modify, typedListener);
}

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

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is verified, by sending
 * it one of the messages defined in the <code>VerifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 VerifyListener
 * @see #removeVerifyListener
 */
void addVerifyListener (VerifyListener listener) {
  checkWidget();
  if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
  TypedListener typedListener = new TypedListener (listener);
  addListener (SWT.Verify, typedListener);
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is modified, by sending
 * it one of the messages defined in the <code>ModifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 ModifyListener
 * @see #removeModifyListener
 */
public void addModifyListener (ModifyListener listener) {
  checkWidget ();
  if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
  TypedListener typedListener = new TypedListener (listener);
  addListener (SWT.Modify, typedListener);
}

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

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is verified, by sending
 * it one of the messages defined in the <code>VerifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 VerifyListener
 * @see #removeVerifyListener
 */
void addVerifyListener (VerifyListener listener) {
  checkWidget();
  if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
  TypedListener typedListener = new TypedListener (listener);
  addListener (SWT.Verify, typedListener);
}

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

/**
 * Adds the listener to the collection of listeners who will
 * be notified when the receiver's text is modified, by sending
 * it one of the messages defined in the <code>ModifyListener</code>
 * interface.
 *
 * @param listener the listener which should 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 ModifyListener
 * @see #removeModifyListener
 */
public void addModifyListener (ModifyListener listener) {
  checkWidget ();
  if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
  TypedListener typedListener = new TypedListener (listener);
  addListener (SWT.Modify, typedListener);
}

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

/**
 * Sets up control listeners.
 */
private void setupListeners() {
  thresholdBox.addVerifyListener(new VerifyListener() {
    // verifies whether input is a valid number
    @Override
    public void verifyText(VerifyEvent event) {
      Text text = (Text) event.getSource();
      final String previousText = text.getText();
      String newText = previousText.substring(0, event.start) + event.text + previousText.substring(event.end);
      if (!newText.isEmpty() && !NumberUtils.isNumber(newText)) {
        event.doit = false;
      }
    }
  });
  LineNumbersStyleListener.apply(emailsBox);
  Listener pageCompletionListener = new Listener() {
    @Override
    public void handleEvent(Event event) {
      setPageComplete(isPageComplete());
      setPageMessage();
    }
  };
  thresholdBox.addListener(SWT.Modify, pageCompletionListener);
  timerangeSpinner.addListener(SWT.Modify, pageCompletionListener);
  emailsBox.addListener(SWT.Modify, pageCompletionListener);
}

代码示例来源:origin: stackoverflow.com

spinner.setIncrement(10);
spinner.addListener(SWT.Verify, new Listener()

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

lineWidthSpinner.setMinimum(1);
lineWidthSpinner.setMaximum(30);
lineWidthSpinner.addListener(SWT.Selection, event -> example.redraw());

相关文章