Class NullableSpinner

  • All Implemented Interfaces:
    org.eclipse.swt.graphics.Drawable

    public class NullableSpinner
    extends org.eclipse.swt.widgets.Composite
    Custom spinner control with null value support.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  NullableSpinner.ValueListener
      Nullable spinner value listener.
    • Field Summary

      • Fields inherited from class org.eclipse.swt.widgets.Control

        handle
    • Constructor Summary

      Constructors 
      Constructor Description
      NullableSpinner​(org.eclipse.swt.widgets.Composite parent, int style)
      Instantiates a new nullable spinner.
      NullableSpinner​(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.ui.forms.widgets.FormToolkit toolkit)
      Instantiates a new nullable spinner.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addValueListener​(NullableSpinner.ValueListener listener)
      Adds the value listener.
      int getMaximum()
      Gets the maximum allowed value.
      int getMinimum()
      Gets the minimum allowed value.
      Integer getValue()
      Gets the value.
      void removeValueListener​(NullableSpinner.ValueListener listener)
      Removes the value listener.
      void setEnabled​(boolean enabled)  
      void setMaximum​(int maximum)
      Sets the maximum allowed value.
      void setMinimum​(int minimum)
      Sets the minimum allowed value.
      void setValue​(Integer value)
      Sets the value.
      • Methods inherited from class org.eclipse.swt.widgets.Composite

        changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
      • Methods inherited from class org.eclipse.swt.widgets.Scrollable

        computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
      • Methods inherited from class org.eclipse.swt.widgets.Control

        addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
      • Methods inherited from class org.eclipse.swt.widgets.Widget

        addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
      • Methods inherited from interface org.eclipse.swt.graphics.Drawable

        isAutoScalable
    • Constructor Detail

      • NullableSpinner

        public NullableSpinner​(org.eclipse.swt.widgets.Composite parent,
                               int style)
        Instantiates a new nullable spinner.
        Parameters:
        parent - the parent.
        style - the style.
      • NullableSpinner

        public NullableSpinner​(org.eclipse.swt.widgets.Composite parent,
                               int style,
                               org.eclipse.ui.forms.widgets.FormToolkit toolkit)
        Instantiates a new nullable spinner.
        Parameters:
        parent - the parent.
        style - the style.
        toolkit - the form toolkit.
    • Method Detail

      • getValue

        public Integer getValue()
        Gets the value.
        Returns:
        the value.
      • setValue

        public void setValue​(Integer value)
        Sets the value.
        Parameters:
        value - the new value to set.
      • addValueListener

        public void addValueListener​(NullableSpinner.ValueListener listener)
        Adds the value listener.
        Parameters:
        listener - the listener, should not be null.
      • removeValueListener

        public void removeValueListener​(NullableSpinner.ValueListener listener)
        Removes the value listener.
        Parameters:
        listener - the listener, should not be null.
      • getMinimum

        public int getMinimum()
        Gets the minimum allowed value.
        Returns:
        the minimum value.
      • setMinimum

        public void setMinimum​(int minimum)
        Sets the minimum allowed value.
        Parameters:
        minimum - the new minimum value.
      • getMaximum

        public int getMaximum()
        Gets the maximum allowed value.
        Returns:
        the maximum value.
      • setMaximum

        public void setMaximum​(int maximum)
        Sets the maximum allowed value.
        Parameters:
        maximum - the new maximum value.
      • setEnabled

        public void setEnabled​(boolean enabled)
        Overrides:
        setEnabled in class org.eclipse.swt.widgets.Control