本文整理了Java中org.eclipse.swt.widgets.Spinner.setIncrement()
方法的一些代码示例,展示了Spinner.setIncrement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spinner.setIncrement()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Spinner
类名称:Spinner
方法名:setIncrement
[英]Sets the amount that the receiver's value will be modified by when the up/down arrows are pressed to the argument, which must be at least one.
[中]设置在参数上按向上/向下箭头时接收器值将被修改的量,该值必须至少为一。
代码示例来源:origin: pentaho/pentaho-kettle
wFontSize.setMinimum( 0 );
wFontSize.setMaximum( 70 );
wFontSize.setIncrement( 1 );
fdFontSize = new FormData();
fdFontSize.left = new FormAttachment( middle, 0 );
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Sets the increment of the "Example" widgets.
*/
void setWidgetIncrement () {
spinner1.setIncrement (incrementSpinner.getSelection ());
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
if (pageIncrement < 1) return;
selection = Math.min (Math.max (minimum, selection), maximum);
setIncrement (increment);
this.pageIncrement = pageIncrement;
this.digits = digits;
代码示例来源: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: inspectIT/inspectIT
parameterIndexSpinner.setMaximum(50);
parameterIndexSpinner.setSelection(0);
parameterIndexSpinner.setIncrement(1);
parameterIndexSpinner.setPageIncrement(5);
parameterIndexSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
代码示例来源:origin: org.eclipse/org.eclipse.ui.editors
spinner.setMinimum(domain.getMinimumValue().getIntValue());
spinner.setMaximum(domain.getMaximumValue().getIntValue());
spinner.setIncrement(1);
spinner.setPageIncrement(4);
代码示例来源:origin: inspectIT/inspectIT
searchDepthSpinner.setMaximum(Integer.MAX_VALUE);
searchDepthSpinner.setSelection(-1);
searchDepthSpinner.setIncrement(1);
searchDepthSpinner.setPageIncrement(100);
searchDepthSpinner.setEnabled(false);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the minimum
* attribute of the example widget.
*/
void createMinimumGroup() {
/* Create the group */
Group minimumGroup = new Group (controlGroup, SWT.NONE);
minimumGroup.setLayout (new GridLayout ());
minimumGroup.setText (ControlExample.getResourceString("Minimum"));
minimumGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
/* Create a Spinner widget */
minimumSpinner = new Spinner (minimumGroup, SWT.BORDER);
minimumSpinner.setMaximum (100000);
minimumSpinner.setSelection(getDefaultMinimum());
minimumSpinner.setPageIncrement (100);
minimumSpinner.setIncrement (1);
minimumSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
minimumSpinner.addSelectionListener (widgetSelectedAdapter(event -> setWidgetMinimum ()));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the increment
* attribute of the example widget.
*/
void createIncrementGroup() {
/* Create the group */
Group incrementGroup = new Group (controlGroup, SWT.NONE);
incrementGroup.setLayout (new GridLayout ());
incrementGroup.setText (ControlExample.getResourceString("Increment"));
incrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
/* Create the Spinner widget */
incrementSpinner = new Spinner (incrementGroup, SWT.BORDER);
incrementSpinner.setMaximum (100000);
incrementSpinner.setSelection (getDefaultIncrement());
incrementSpinner.setPageIncrement (100);
incrementSpinner.setIncrement (1);
incrementSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
incrementSpinner.addSelectionListener (widgetSelectedAdapter(e -> setWidgetIncrement ()));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the page increment
* attribute of the example widget.
*/
void createPageIncrementGroup() {
/* Create the group */
Group pageIncrementGroup = new Group (controlGroup, SWT.NONE);
pageIncrementGroup.setLayout (new GridLayout ());
pageIncrementGroup.setText (ControlExample.getResourceString("Page_Increment"));
pageIncrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
/* Create the Spinner widget */
pageIncrementSpinner = new Spinner (pageIncrementGroup, SWT.BORDER);
pageIncrementSpinner.setMaximum (100000);
pageIncrementSpinner.setSelection (getDefaultPageIncrement());
pageIncrementSpinner.setPageIncrement (100);
pageIncrementSpinner.setIncrement (1);
pageIncrementSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
pageIncrementSpinner.addSelectionListener (widgetSelectedAdapter(event -> setWidgetPageIncrement ()));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the maximum
* attribute of the example widget.
*/
void createMaximumGroup() {
/* Create the group */
Group maximumGroup = new Group (controlGroup, SWT.NONE);
maximumGroup.setLayout (new GridLayout ());
maximumGroup.setText (ControlExample.getResourceString("Maximum"));
maximumGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
/* Create a Spinner widget */
maximumSpinner = new Spinner (maximumGroup, SWT.BORDER);
maximumSpinner.setMaximum (100000);
maximumSpinner.setSelection (getDefaultMaximum());
maximumSpinner.setPageIncrement (100);
maximumSpinner.setIncrement (1);
maximumSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
maximumSpinner.addSelectionListener(widgetSelectedAdapter(event -> setWidgetMaximum ()));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the page increment
* attribute of the example widget.
*/
void createPageIncrementGroup() {
/* Create the group */
Group pageIncrementGroup = new Group (controlGroup, SWT.NONE);
pageIncrementGroup.setLayout (new GridLayout ());
pageIncrementGroup.setText (ControlExample.getResourceString("Page_Increment"));
pageIncrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
/* Create the Spinner widget */
pageIncrementSpinner = new Spinner (pageIncrementGroup, SWT.BORDER);
pageIncrementSpinner.setMaximum (100000);
pageIncrementSpinner.setSelection (getDefaultPageIncrement());
pageIncrementSpinner.setPageIncrement (100);
pageIncrementSpinner.setIncrement (1);
pageIncrementSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
pageIncrementSpinner.addSelectionListener (widgetSelectedAdapter(event -> setWidgetPageIncrement ()));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the thumb
* attribute of the example widget.
*/
void createThumbGroup() {
/* Create the group */
Group thumbGroup = new Group (controlGroup, SWT.NONE);
thumbGroup.setLayout (new GridLayout ());
thumbGroup.setText (ControlExample.getResourceString("Thumb"));
thumbGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
/* Create the Spinner widget */
thumbSpinner = new Spinner (thumbGroup, SWT.BORDER);
thumbSpinner.setMaximum (100000);
thumbSpinner.setSelection (getDefaultThumb());
thumbSpinner.setPageIncrement (100);
thumbSpinner.setIncrement (1);
thumbSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
thumbSpinner.addSelectionListener (widgetSelectedAdapter(event -> setWidgetThumb ()));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the selection
* attribute of the example widget.
*/
void createSelectionGroup() {
/* Create the group */
Group selectionGroup = new Group(controlGroup, SWT.NONE);
selectionGroup.setLayout(new GridLayout());
GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, false, false);
selectionGroup.setLayoutData(gridData);
selectionGroup.setText(ControlExample.getResourceString("Selection"));
/* Create a Spinner widget */
selectionSpinner = new Spinner (selectionGroup, SWT.BORDER);
selectionSpinner.setMaximum (100000);
selectionSpinner.setSelection (getDefaultSelection());
selectionSpinner.setPageIncrement (100);
selectionSpinner.setIncrement (1);
selectionSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
selectionSpinner.addSelectionListener(widgetSelectedAdapter(event -> setWidgetSelection ()));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the increment
* attribute of the example widget.
*/
void createIncrementGroup() {
/* Create the group */
Group incrementGroup = new Group (controlGroup, SWT.NONE);
incrementGroup.setLayout (new GridLayout ());
incrementGroup.setText (ControlExample.getResourceString("Increment"));
incrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
/* Create the Spinner widget */
incrementSpinner = new Spinner (incrementGroup, SWT.BORDER);
incrementSpinner.setMaximum (100000);
incrementSpinner.setSelection (getDefaultIncrement());
incrementSpinner.setPageIncrement (100);
incrementSpinner.setIncrement (1);
incrementSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
incrementSpinner.addSelectionListener (widgetSelectedAdapter(e -> setWidgetIncrement ()));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the digits
* attribute of the example widget.
*/
void createDigitsGroup() {
/* Create the group */
Group digitsGroup = new Group (controlGroup, SWT.NONE);
digitsGroup.setLayout (new GridLayout ());
digitsGroup.setText (ControlExample.getResourceString("Digits"));
digitsGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
/* Create the Spinner widget */
digitsSpinner = new Spinner (digitsGroup, SWT.BORDER);
digitsSpinner.setMaximum (100000);
digitsSpinner.setSelection (getDefaultDigits());
digitsSpinner.setPageIncrement (100);
digitsSpinner.setIncrement (1);
digitsSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
digitsSpinner.addSelectionListener (widgetSelectedAdapter(e -> setWidgetDigits ()));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the increment
* attribute of the example widget.
*/
void createIncrementGroup() {
/* Create the group */
Group incrementGroup = new Group (controlGroup, SWT.NONE);
incrementGroup.setLayout (new GridLayout ());
incrementGroup.setText (ControlExample.getResourceString("Increment"));
incrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
/* Create the Spinner widget */
incrementSpinner = new Spinner (incrementGroup, SWT.BORDER);
incrementSpinner.setMaximum (100000);
incrementSpinner.setSelection (getDefaultIncrement());
incrementSpinner.setPageIncrement (100);
incrementSpinner.setIncrement (1);
incrementSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
incrementSpinner.addSelectionListener (widgetSelectedAdapter(e -> setWidgetIncrement ()));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Create a group of widgets to control the page increment
* attribute of the example widget.
*/
void createPageIncrementGroup() {
/* Create the group */
Group pageIncrementGroup = new Group (controlGroup, SWT.NONE);
pageIncrementGroup.setLayout (new GridLayout ());
pageIncrementGroup.setText (ControlExample.getResourceString("Page_Increment"));
pageIncrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
/* Create the Spinner widget */
pageIncrementSpinner = new Spinner (pageIncrementGroup, SWT.BORDER);
pageIncrementSpinner.setMaximum (100000);
pageIncrementSpinner.setSelection (getDefaultPageIncrement());
pageIncrementSpinner.setPageIncrement (100);
pageIncrementSpinner.setIncrement (1);
pageIncrementSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
/* Add the listeners */
pageIncrementSpinner.addSelectionListener (widgetSelectedAdapter(event -> setWidgetPageIncrement ()));
}
代码示例来源: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.setMinimum(MIN_INDENTATION_SIZE);
fIndentationSize.setMaximum(MAX_INDENTATION_SIZE);
fIndentationSize.setIncrement(1);
fIndentationSize.setPageIncrement(4);
fIndentationSize.addModifyListener(this);
内容来源于网络,如有侵权,请联系作者删除!