本文整理了Java中org.eclipse.swt.widgets.Spinner.<init>()
方法的一些代码示例,展示了Spinner.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spinner.<init>()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Spinner
类名称:Spinner
方法名:<init>
[英]Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
The style value is either one of the style constants defined in class SWT
which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int
"|" operator) two or more of those SWT
style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.
[中]根据该类的父类和描述其行为和外观的样式值,构造该类的新实例。
样式值可以是类SWT
中定义的样式常量之一,该类适用于该类的实例,或者必须通过位或组合(即使用int
“|”运算符)两个或多个SWT
样式常量来构建。类描述列出了适用于该类的样式常量。样式位也继承自超类。
代码示例来源:origin: pentaho/pentaho-kettle
placeControl( shell, BaseMessages.getString( PKG, "JobSpecial.Type.Label" ), wType, wRepeat );
wIntervalSeconds = new Spinner( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
wIntervalSeconds.setMinimum( 0 );
wIntervalSeconds.setMaximum( Integer.MAX_VALUE );
shell, BaseMessages.getString( PKG, "JobSpecial.IntervalSeconds.Label" ), wIntervalSeconds, wType );
wIntervalMinutes = new Spinner( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
wIntervalMinutes.setMinimum( 0 );
wIntervalMinutes.setMaximum( Integer.MAX_VALUE );
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.DayOfWeek.Label" ), wDayOfWeek, time );
wDayOfMonth = new Spinner( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
wDayOfMonth.addModifyListener( lsMod );
wDayOfMonth.setMinimum( 1 );
代码示例来源:origin: pentaho/pentaho-kettle
fdlFontSize.right = new FormAttachment( middle, -margin );
wlFontSize.setLayoutData( fdlFontSize );
wFontSize = new Spinner( wNoteFontComp, SWT.BORDER );
wFontSize.setMinimum( 0 );
wFontSize.setMaximum( 70 );
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
/* Compute the widget style */
int style = getDefaultStyle();
if (readOnlyButton.getSelection ()) style |= SWT.READ_ONLY;
if (borderButton.getSelection ()) style |= SWT.BORDER;
if (wrapButton.getSelection ()) style |= SWT.WRAP;
/* Create the example widgets */
spinner1 = new Spinner (spinnerGroup, style);
}
代码示例来源: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: heeckhau/mousefeed
/**
* Creates the control for {@link #configureKeyboardShortcutThreshold}.
*/
private Spinner createConfigureKeyboardShortcutThreshold(
final Composite container, final Control above) {
notNull(container);
final Label label = new Label(container, SWT.NONE);
label.setText(
MESSAGES.get("field.configureKeyboardShortcutThreshold.label"));
placeUnder(label, above, STACKED_V_OFFSET);
final Spinner spinner = new Spinner(container, SWT.NONE);
spinner.setToolTipText(
MESSAGES.get("field.configureKeyboardShortcutThreshold.tooltip"));
placeUnder(spinner, label, STACKED_V_OFFSET);
return spinner;
}
代码示例来源: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: 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.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.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 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 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 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 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 ()));
}
内容来源于网络,如有侵权,请联系作者删除!