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

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

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

Scale.addListener介绍

暂无

代码示例

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

public void addListener(Listener listener)
{
  slider.addListener( SWT.Selection, listener );
}

代码示例来源: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.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.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.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.rap/org.eclipse.rap.rwt

/**
 * Adds the listener to the collection of listeners who will be notified when
 * the user changes the receiver's value, by sending it one of the messages
 * defined in the <code>SelectionListener</code> interface.
 * <p>
 * <code>widgetSelected</code> is called when the user changes the receiver's
 * value. <code>widgetDefaultSelected</code> is not called.
 * </p>
 *
 * @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 SelectionListener
 * @see #removeSelectionListener
 */
public void addSelectionListener( SelectionListener listener ) {
 checkWidget();
 if( listener == null ) {
  SWT.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.s390x

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

代码示例来源:origin: diffplug/gradle-and-eclipse-rcp

public EventBased(Composite parent, int initialValue) {
  super(parent, initialValue);
  this.value = initialValue;
  inputField.addListener(SWT.Modify, e -> {
    try {
      int parsed = Integer.parseInt(inputField.getText());
      setValue(parsed);
    } catch (Exception error) {
      outputField.setText(msgForError(error));
    }
  });
  scale.addListener(SWT.Selection, e -> {
    setValue(scale.getSelection());
  });
}

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

privacy_scale.addListener(
  SWT.Selection,
  new Listener()

代码示例来源:origin: com.diffplug.durian/durian-swt

scale.setMaximum(SCALE_MAX);
Layouts.setGridData(scale).grabHorizontal().horizontalSpan(3);
scale.addListener(SWT.Selection, event -> {
  double value = mapping.scaleToValue(scale.getSelection());
  box.set(value);

代码示例来源:origin: diffplug/gradle-and-eclipse-rcp

public FrpBased(Composite parent, int initialValue) {
  super(parent, initialValue);
  value = BehaviorSubject.create(initialValue);
  RxBox<String> rwText = SwtRx.textImmediate(inputField);
  Rx.subscribe(rwText, text -> {
    try {
      int parsed = Integer.parseInt(text);
      value.onNext(parsed);
    } catch (Exception error) {
      outputField.setText(msgForError(error));
    }
  });
  scale.addListener(SWT.Selection, e -> {
    value.onNext(scale.getSelection());
  });
  Rx.subscribe(value.map(Object::toString), rwText::set);
  Rx.subscribe(value.map(this::msgForValue), outputField::setText);
  Rx.subscribe(value, scale::setSelection);
}

代码示例来源:origin: diffplug/gradle-and-eclipse-rcp

scale.setMaximum(255);
Rx.subscribe(luminance, scale::setSelection);
scale.addListener(SWT.Selection, e -> {
  luminance.set(scale.getSelection());
});

代码示例来源:origin: diffplug/gradle-and-eclipse-rcp

@Test
  public void testControl() {
    InteractiveTest.testCoat("Should show the YCbCr plane at various values of Y", cmp -> {
      Layouts.setGrid(cmp);

      Scale scale = new Scale(cmp, SWT.HORIZONTAL);
      scale.setMinimum(0);
      scale.setMaximum(255);
      scale.setSelection(128);
      Layouts.setGridData(scale).grabHorizontal();

      ColorPicker colors = new ColorPicker(cmp);
      Layouts.setGridData(colors).grabAll();

      scale.addListener(SWT.Selection, e -> {
        colors.setY(scale.getSelection());
      });
    });
  }
}

相关文章