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

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

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

Spinner.setEnabled介绍

暂无

代码示例

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

wIntervalSeconds.setEnabled( false );
 wIntervalMinutes.setEnabled( false );
 wDayOfWeek.setEnabled( false );
 wDayOfMonth.setEnabled( false );
 wHour.setEnabled( false );
 wMinutes.setEnabled( false );
} else if ( INTERVAL.equals( wType.getText() ) ) {
 wIntervalSeconds.setEnabled( true );
 wIntervalMinutes.setEnabled( true );
 wDayOfWeek.setEnabled( false );
 wDayOfMonth.setEnabled( false );
 wHour.setEnabled( false );
 wMinutes.setEnabled( false );
} else if ( DAILY.equals( wType.getText() ) ) {
 wIntervalSeconds.setEnabled( false );
 wIntervalMinutes.setEnabled( false );
 wDayOfWeek.setEnabled( false );
 wDayOfMonth.setEnabled( false );
 wHour.setEnabled( true );
 wMinutes.setEnabled( true );
} else if ( WEEKLY.equals( wType.getText() ) ) {
 wIntervalSeconds.setEnabled( false );
 wIntervalMinutes.setEnabled( false );
 wDayOfWeek.setEnabled( true );
 wDayOfMonth.setEnabled( false );
 wHour.setEnabled( true );
 wMinutes.setEnabled( true );
} else if ( MONTHLY.equals( wType.getText() ) ) {
 wIntervalSeconds.setEnabled( false );

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-verification-ui

private void updateAbsoluteMaxCharLength() {
  boolean enabled = chkAbsoluteMaxCharLength.getSelection();
  spAbsoluteMaxCharLength.setEnabled(enabled);
}

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

public void widgetSelected(SelectionEvent e) {
    volumeLabel.setEnabled(enableButton.getSelection());
    volume.setEnabled(enableButton.getSelection());
  }
});

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

/**
 * Sets the state of the "Example" widgets.
 */
@Override
void setExampleWidgetState () {
  super.setExampleWidgetState ();
  if (indeterminateButton.getSelection ()) {
    selectionSpinner.setEnabled (false);
    minimumSpinner.setEnabled (false);
    maximumSpinner.setEnabled (false);
  } else {
    selectionSpinner.setEnabled (true);
    minimumSpinner.setEnabled (true);
    maximumSpinner.setEnabled (true);
  }
  smoothButton.setSelection ((progressBar1.getStyle () & SWT.SMOOTH) != 0);
  indeterminateButton.setSelection ((progressBar1.getStyle () & SWT.INDETERMINATE) != 0);
}

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

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

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

protected void enableMinMax(boolean enable) {
  fMinOccurSpinner.setEnabled(enable);
  fMaxOccurSpinner.setEnabled(!fUnboundSelect.getSelection() && enable);
  fUnboundSelect.setEnabled(enable);
  fMinLabel.setEnabled(enable);
  fMaxLabel.setEnabled(enable);
}

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

public void widgetSelected(SelectionEvent e) {
    autoPublishLocalTimeLabel.setEnabled(autoPublishLocal.getSelection());
    autoPublishLocalTime.setEnabled(autoPublishLocal.getSelection());
  }
});

代码示例来源:origin: net.sf.okapi.steps/okapi-step-leveraging-ui

public void widgetSelected(SelectionEvent e) {
    stFillTargetThreshold.setEnabled(chkFillTarget.getSelection());
    spnFillTargetThreshold.setEnabled(chkFillTarget.getSelection());
    chkFillIfTargetIsEmpty.setEnabled(chkFillTarget.getSelection());
    if ( chkFillTarget.getSelection() ) {
      chkFillIfTargetIsSameAsSource.setEnabled(chkFillIfTargetIsEmpty.getSelection());
    }
    else {
      chkFillIfTargetIsSameAsSource.setEnabled(false);
    }
  }
});

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

public void widgetSelected(SelectionEvent e) {
    autoPublishRemoteTimeLabel.setEnabled(autoPublishRemote.getSelection());
    autoPublishRemoteTime.setEnabled(autoPublishRemote.getSelection());
  }
});

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

protected void updateMaxOccur(int max) {
  if (fMaxOccurSpinner == null)
    return;
  boolean isMax = max == Integer.MAX_VALUE;
  fUnboundSelect.setSelection(isMax);
  fMaxOccurSpinner.setEnabled(!isMax);
  if (!isMax)
    fMaxOccurSpinner.setSelection(max);
}

代码示例来源:origin: net.sf.okapi.steps/okapi-step-leveraging-ui

public void widgetSelected(SelectionEvent e) {
    edTargetPrefix.setEnabled(chkUseTargetPrefix.getSelection());
    stTargetPrefixThreshold.setEnabled(chkUseTargetPrefix.getSelection());
    spnTargetPrefixThreshold.setEnabled(chkUseTargetPrefix.getSelection());
  }
});

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

/**
 * {@inheritDoc}
 */
@Override
protected void updateEnabledState() {
  super.updateEnabledState();
  if (useSearchInDepthComposite) {
    depthSpinner.setEnabled(isEditable() && searchInTraceCheckBox.getSelection());
  }
}

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

/**
 *     select the outputFileButton and enable rest of the widgets if enable true
 *   deselect the outputFileButton and disable rest of the widgets if enable false
 */
private void setEnableTracingOutputFile(boolean enable) {
  tracingOutputFileButton.setSelection(enable);
  tracingFileText.setEnabled(enable);
  maximumFileSizeSpinner.setEnabled(enable);
  maximumFileCountSpinner.setEnabled(enable);
  tracingFileBrowseButton.setEnabled(enable);
  tracingFileMaxCountLabel.setEnabled(enable);
  tracingFileMaxSizeLabel.setEnabled(enable);
}
/**

代码示例来源: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: inspectIT/inspectIT

/**
 * Sets the enabled state of the main content part.
 *
 * @param enabled
 *            enabled state
 */
private void setMainPartEnabled(boolean enabled) {
  for (Control control : childControls) {
    if ((null != control) && !(control instanceof Label)) {
      control.setEnabled(enabled);
    }
  }
  for (Entry<String, Set<Control>> optionalControlEntry : optionalControls.entrySet()) {
    for (Control control : optionalControlEntry.getValue()) {
      if ((null != control) && !(control instanceof Label)) {
        control.setEnabled(enabled);
      }
    }
  }
  if (searchInTraceCheckBox.getSelection()) {
    searchDepthSpinner.setEnabled(enabled);
  } else {
    searchDepthSpinner.setEnabled(false);
  }
  getManagedForm().getForm().layout(true, true);
}

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

maximumFileSizeSpinner.setEnabled(enableTracing);
maximumFileCountSpinner.setEnabled(enableTracing);
tracingFileBrowseButton.setEnabled(enableTracing);
tracingOutputFileButton.setEnabled(enableTracing);

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

protected Composite createMaxOccurComp(Composite parent, FormToolkit toolkit) {
  fMaxLabel = toolkit.createLabel(parent, PDEUIMessages.AbstractSchemaDetails_maxOccurLabel);
  fMaxLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
  Composite comp = toolkit.createComposite(parent);
  GridData gd = new GridData(GridData.FILL_HORIZONTAL);
  gd.horizontalSpan = 2;
  GridLayout layout = new GridLayout(3, false);
  layout.marginHeight = layout.marginWidth = 0;
  comp.setLayout(layout);
  comp.setLayoutData(gd);
  fMaxOccurSpinner = new Spinner(comp, SWT.BORDER);
  fMaxOccurSpinner.setMinimum(1);
  fMaxOccurSpinner.setMaximum(999);
  fMaxOccurSpinner.setIncrement(1);
  fUnboundSelect = toolkit.createButton(comp, PDEUIMessages.AbstractSchemaDetails_unboundedButton, SWT.CHECK);
  gd = new GridData();
  gd.horizontalIndent = 10;
  fUnboundSelect.setLayoutData(gd);
  fUnboundSelect.addSelectionListener(widgetSelectedAdapter(e -> {
    if (blockListeners())
      return;
    fMaxOccurSpinner.setEnabled(!fUnboundSelect.getSelection() && isEditableElement());
  }));
  return comp;
}

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

maximumFileSizeSpinner.setEnabled(enableTracing);
maximumFileCountSpinner.setEnabled(enableTracing);
tracingFileBrowseButton.setEnabled(enableTracing);
tracingFileLabel.setEnabled(enableTracing);

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

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

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

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

相关文章