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

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

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

Spinner.setSelection介绍

[英]Sets the selection, which is the receiver's position, to the argument. If the argument is not within the range specified by minimum and maximum, it will be adjusted to fall within this range.
[中]将selection(接收器的位置)设置为参数。如果参数不在“最小值”和“最大值”指定的范围内,它将被调整为在此范围内。

代码示例

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

public void getData() {
 if ( !jobEntry.isDummy() ) {
  wRepeat.setSelection( jobEntry.isRepeat() );
  wType.select( jobEntry.getSchedulerType() );
  wIntervalSeconds.setSelection( jobEntry.getIntervalSeconds() );
  wIntervalMinutes.setSelection( jobEntry.getIntervalMinutes() );
  wHour.setSelection( jobEntry.getHour() );
  wMinutes.setSelection( jobEntry.getMinutes() );
  wDayOfWeek.select( jobEntry.getWeekDay() );
  wDayOfMonth.setSelection( jobEntry.getDayOfMonth() );
  wType.addSelectionListener( lsDef );
 }
 wName.setText( jobEntry.getName() );
}

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

wFontName.setText( notePadMeta.getFontName() == null ? props.getNoteFont().getName() : notePadMeta
  .getFontName() );
 wFontSize.setSelection( notePadMeta.getFontSize() == -1 ? props.getNoteFont().getHeight() : notePadMeta
  .getFontSize() );
 wFontBold.setSelection( notePadMeta.isFontBold() );
} else {
 wFontName.setText( props.getNoteFont().getName() );
 wFontSize.setSelection( props.getNoteFont().getHeight() );
 wFontBold.setSelection( false );
 wFontItalic.setSelection( false );

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

private void resetProgressBarGeometry() {
  // X Offset
  fBarSpinners[0].setSelection(SplashInfo.F_DEFAULT_BAR_X_OFFSET);
  // Y Offset
  fBarSpinners[1].setSelection(SplashInfo.F_DEFAULT_BAR_Y_OFFSET);
  // Width
  fBarSpinners[2].setSelection(SplashInfo.F_DEFAULT_BAR_WIDTH);
  // Height
  fBarSpinners[3].setSelection(SplashInfo.F_DEFAULT_BAR_HEIGHT);
}

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

private void updateSpinners() {
 spRed.setSelection( rgb.red );
 spGreen.setSelection( rgb.green );
 spBlue.setSelection( rgb.blue );
}

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

private void resetProgressMessageGeometry() {
  // X Offset
  fMessageSpinners[0].setSelection(SplashInfo.F_DEFAULT_MESSAGE_X_OFFSET);
  // Y Offset
  fMessageSpinners[1].setSelection(SplashInfo.F_DEFAULT_MESSAGE_Y_OFFSET);
  // Width
  fMessageSpinners[2].setSelection(SplashInfo.F_DEFAULT_MESSAGE_WIDTH);
  // Height
  fMessageSpinners[3].setSelection(SplashInfo.F_DEFAULT_MESSAGE_HEIGHT);
}

代码示例来源:origin: heeckhau/mousefeed

/**
   * Make UI indicate the current keyboard shortcut configuration threshold.
   * @param enabled the value shown by UI. 
   */
  private void updateConfigureKeyboardShortcutThreshold(final int threshold) {
    configureKeyboardShortcutThreshold.setSelection(threshold);
  }
}

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

/**
   * {@inheritDoc}
   */
  @Override
  protected void showDefaultValue() {
    spinner.setSelection((int) (property.getDefaultValue().floatValue() * 100));
  }
}

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

/**
   * Sets the selection of the "Example" widgets.
   */
  @Override
  void setWidgetSelection () {
    spinner1.setSelection (selectionSpinner.getSelection ());
  }
}

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

/**
 * Resets the search in trace section.
 */
private void resetSearchInTraceSection() {
  searchInTraceCheckBox.setSelection(false);
  searchDepthSpinner.setSelection(-1);
  searchDepthSpinner.setEnabled(false);
}

代码示例来源:origin: Nodeclipse/EditBox

@Override
  public void widgetSelected(SelectionEvent e) {
    int alpha = scale.getSelection() * 255/100;
    spinner.setSelection(alpha);
    theme.setAlpha(alpha);
  }
});

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

@Override
  public void runSupport() {
    if ( !spinner.isDisposed()){
      spinner.setSelection( adapter.getIntValue(sParamName));
    }
  }
});

代码示例来源:origin: org.codehaus.openxma/xmartclient

public void setLocale(Locale locale) {
  monthChooser.setLocale(locale);
  dayChooser.setLocale(locale);
  yearChooser.setSelection(getCalendar().get(Calendar.YEAR));
}

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

/**
 * {@inheritDoc}
 */
@Override
protected void executeSpecificInitialization(StringMatchingExpression expression) {
  if (expression.isSearchNodeInTrace() && useSearchInDepthComposite) {
    searchInTraceCheckBox.setSelection(true);
    depthSpinner.setSelection(expression.getMaxSearchDepth());
    depthSpinner.setEnabled(true);
  }
}

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

private void updateControls() {
 String fontName = fontData.getName();
 if( !txtFontFamily.getText().equals( fontName ) ) {
  txtFontFamily.setText( fontName );
 }
 selectFontFamilyInList( fontName );
 spFontSize.setSelection( fontData.getHeight() );
 cbBold.setSelection( ( fontData.getStyle() & SWT.BOLD ) != 0 );
 cbItalic.setSelection( ( fontData.getStyle() & SWT.ITALIC ) != 0 );
 updatePreview();
}

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

public void initializeFrom(ILaunchConfiguration config) throws CoreException {
  initializeFramework(config);
  boolean auto = config.getAttribute(IPDELauncherConstants.DEFAULT_AUTO_START, true);
  fDefaultAutoStart.setText(Boolean.toString(auto));
  int level = config.getAttribute(IPDELauncherConstants.DEFAULT_START_LEVEL, 4);
  fDefaultStartLevel.setSelection(level);
}

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

/**
 * @see PreferencePage#performDefaults()
 */
protected void performDefaults() {
  AudioCore core = AudioCore.getInstance();
  
  enableButton.setSelection(core.getDefaultSoundsEnabled());
  volume.setSelection(core.getDefaultVolume());

  userSoundMap = new HashMap();
  viewer.refresh();

  super.performDefaults();
}

代码示例来源: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: org.eclipse.swt.cocoa.macosx/x86_64

void textDidChange (long /*int*/ id, long /*int*/ sel, long /*int*/ aNotification) {
  super.textDidChange (id, sel, aNotification);
  boolean [] parseFail = new boolean [1];
  int value = getSelectionText (parseFail);
  if (!parseFail [0]) {
    int pos = (int)buttonView.doubleValue();
    if (value != pos) {
      setSelection (value, true, false, true);
    }
  }
  postEvent (SWT.Modify);
}

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

@Override
protected void executeSpecificInitialization(StringMatchingExpression expression) {
  if (isValidExpression(expression)) {
    super.executeSpecificInitialization(expression);
    methodSignatureText.setText(getStringValueSource().getMethodSignature());
    parameterIndexSpinner.setSelection(getStringValueSource().getParameterIndex());
  }
}

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

相关文章