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

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

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

Spinner.addModifyListener介绍

[英]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 ModifyListener interface.
[中]通过发送ModifyListener界面中定义的消息之一,将侦听器添加到侦听器集合中,当修改接收方的文本时,将通知这些侦听器。

代码示例

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

wDayOfMonth.addModifyListener( lsMod );
wDayOfMonth.setMinimum( 1 );
wDayOfMonth.setMaximum( 30 );

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

/**
 * {@inheritDoc}
 */
@Override
public Control createControl(Composite parent) {
  Composite composite = new Composite(parent, SWT.NONE);
  GridLayout gridLayout = new GridLayout(2, false);
  gridLayout.marginHeight = 0;
  gridLayout.marginWidth = 0;
  composite.setLayout(gridLayout);
  spinner = new Spinner(composite, SWT.BORDER | SWT.RIGHT);
  spinner.setValues((int) (property.getValue().floatValue() * 100), 0, 100, 0, 1, 5);
  spinner.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
  spinner.addModifyListener(new ModifyListener() {
    @Override
    public void modifyText(ModifyEvent e) {
      int selection = spinner.getSelection();
      Float value = Float.valueOf(selection / 100f);
      sendPropertyUpdateEvent(value);
    }
  });
  Label percentage = new Label(composite, SWT.NONE);
  percentage.setText("%");
  percentage.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
  return composite;
}

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

spRed = new Spinner( spinComp, SWT.BORDER );
spRed.setMaximum( MAX_RGB_COMPONENT_VALUE );
spRed.addModifyListener( new SpinnerListener( spRed, RED ) );
spGreen = new Spinner( spinComp, SWT.BORDER );
spGreen.setMaximum( MAX_RGB_COMPONENT_VALUE );
spGreen.addModifyListener( new SpinnerListener( spGreen, GREEN ) );
spBlue = new Spinner( spinComp, SWT.BORDER );
spBlue.setMaximum( MAX_RGB_COMPONENT_VALUE );
spBlue.addModifyListener( new SpinnerListener( spBlue, BLUE ) );

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

protected void hookMaxOccur(SelectionListener adapter) {
  fUnboundSelect.addSelectionListener(adapter);
  fMaxOccurSpinner.addSelectionListener(adapter);
  fMaxOccurSpinner.addModifyListener(e -> {
    if (blockListeners())
      return;
    int maxValue = fMaxOccurSpinner.getSelection();
    if (maxValue < getMinOccur())
      fMaxOccurSpinner.setSelection(maxValue + 1);
  });
}

代码示例来源:origin: eclipse/aCute

@Override public void createControl(Composite parent) {
  Composite res = new Composite(parent, SWT.NONE);
  res.setLayout(new GridLayout(3, false));
  Label pidLabel = new Label(res, SWT.NONE);
  pidLabel.setText(Messages.AttachMainTab_processId);
  // As pid is volatile, additionally to PID, we should store the
  // CLI param of selected PID to easily discover other PID started
  // with same params.
  pidText = new Spinner(res, SWT.BORDER);
  pidText.setMinimum(0);
  pidText.setMaximum(Integer.MAX_VALUE);
  pidText.setLayoutData(new GridData(120, SWT.DEFAULT));
  pidText.addModifyListener(e -> {
    setDirty(true);
    updateLaunchConfigurationDialog();
  });
  // with Java 9, add a Search button showing a "ProcessSelectionDialog"
  // filtering process using dotnet as command.
  setControl(res);
}

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

fDefaultStartLevel.addModifyListener(fListener);

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-plaintext-ui

edSource.addModifyListener(new ModifyListener() {
  public void modifyText(ModifyEvent e) {
    updateResults();

代码示例来源:origin: eclipse-jetty/eclipse-jetty-plugin

spinner.addModifyListener(modifyListener);

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

protected void hookMinOccur(SelectionListener adapter) {
  fMinOccurSpinner.addSelectionListener(adapter);
  fMinOccurSpinner.addModifyListener(e -> {
    if (blockListeners())
      return;
    int minOccur = fMinOccurSpinner.getSelection();
    if (minOccur > getMaxOccur())
      fMinOccurSpinner.setSelection(minOccur - 1);
  });
}

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

parameterIndexSpinner.setPageIncrement(5);
parameterIndexSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
parameterIndexSpinner.addModifyListener(new ModifyListener() {
  @Override
  public void modifyText(ModifyEvent e) {

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

@Override
public void createControl(Composite parent) {
  Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_HORIZONTAL);
  Composite buttonComp = SWTFactory.createComposite(composite, 6, 1, GridData.FILL_HORIZONTAL, 0, 0);
  SWTFactory.createLabel(buttonComp, PDEUIMessages.PluginsTab_launchWith, 1);
  fSelectionCombo = SWTFactory.createCombo(buttonComp, SWT.READ_ONLY | SWT.BORDER, 1, GridData.HORIZONTAL_ALIGN_BEGINNING, new String[] {PDEUIMessages.PluginsTab_allPlugins, PDEUIMessages.PluginsTab_selectedPlugins, PDEUIMessages.PluginsTab_customFeatureMode});
  fSelectionCombo.select(DEFAULT_SELECTION);
  fSelectionCombo.addSelectionListener(fListener);
  Label label = SWTFactory.createLabel(buttonComp, PDEUIMessages.EquinoxPluginsTab_defaultStart, 1);
  GridData gd = new GridData();
  gd.horizontalIndent = 20;
  label.setLayoutData(gd);
  fDefaultStartLevel = new Spinner(buttonComp, SWT.BORDER);
  fDefaultStartLevel.setMinimum(1);
  fDefaultStartLevel.addModifyListener(fListener);
  label = SWTFactory.createLabel(buttonComp, PDEUIMessages.EquinoxPluginsTab_defaultAuto, 1);
  gd = new GridData();
  gd.horizontalIndent = 20;
  label.setLayoutData(gd);
  fDefaultAutoStart = SWTFactory.createCombo(buttonComp, SWT.BORDER | SWT.READ_ONLY, 1, GridData.HORIZONTAL_ALIGN_BEGINNING, new String[] {Boolean.toString(true), Boolean.toString(false)});
  fDefaultAutoStart.select(0);
  fDefaultAutoStart.addSelectionListener(fListener);
  Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
  separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  fBlock.createControl(composite, 7, 10);
  setControl(composite);
  Dialog.applyDialogFont(composite);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.LAUNCHER_ADVANCED);
}

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

spinner.addModifyListener(e -> applySpinners(true));

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

searchDepthSpinner.setToolTipText("A value of -1 means that no limit for the search depth is used!");
searchDepthSpinner.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
searchDepthSpinner.addModifyListener(new ModifyListener() {
  @Override
  public void modifyText(ModifyEvent e) {

代码示例来源:origin: org.eclipse/org.eclipse.wst.server.ui

autoPublishTime.addModifyListener(new ModifyListener() {
  public void modifyText(ModifyEvent e) {
    if (updating)

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

int defaultLevel = level.length() == 0 || "default".equals(level) ? 0 : Integer.parseInt(level); //$NON-NLS-1$
spinner.setSelection(defaultLevel);
spinner.addModifyListener(e -> {
  int selection1 = spinner.getSelection();
  item.setText(1, selection1 == 0 ? "default" //$NON-NLS-1$

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

parameterIndexSpinner.setPageIncrement(5);
parameterIndexSpinner.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
parameterIndexSpinner.addModifyListener(new ModifyListener() {
  @Override
  public void modifyText(ModifyEvent e) {

代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui

fIndentationSize.setIncrement(1);
fIndentationSize.setPageIncrement(4);
fIndentationSize.addModifyListener(this);

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

spinMaxImages.setSelection(250);
spinMaxImages.setLayoutData(GridDataFactory.fillDefaults().create());
spinMaxImages.addModifyListener(e -> {
  page = 0; // reset to 1st page
  scanImages();

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

spinner.addModifyListener(e -> applySpinners(false));

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

int defaultLevel = level.length() == 0 || "default".equals(level) ? 0 : Integer.parseInt(level); //$NON-NLS-1$
spinner.setSelection(defaultLevel);
spinner.addModifyListener(e1 -> {
  if (item.getChecked()) {
    int selection = spinner.getSelection();

相关文章