本文整理匯總了Java中org.eclipse.swt.widgets.Spinner.setValues方法的典型用法代碼示例。如果您正苦於以下問題:Java Spinner.setValues方法的具體用法?Java Spinner.setValues怎麽用?Java Spinner.setValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Spinner
的用法示例。
在下文中一共展示了Spinner.setValues方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: LinesPerPageDialog
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private LinesPerPageDialog(Shell parentShell)
{
shell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
shell.setText("Lines per Page");
shell.setLayout(new GridLayout(3, true));
spinner = new Spinner(shell, 0);
spinner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
spinner.setValues(bzStyledText.getLinesPerPage(), 0, 225, 0, 1, 10);
spinner.addKeyListener(this);
okButton = new Button(shell, SWT.PUSH);
okButton.setText("OK");
okButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
okButton.addSelectionListener(this);
cancelButton = new Button(shell, SWT.PUSH);
cancelButton.setText("Cancel");
cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
cancelButton.addSelectionListener(this);
shell.pack();
shell.open();
}
示例2: CharsPerLineDialog
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private CharsPerLineDialog(Shell parentShell)
{
shell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
shell.setText("Characters Per Line");
shell.setLayout(new GridLayout(3, true));
spinner = new Spinner(shell, 0);
spinner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
spinner.setValues(bzStyledText.getCharsPerLine(), 0, 27720, 0, 1, 10);
spinner.addKeyListener(this);
okButton = new Button(shell, SWT.PUSH);
okButton.setText("OK");
okButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
okButton.addSelectionListener(this);
cancelButton = new Button(shell, SWT.PUSH);
cancelButton.setText("Cancel");
cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
cancelButton.addSelectionListener(this);
shell.pack();
shell.open();
}
示例3: LineMarginBellDialog
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private LineMarginBellDialog(Shell parentShell)
{
shell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
shell.setText("Bell Margin");
shell.setLayout(new GridLayout(3, true));
spinner = new Spinner(shell, 0);
spinner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
spinner.setValues(bzStyledText.getLineMarginBell(), 0, 27720, 0, 1, 10);
spinner.addKeyListener(this);
okButton = new Button(shell, SWT.PUSH);
okButton.setText("OK");
okButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
okButton.addSelectionListener(this);
cancelButton = new Button(shell, SWT.PUSH);
cancelButton.setText("Cancel");
cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
cancelButton.addSelectionListener(this);
shell.pack();
shell.open();
}
示例4: PageMarginBellDialog
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private PageMarginBellDialog(Shell parentShell)
{
shell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
shell.setText("Bell Page");
shell.setLayout(new GridLayout(3, true));
spinner = new Spinner(shell, 0);
spinner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
spinner.setValues(bzStyledText.getPageMarginBell(), 0, 27720, 0, 1, 10);
spinner.addKeyListener(this);
okButton = new Button(shell, SWT.PUSH);
okButton.setText("OK");
okButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
okButton.addSelectionListener(this);
cancelButton = new Button(shell, SWT.PUSH);
cancelButton.setText("Cancel");
cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
cancelButton.addSelectionListener(this);
shell.pack();
shell.open();
}
示例5: createFormContent
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
@Override
protected void createFormContent(IManagedForm mform) {
mform.getForm().setText("Guide Position");
FormToolkit toolkit = mform.getToolkit();
mform.getForm().getBody().setLayout(new GridLayout(4, false));
toolkit.createLabel(mform.getForm().getBody(), "Guide Position"); //$NON-NLS-1$
final Spinner width = new Spinner(mform.getForm().getBody(), SWT.BORDER);
width.setValues(w, 0, Integer.MAX_VALUE, 0, 1, 10);
width.setToolTipText("Guide Position");
width.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
w = width.getSelection();
}
});
}
示例6: EmptyDataAdapterComposite
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
/**
* Create the composite.
*
* @param parent
* @param style
*/
public EmptyDataAdapterComposite(Composite parent, int style, JasperReportsContext jrContext) {
super(parent, style, jrContext);
setLayout(new GridLayout(2, false));
Label lblNewLabel = new Label(this, SWT.NONE);
lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
lblNewLabel.setText(Messages.EmptyDataAdapterComposite_0);
spinnerRecords = new Spinner(this, SWT.BORDER);
spinnerRecords.setValues(0, 0, Integer.MAX_VALUE, 0, 1, 10);
spinnerRecords.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
示例7: createDialogArea
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
/**
* Create the widgets for the main composite for the Dialog
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.setLayout(new GridLayout(4, false));
Label totalLabel = new Label(container, SWT.NONE);
totalLabel.setText("Quantity");
quantitySpinner = new Spinner(container, SWT.BORDER);
quantitySpinner.setLayoutData(
new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
quantitySpinner.setValues(1, 1, 10000, 0, 1, 10);
new Label(container, SWT.NONE);
// Create the X, Y, Z coordinate labels
Label labelX = new Label(container, SWT.NONE);
labelX.setLayoutData(
new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
labelX.setText("X");
Label labelY = new Label(container, SWT.NONE);
labelY.setLayoutData(
new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
labelY.setText("Y");
Label labelZ = new Label(container, SWT.NONE);
labelZ.setLayoutData(
new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
labelZ.setText("Z");
// Create the shift label
Label shiftLabel = new Label(container, SWT.NONE);
shiftLabel.setText("Shift");
// Create the X, Y, Z shift spinners
for (int i = 0; i < 3; i++) {
shiftSpinners[i] = new RealSpinner(container);
shiftSpinners[i].setBounds(-1.0e6, 1.0e6);
shiftSpinners[i].getControl().setLayoutData(
new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
}
return container;
}