Package org.eclipse.jface.widgets
Class SpinnerFactory
java.lang.Object
org.eclipse.jface.widgets.AbstractWidgetFactory<F,C,Composite>
  
org.eclipse.jface.widgets.AbstractControlFactory<SpinnerFactory,Spinner>
 
org.eclipse.jface.widgets.SpinnerFactory
This class provides a convenient shorthand for creating and initializing
 
Spinner. This offers several benefits over creating Spinner normal
 way:
 - The same factory can be used many times to create several Spinner instances
- The setters on SpinnerFactory all return "this", allowing them to be chained
 Note that this class does not extend AbstractCompositeFactory even
 though Spinner extends Composite. This is because Spinner is not supposed to
 be used like a Composite.
 
- Since:
- 3.18
- 
Method SummaryModifier and TypeMethodDescriptionbounds(int minimum, int maximum) Sets the minimum and maximum value that the receiver will allow.increment(int increment, int pageIncrement) Sets the amounts (which must be at least one) that the receiver's value will be modified by when the up/down arrows or the page up/down keys are pressed to the argument.limitTo(int limit) Sets the maximum number of characters that the receiver's text field is capable of holding to be the argument.static SpinnerFactorynewSpinner(int style) Creates a new SpinnerFactory with the given style.onModify(ModifyListener listener) Adds the listener to the collection of listeners who will be notified when the receiver's text is modified, by calling the modifyText method.onSelect(Consumer<SelectionEvent> consumer) Creates aSelectionListenerand registers it for the widgetSelected event.Methods inherited from class org.eclipse.jface.widgets.AbstractControlFactorybackground, enabled, font, foreground, layoutData, orientation, supplyLayoutData, tooltipMethods inherited from class org.eclipse.jface.widgets.AbstractWidgetFactoryaddProperty, cast, create, data, data
- 
Method Details- 
newSpinnerCreates a new SpinnerFactory with the given style. Refer toSpinner(Composite, int)for possible styles.- Returns:
- a new SpinnerFactory instance
 
- 
boundsSets the minimum and maximum value that the receiver will allow.- Parameters:
- minimum- the minimum
- maximum- the maximum
- Returns:
- this
- See Also:
 
- 
incrementSets the amounts (which must be at least one) that the receiver's value will be modified by when the up/down arrows or the page up/down keys are pressed to the argument.- Parameters:
- increment- the increment (must be greater than zero)
- pageIncrement- the page increment (must be greater than zero)
- Returns:
- this
- See Also:
 
- 
limitToSets the maximum number of characters that the receiver's text field is capable of holding to be the argument.- Parameters:
- limit- the limit
- Returns:
- this
- See Also:
 
- 
onSelectCreates aSelectionListenerand registers it for the widgetSelected event. If the receiver is selected by the user the given consumer is invoked. TheSelectionEventis passed to the consumer.- Parameters:
- consumer- the consumer whose accept method is called
- Returns:
- this
- See Also:
 
- 
onModifyAdds the listener to the collection of listeners who will be notified when the receiver's text is modified, by calling the modifyText method.Can be called several times to add more than one ModifyListener. - Parameters:
- listener- the listener which should be notified
- Returns:
- this
- See Also:
 
 
-