本文整理了Java中org.eclipse.swt.widgets.Spinner.setMinimum()
方法的一些代码示例,展示了Spinner.setMinimum()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spinner.setMinimum()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Spinner
类名称:Spinner
方法名:setMinimum
[英]Sets the minimum value that the receiver will allow. This new value will be ignored if it is greater than the receiver's current maximum value. If the new minimum is applied then the receiver's selection value will be adjusted if necessary to fall within its new range.
[中]设置接收器允许的最小值。如果该新值大于接收器的当前最大值,则将忽略该值。如果应用了新的最小值,则接收机的选择值将在必要时调整,以在其新范围内。
代码示例来源:origin: pentaho/pentaho-kettle
wIntervalSeconds.setMinimum( 0 );
wIntervalSeconds.setMaximum( Integer.MAX_VALUE );
placeControl(
wIntervalMinutes.setMinimum( 0 );
wIntervalMinutes.setMaximum( Integer.MAX_VALUE );
placeControl(
time.setLayout( new FillLayout() );
wHour = new Spinner( time, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
wHour.setMinimum( 0 );
wHour.setMaximum( 23 );
wMinutes = new Spinner( time, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
wMinutes.setMinimum( 0 );
wMinutes.setMaximum( 59 );
placeControl( shell, BaseMessages.getString( PKG, "JobSpecial.TimeOfDay.Label" ), time, wIntervalMinutes );
wDayOfMonth.setMinimum( 1 );
wDayOfMonth.setMaximum( 30 );
placeControl( shell, BaseMessages.getString( PKG, "JobSpecial.DayOfMonth.Label" ), wDayOfMonth, wDayOfWeek );
代码示例来源:origin: pentaho/pentaho-kettle
wlFontSize.setLayoutData( fdlFontSize );
wFontSize = new Spinner( wNoteFontComp, SWT.BORDER );
wFontSize.setMinimum( 0 );
wFontSize.setMaximum( 70 );
wFontSize.setIncrement( 1 );
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void runSupport() {
spinner.setMinimum(value);
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding
@Override
void doSetIntValue(Object source, int value) {
((Spinner) source).setMinimum(value);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Sets the minimim of the "Example" widgets.
*/
@Override
void setWidgetMinimum () {
spinner1.setMinimum (minimumSpinner.getSelection ());
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
private Spinner createSpinner(Composite parent, FormToolkit toolkit) {
Spinner spinner = new Spinner(parent, SWT.BORDER);
spinner.setMinimum(0);
spinner.setMaximum(9999);
toolkit.adapt(spinner, false, false);
return spinner;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.ide.application
protected void createMaxWorkspacesField(Composite parent) {
final Label maxWorkspacesLabel = new Label(parent, SWT.NONE);
maxWorkspacesLabel.setText(IDEWorkbenchMessages.RecentWorkspacesPreferencePage_NumberOfWorkspaces_label);
maxWorkspacesField = new Spinner(parent, SWT.BORDER);
maxWorkspacesField.setTextLimit(MAX_WORKSPACES_DIGIT_COUNT);
maxWorkspacesField.setMinimum(MIN_WORKSPACS);
maxWorkspacesField.setMaximum(MAX_WORKSPACES);
maxWorkspacesField.setSelection(workspacesData.getRecentWorkspaces().length);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
protected Composite createMinOccurComp(Composite parent, FormToolkit toolkit) {
fMinLabel = toolkit.createLabel(parent, PDEUIMessages.AbstractSchemaDetails_minOccurLabel);
fMinLabel.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();
layout.marginHeight = layout.marginWidth = 0;
comp.setLayout(layout);
comp.setLayoutData(gd);
fMinOccurSpinner = new Spinner(comp, SWT.BORDER);
fMinOccurSpinner.setMinimum(0);
fMinOccurSpinner.setMaximum(999);
return comp;
}
代码示例来源: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.rap/org.eclipse.rap.rwt
private void createFontSizeGroup( Composite parent ) {
Group result = new Group( parent, SWT.NONE );
result.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) );
result.setText( RWTMessages.getMessage( "RWT_FontDialogFontSizeTitle" ) );
result.setLayout( new GridLayout() );
spFontSize = new Spinner( result, SWT.BORDER );
spFontSize.setDigits( 0 );
spFontSize.setMinimum( 0 );
spFontSize.setMaximum( 200 );
GridData spinnerData = new GridData( SWT.FILL, SWT.FILL, true, true );
spFontSize.setLayoutData( spinnerData );
}
代码示例来源: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.jdt/org.eclipse.jdt.ui
static Spinner createSpinner(Composite parentComposite, int minValue, int maxValue) {
Spinner spinner= new Spinner(parentComposite, SWT.BORDER);
spinner.setFont(parentComposite.getFont());
spinner.setMinimum(minValue);
spinner.setMaximum(maxValue);
spinner.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_END, SWT.DEFAULT, 0));
return spinner;
}
代码示例来源: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: inspectIT/inspectIT
parameterIndexSpinner.setMinimum(0);
parameterIndexSpinner.setMaximum(50);
parameterIndexSpinner.setSelection(0);
代码示例来源:origin: org.eclipse/org.eclipse.ui.editors
spinner.setLayoutData(gd);
spinner.setToolTipText(preference.getDescription());
spinner.setMinimum(domain.getMinimumValue().getIntValue());
spinner.setMaximum(domain.getMaximumValue().getIntValue());
spinner.setIncrement(1);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
petalSpinner = new Spinner(comp, SWT.BORDER | SWT.WRAP);
petalSpinner.setSelection(8);
petalSpinner.setMinimum(3);
petalSpinner.setMaximum(20);
petalSpinner.addListener(SWT.Selection, event -> example.redraw());
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
final Spinner spinner = new Spinner(table, SWT.BORDER);
spinner.setMinimum(0);
String level = item.getText(1);
int defaultLevel = level.length() == 0 || "default".equals(level) ? 0 : Integer.parseInt(level); //$NON-NLS-1$
代码示例来源:origin: eclipse-jetty/eclipse-jetty-plugin
private void createServerGroup(Composite tabComposite)
{
Composite serverGroup = createTopComposite(tabComposite, SWT.NONE, 7, -1, false, 1, 1);
createLabel(serverGroup, Messages.configTab_contextPathLabel, 128, SWT.RIGHT, 1, 1);
contextText =
createText(serverGroup, SWT.BORDER, Messages.configTab_contextPathTextTip, -1, -1, 6, 1,
modifyDialogListener);
createLabel(serverGroup, Messages.configTab_portLabel, 128, SWT.RIGHT, 1, 1);
portSpinner =
createSpinner(serverGroup, SWT.BORDER, Messages.configTab_portSpinnerTip, 32, -1, 1, 1,
modifyDialogListener);
portSpinner.setMinimum(0);
portSpinner.setMaximum(65535);
portSpinner.setIncrement(1);
portSpinner.setPageIncrement(1000);
createLabel(serverGroup, "/", 16, SWT.CENTER, 1, 1); //$NON-NLS-1$
httpsPortSpinner =
createSpinner(serverGroup, SWT.BORDER, Messages.configTab_httpProtSpinnerTip, 32, -1, 1, 1,
modifyDialogListener);
httpsPortSpinner.setMinimum(0);
httpsPortSpinner.setMaximum(65535);
httpsPortSpinner.setIncrement(1);
httpsPortSpinner.setPageIncrement(1000);
httpsEnabledButton =
createButton(serverGroup, SWT.CHECK, Messages.configTab_httpsEnableButton,
Messages.configTab_httpsEnableButtonTip, -1, 3, 1, modifyDialogListener);
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui
fIndentationSize.setLayoutData(gd);
fIndentationSize.setToolTipText(XMLUIMessages.Indentation_size_tip);
fIndentationSize.setMinimum(MIN_INDENTATION_SIZE);
fIndentationSize.setMaximum(MAX_INDENTATION_SIZE);
fIndentationSize.setIncrement(1);
代码示例来源:origin: org.xworker/xworker_swt
String minimun = self.getString("minimun");
if(minimun != null && !"".equals(minimun))
spinner.setMinimum(self.getInt("maximum", -100000));
String pageIncrement = self.getString("pageIncrement");
if(pageIncrement != null && !"".equals(pageIncrement))
内容来源于网络,如有侵权,请联系作者删除!